[PATCH v20 9/9] drm/i915: Added addtional debug prints

Stanislav Lisovskiy stanislav.lisovskiy at intel.com
Wed Mar 11 12:05:55 UTC 2020


For investigating NULL ptr dereference happening presumably
from using inactive crtc, when evaluating SAGV on older gens.

Experimental patch, not for upstreaming.
---
 drivers/gpu/drm/i915/intel_pm.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 733538a6f580..f90f7d7ac61e 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3872,8 +3872,12 @@ static bool skl_can_enable_sagv_on_pipe(struct intel_crtc_state *crtc_state)
 	struct intel_plane *plane;
 	int level, latency;
 
+	DRM_DEBUG_KMS("Got crtc state %p dev_priv %p\n", crtc_state, dev_priv);
+
 	crtc = to_intel_crtc(crtc_state->uapi.crtc);
 
+	DRM_DEBUG_KMS("Got crtc %p atomic state %p\n", crtc, state);
+
 	if ((INTEL_GEN(dev_priv) <= 9) && (hweight8(state->active_pipes) > 1))
 		return false;
 
@@ -3887,6 +3891,8 @@ static bool skl_can_enable_sagv_on_pipe(struct intel_crtc_state *crtc_state)
 		struct skl_plane_wm *wm =
 			&crtc_state->wm.skl.optimal.planes[plane->id];
 
+		DRM_DEBUG_KMS("Got wm %p plane %p\n", wm, plane);
+
 		/* Skip this plane if it's not enabled */
 		if (!wm->wm[0].plane_en)
 			continue;
@@ -3896,8 +3902,12 @@ static bool skl_can_enable_sagv_on_pipe(struct intel_crtc_state *crtc_state)
 		     !wm->wm[level].plane_en; --level)
 		     { }
 
+		DRM_DEBUG_KMS("Got level %d\n", level);
+
 		latency = dev_priv->wm.skl_latency[level];
 
+		DRM_DEBUG_KMS("Got latency %d\n", latency);
+
 		if (skl_needs_memory_bw_wa(dev_priv) &&
 		    plane->base.state->fb->modifier ==
 		    I915_FORMAT_MOD_X_TILED)
@@ -3959,9 +3969,6 @@ static int intel_compute_sagv_mask(struct intel_atomic_state *state)
 
 		new_bw_state->sagv_calculated = false;
 
-		if (!new_crtc_state->hw.active)
-			continue;
-
 		if (INTEL_GEN(dev_priv) >= 12)
 			pipe_sagv_enable = tgl_can_enable_sagv_on_pipe(new_crtc_state);
 		else
-- 
2.24.1.485.gad05a3d8e5



More information about the Intel-gfx-trybot mailing list