drm/i915/execlists: Terminate the context image with BB_END
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 30 Jul 2018 16:43:25 +0000 (17:43 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 1 Aug 2018 16:03:31 +0000 (17:03 +0100)
In the aub trace utility, the context images are terminated with a
MI_BATCH_BUFFER_END; the simulator is reported as complaining otherwise.
Do the same for our protocontext image for completeness, and in passing
apply the magic bit for gen10 to mark the end of the context image.

Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180730164325.12770-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_lrc_reg.h

index fad689efb67ad14f3e832fd3de9d2402a723c2e1..b0be180c6294e25822f323fa940ffa253d87c9e7 100644 (file)
@@ -2653,6 +2653,10 @@ static void execlists_init_reg_state(u32 *regs,
 
                i915_oa_init_reg_state(engine, ctx, regs);
        }
+
+       regs[CTX_END] = MI_BATCH_BUFFER_END;
+       if (INTEL_GEN(dev_priv) >= 10)
+               regs[CTX_END] |= BIT(0);
 }
 
 static int
index 169a2239d6c7e7456892e9c79c39b3da94fc8f5e..5ef932d810a720a41f48cab185fce79b91ff8b8b 100644 (file)
@@ -37,7 +37,7 @@
 #define CTX_PDP0_LDW                   0x32
 #define CTX_LRI_HEADER_2               0x41
 #define CTX_R_PWR_CLK_STATE            0x42
-#define CTX_GPGPU_CSR_BASE_ADDRESS     0x44
+#define CTX_END                                0x44
 
 #define CTX_REG(reg_state, pos, reg, val) do { \
        u32 *reg_state__ = (reg_state); \