[PATCH 10/11] drm/i915: also wait for shared dmabuf fences before flip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add dependencies for implicit sync to shared fences as well to i915.

This was lengthy discussed about four years ago, but since the workaround we
did in amdgpu is now causing more and more problems we need to fix this
properly.

Signed-off-by: Christian König <christian.koenig@xxxxxxx>
---
 drivers/gpu/drm/i915/display/intel_display.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 9b9b538b0cb6..197b54fdefa2 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -10640,6 +10640,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane,
 	i915_gem_object_flush_frontbuffer(obj, ORIGIN_DIRTYFB);
 
 	if (!new_plane_state->uapi.fence) { /* implicit fencing */
+		struct dma_resv_cursor cursor;
 		struct dma_fence *fence;
 
 		ret = i915_sw_fence_await_reservation(&state->commit_ready,
@@ -10656,6 +10657,21 @@ intel_prepare_plane_fb(struct drm_plane *_plane,
 						   fence);
 			dma_fence_put(fence);
 		}
+
+retry:
+		dma_resv_for_each_shared(obj->base.resv, &cursor, fence) {
+			if (!(cursor.usage & DMA_RESV_USAGE_WRITE))
+				continue;
+
+			if (!dma_fence_get_rcu(fence))
+				goto retry;
+
+			add_rps_boost_after_vblank(new_plane_state->hw.crtc,
+						   fence);
+			dma_fence_put(fence);
+		}
+
+
 	} else {
 		add_rps_boost_after_vblank(new_plane_state->hw.crtc,
 					   new_plane_state->uapi.fence);
-- 
2.25.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux