[PATCH 2/3] drm/i915: Poison the request before emitting commands

Chris Wilson chris at chris-wilson.co.uk
Sun Apr 23 12:13:46 UTC 2017


If we poison the request before we emit commands, it should be easier to
spot when we execute an uninitialised request.

References: https://bugs.freedesktop.org/show_bug.cgi?id=100144
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 3d81df418e19..ad0648cb0f80 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1692,6 +1692,7 @@ u32 *intel_ring_begin(struct drm_i915_gem_request *req, int num_dwords)
 
 	GEM_BUG_ON(ring->emit > ring->size - bytes);
 	cs = ring->vaddr + ring->emit;
+	GEM_DEBUG_EXEC(memset(cs, POISON_INUSE, bytes));
 	ring->emit += bytes;
 	ring->space -= bytes;
 	GEM_BUG_ON(ring->space < 0);
-- 
2.11.0



More information about the Intel-gfx-trybot mailing list