[PATCH] drm/i915: Serialise presentation with imported dmabufs

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

 



obj->base.dma_buf represents a dma-buf exported from this object (for
use by others). On the contrary, ob->base.import_attach represents the
source dma-buf that was used to create this object (if any). When
serialising with third parties, we want to wait on their rendering via
the import attachment (and not our own via the dma_buf export).

Note that for an object exported from i915 and passed to another i915
client, we do not create the import attachment and so serialisation will
use our native paths.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Alex Goins <agoins@xxxxxxxxxx>
Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 801e4c17dd8d..cbaa2e6f7679 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11425,8 +11425,8 @@ static bool use_mmio_flip(struct intel_engine_cs *engine,
 		return true;
 	else if (i915.enable_execlists)
 		return true;
-	else if (obj->base.dma_buf &&
-		 !reservation_object_test_signaled_rcu(obj->base.dma_buf->resv,
+	else if (obj->base.import_attach &&
+		 !reservation_object_test_signaled_rcu(obj->base.import_attach->dmabuf->resv,
 						       false))
 		return true;
 	else
@@ -11526,8 +11526,8 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
 					    &dev_priv->rps.mmioflips));
 
 	/* For framebuffer backed by dmabuf, wait for fence */
-	if (obj->base.dma_buf)
-		WARN_ON(reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
+	if (obj->base.import_attach)
+		WARN_ON(reservation_object_wait_timeout_rcu(obj->base.import_attach->dmabuf->resv,
 							    false, false,
 							    MAX_SCHEDULE_TIMEOUT) < 0);
 
@@ -13952,10 +13952,10 @@ intel_prepare_plane_fb(struct drm_plane *plane,
 	}
 
 	/* For framebuffer backed by dmabuf, wait for fence */
-	if (obj && obj->base.dma_buf) {
+	if (obj && obj->base.import_attach) {
 		long lret;
 
-		lret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
+		lret = reservation_object_wait_timeout_rcu(obj->base.import_attach->dmabuf->resv,
 							   false, true,
 							   MAX_SCHEDULE_TIMEOUT);
 		if (lret == -ERESTARTSYS)
-- 
2.8.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux