Skip to content

Commit f66fab8

Browse files
vsyrjaladanvet
authored andcommitted
drm/i915: Prevent MI_DISPLAY_FLIP straddling two cachelines on IVB
According to BSpec the entire MI_DISPLAY_FLIP packet must be contained in a single cacheline. Make sure that happens. v2: Use intel_ring_begin_cacheline_safe() v3: Use intel_ring_cacheline_align() (Chris) Cc: Bjoern C <[email protected]> Cc: Alexandru DAMIAN <[email protected]> Cc: Enrico Tagliavini <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74053 Signed-off-by: Ville Syrjälä <[email protected]> Cc: [email protected] Signed-off-by: Daniel Vetter <[email protected]>
1 parent 753b1ad commit f66fab8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8586,6 +8586,20 @@ static int intel_gen7_queue_flip(struct drm_device *dev,
85868586
if (ring->id == RCS)
85878587
len += 6;
85888588

8589+
/*
8590+
* BSpec MI_DISPLAY_FLIP for IVB:
8591+
* "The full packet must be contained within the same cache line."
8592+
*
8593+
* Currently the LRI+SRM+MI_DISPLAY_FLIP all fit within the same
8594+
* cacheline, if we ever start emitting more commands before
8595+
* the MI_DISPLAY_FLIP we may need to first emit everything else,
8596+
* then do the cacheline alignment, and finally emit the
8597+
* MI_DISPLAY_FLIP.
8598+
*/
8599+
ret = intel_ring_cacheline_align(ring);
8600+
if (ret)
8601+
goto err_unpin;
8602+
85898603
ret = intel_ring_begin(ring, len);
85908604
if (ret)
85918605
goto err_unpin;

0 commit comments

Comments
 (0)