[PATCH] drm/i915: add some extra debug to i915_context_is_banned

tim.gore at intel.com tim.gore at intel.com
Thu Apr 14 09:03:08 UTC 2016


From: Tim Gore <tim.gore at intel.com>

For debug/testing purposes. Not to be merged, just sending
to the trybot for CI testing to try to understand what is
happening with all the "gpu hanging too fast" fails on bsw-nuc

v2: add the WaEnableSamplerGPGPUPreemptionSupport patch and print
    a debug message when it gets applied. Should only get applied
    on gen9 targets!

Signed-off-by: Tim Gore <tim.gore at intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c         | 5 +++++
 drivers/gpu/drm/i915/i915_reg.h         | 1 +
 drivers/gpu/drm/i915/intel_ringbuffer.c | 8 +++++---
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b37ffea..adfbd3f 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2694,6 +2694,11 @@ static bool i915_context_is_banned(struct drm_i915_private *dev_priv,
 		} else if (i915_stop_ring_allow_ban(dev_priv)) {
 			if (i915_stop_ring_allow_warn(dev_priv))
 				DRM_ERROR("gpu hanging too fast, banning!\n");
+				DRM_ERROR("prev guilty_ts=%ld, elapsed=%ld, min_period=%ld\n",
+					ctx->hang_stats.guilty_ts, elapsed,
+					ctx->hang_stats.ban_period_seconds);
+				DRM_ERROR("ctx->user_handle=%d, ctx->file_priv=%p\n",
+					ctx->user_handle, ctx->file_priv);
 			return true;
 		}
 	}
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index cea5a39..ff83c64 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -7161,6 +7161,7 @@ enum skl_disp_power_wells {
 
 #define GEN9_HALF_SLICE_CHICKEN7	_MMIO(0xe194)
 #define   GEN9_ENABLE_YV12_BUGFIX	(1<<4)
+#define   GEN9_ENABLE_GPGPU_PREEMPTION	(1<<2)
 
 /* Audio */
 #define G4X_AUD_VID_DID			_MMIO(dev_priv->info.display_mmio_offset + 0x62020)
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 19ebe77..817482a 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -959,9 +959,11 @@ static int gen9_init_workarounds(struct intel_engine_cs *engine)
 	}
 
 	/* WaEnableYV12BugFixInHalfSliceChicken7:skl,bxt */
-	if (IS_SKL_REVID(dev, SKL_REVID_C0, REVID_FOREVER) || IS_BROXTON(dev))
-		WA_SET_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN7,
-				  GEN9_ENABLE_YV12_BUGFIX);
+	/* WaEnableSamplerGPGPUPreemptionSupport:skl,bxt */
+	DRM_DEBUG_DRIVER("Applying WaEnableSamplerGPGPUPreemptionSupport\n");
+	WA_SET_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN7,
+			  GEN9_ENABLE_YV12_BUGFIX |
+			  GEN9_ENABLE_GPGPU_PREEMPTION);
 
 	/* Wa4x4STCOptimizationDisable:skl,bxt */
 	/* WaDisablePartialResolveInVc:skl,bxt */
-- 
1.9.1



More information about the Intel-gfx-trybot mailing list