All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drm/i915: add flag to prevent dmesg spam on context banning
@ 2014-03-12 15:15 Mika Kuoppala
  0 siblings, 0 replies; only message in thread
From: Mika Kuoppala @ 2014-03-12 15:15 UTC (permalink / raw)
  To: intel-gfx

Piglit runner and QA are both looking at the dmesg for
DRM_ERRORs with test cases.

Add flag to stop_rings debugfs interface to prevent DRM_ERROR
output when default context banning is being tested.

References: https://bugs.freedesktop.org/show_bug.cgi?id=75876
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h         |   18 ++++++++++++++++--
 drivers/gpu/drm/i915/i915_gem.c         |    5 +++--
 drivers/gpu/drm/i915/intel_ringbuffer.c |    2 +-
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 70fbe90..093e825 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1249,8 +1249,12 @@ struct i915_gpu_error {
 	 */
 	wait_queue_head_t reset_queue;
 
-	/* For gpu hang simulation. */
-	unsigned int stop_rings;
+	/* For gpu hang simulation.
+	 * MSB for controlling DRM_ERROR with ctx bans
+	 */
+	u32 stop_rings;
+
+#define I915_SQUELCH_CTX_BAN_ERROR (1 << 31)
 
 	/* For missed irq/seqno simulation. */
 	unsigned int test_irq_rings;
@@ -2326,6 +2330,16 @@ static inline u32 i915_reset_count(struct i915_gpu_error *error)
 	return ((atomic_read(&error->reset_counter) & ~I915_WEDGED) + 1) / 2;
 }
 
+static inline u32 i915_stopped_rings(struct drm_i915_private *dev_priv)
+{
+	return dev_priv->gpu_error.stop_rings & ~I915_SQUELCH_CTX_BAN_ERROR;
+}
+
+static inline bool i915_squelch_ban_error(struct drm_i915_private *dev_priv)
+{
+	return dev_priv->gpu_error.stop_rings & I915_SQUELCH_CTX_BAN_ERROR;
+}
+
 void i915_gem_reset(struct drm_device *dev);
 bool i915_gem_clflush_object(struct drm_i915_gem_object *obj, bool force);
 int __must_check i915_gem_object_finish_gpu(struct drm_i915_gem_object *obj);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 92b0b41..ddb8c81 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2276,8 +2276,9 @@ static bool i915_context_is_banned(struct drm_i915_private *dev_priv,
 		if (!i915_gem_context_is_default(ctx)) {
 			DRM_DEBUG("context hanging too fast, banning!\n");
 			return true;
-		} else if (dev_priv->gpu_error.stop_rings == 0) {
-			DRM_ERROR("gpu hanging too fast, banning!\n");
+		} else if (!i915_stopped_rings(dev_priv)) {
+			if (!i915_squelch_ban_error(dev_priv))
+				DRM_ERROR("gpu hanging too fast, banning!\n");
 			return true;
 		}
 	}
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 8590921..5cbe61c7 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -46,7 +46,7 @@ void __intel_ring_advance(struct intel_ring_buffer *ring)
 	struct drm_i915_private *dev_priv = ring->dev->dev_private;
 
 	ring->tail &= ring->size - 1;
-	if (dev_priv->gpu_error.stop_rings & intel_ring_flag(ring))
+	if (i915_stopped_rings(dev_priv) & intel_ring_flag(ring))
 		return;
 	ring->write_tail(ring, ring->tail);
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-03-12 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-12 15:15 [PATCH 1/1] drm/i915: add flag to prevent dmesg spam on context banning Mika Kuoppala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.