Skip to content

Commit 490b8c6

Browse files
committed
drm/i915/execlists: Apply a full mb before execution for Braswell
Braswell is really picky about having our writes posted to memory before we execute or else the GPU may see stale values. A wmb() is insufficient as it only ensures the writes are visible to other cores, we need a full mb() to ensure the writes are in memory and visible to the GPU. The most frequent failure in flushing before execution is that we see stale PTE values and execute the wrong pages. References: 987abd5 ("drm/i915/execlists: Force write serialisation into context image vs execution") Signed-off-by: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: [email protected] Reviewed-by: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5a688ee commit 490b8c6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/gpu/drm/i915/intel_lrc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,13 @@ static u64 execlists_update_context(struct i915_request *rq)
398398
* may not be visible to the HW prior to the completion of the UC
399399
* register write and that we may begin execution from the context
400400
* before its image is complete leading to invalid PD chasing.
401+
*
402+
* Furthermore, Braswell, at least, wants a full mb to be sure that
403+
* the writes are coherent in memory (visible to the GPU) prior to
404+
* execution, and not just visible to other CPUs (as is the result of
405+
* wmb).
401406
*/
402-
wmb();
407+
mb();
403408
return ce->lrc_desc;
404409
}
405410

0 commit comments

Comments
 (0)