drm/i915: Poison the request before emitting commands
authorChris Wilson <[email protected]>
Sun, 23 Apr 2017 17:06:17 +0000 (18:06 +0100)
committerChris Wilson <[email protected]>
Tue, 25 Apr 2017 14:34:24 +0000 (15:34 +0100)
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 <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Mika Kuoppala <[email protected]>
drivers/gpu/drm/i915/intel_ringbuffer.c

index 227dfcf1764ed4224787aedd06dd59e09647503e..6836efb7e3d2041ee9708b37414a63adaf619020 100644 (file)
@@ -1694,6 +1694,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);