Skip to content

Commit fd77b2c

Browse files
Aakash-Sarkarrodrigovivi
authored andcommitted
drm/i915/display: Fix dma_fence_wait_timeout() return value handling
dma_fence_wait_timeout returns a long type but the driver is only using the lower 32 bits of the retval and discarding the upper 32 bits. This is particularly problematic if there are already signalled or stub fences on some of the hw planes. In this case the dma_fence_wait_timeout function will immediately return with timeout value MAX_SCHEDULE_TIMEOUT (0x7fffffffffffffff) since the fence is already signalled. If the driver only uses the lower 32 bits of this return value then it'll interpret it as an error code (0xFFFFFFFF or (-1)) and skip the wait on the remaining fences. This issue was first observed in the xe driver with the Android compositor where the GPU composited layer was not properly waited on when there were stub fences in other overlay planes resulting in visual artifacts. Fixes: d59cf7b ("drm/i915/display: Use dma_fence interfaces instead of i915_sw_fence") Signed-off-by: Aakash Deep Sarkar <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Signed-off-by: Ankit Nautiyal <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit cdb1603) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 9e0c433 commit fd77b2c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7061,7 +7061,8 @@ static void intel_atomic_commit_fence_wait(struct intel_atomic_state *intel_stat
70617061
struct drm_i915_private *i915 = to_i915(intel_state->base.dev);
70627062
struct drm_plane *plane;
70637063
struct drm_plane_state *new_plane_state;
7064-
int ret, i;
7064+
long ret;
7065+
int i;
70657066

70667067
for_each_new_plane_in_state(&intel_state->base, plane, new_plane_state, i) {
70677068
if (new_plane_state->fence) {

0 commit comments

Comments
 (0)