Skip to content

Commit 987abd5

Browse files
committed
drm/i915/execlists: Force write serialisation into context image vs execution
Ensure that the writes into the context image are completed prior to the register mmio to trigger execution. Although previously we were assured by the SDM that all writes are flushed before an uncached memory transaction (our mmio write to submit the context to HW for execution), we have empirical evidence to believe that this is not actually the case. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108656 References: https://bugs.freedesktop.org/show_bug.cgi?id=108315 References: https://bugs.freedesktop.org/show_bug.cgi?id=106887 Signed-off-by: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Acked-by: Mika Kuoppala <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Cc: [email protected]
1 parent a33e1ec commit 987abd5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/gpu/drm/i915/intel_lrc.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,14 +380,26 @@ static u64 execlists_update_context(struct i915_request *rq)
380380

381381
reg_state[CTX_RING_TAIL+1] = intel_ring_set_tail(rq->ring, rq->tail);
382382

383-
/* True 32b PPGTT with dynamic page allocation: update PDP
383+
/*
384+
* True 32b PPGTT with dynamic page allocation: update PDP
384385
* registers and point the unallocated PDPs to scratch page.
385386
* PML4 is allocated during ppgtt init, so this is not needed
386387
* in 48-bit mode.
387388
*/
388389
if (!i915_vm_is_48bit(&ppgtt->vm))
389390
execlists_update_context_pdps(ppgtt, reg_state);
390391

392+
/*
393+
* Make sure the context image is complete before we submit it to HW.
394+
*
395+
* Ostensibly, writes (including the WCB) should be flushed prior to
396+
* an uncached write such as our mmio register access, the empirical
397+
* evidence (esp. on Braswell) suggests that the WC write into memory
398+
* may not be visible to the HW prior to the completion of the UC
399+
* register write and that we may begin execution from the context
400+
* before its image is complete leading to invalid PD chasing.
401+
*/
402+
wmb();
391403
return ce->lrc_desc;
392404
}
393405

0 commit comments

Comments
 (0)