public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Serialise presentation with imported dmabufs
@ 2016-06-14 15:03 Chris Wilson
  2016-06-14 15:37 ` ✓ Ro.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Chris Wilson @ 2016-06-14 15:03 UTC (permalink / raw)
  To: intel-gfx; +Cc: Alex Goins

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@chris-wilson.co.uk>
Cc: Alex Goins <agoins@nvidia.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-06-16 21:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-14 15:03 [PATCH] drm/i915: Serialise presentation with imported dmabufs Chris Wilson
2016-06-14 15:37 ` ✓ Ro.CI.BAT: success for " Patchwork
2016-06-14 15:45 ` [PATCH] " Daniel Vetter
2016-06-14 20:02   ` Chris Wilson
2016-06-14 20:56   ` [PATCH v2] " Chris Wilson
2016-06-15 20:26     ` Alex Goins
2016-06-16 21:41     ` Daniel Vetter
2016-06-15  5:59 ` ✗ Ro.CI.BAT: failure for drm/i915: Serialise presentation with imported dmabufs (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox