public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, Alex Goins <agoins@nvidia.com>
Subject: Re: [PATCH] drm/i915: Serialise presentation with imported dmabufs
Date: Tue, 14 Jun 2016 17:45:24 +0200	[thread overview]
Message-ID: <20160614154524.GS1338@phenom.ffwll.local> (raw)
In-Reply-To: <1465916637-5672-1-git-send-email-chris@chris-wilson.co.uk>

On Tue, Jun 14, 2016 at 04:03:57PM +0100, Chris Wilson wrote:
> 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.

But that would break it, if the foreign object attaches a some fence to
the reservation. We need things to work both ways, and that is done by
having a reservation pointer, where we either store our own per-bo lock +
list of reservations, or the imported one from the other driver.

A bit much, but interim we'd need at least both base.dma_buf and
base.import_attach.

Also, we should just extract the fence, and wait on that later on in the
atomic path.
-Daniel

> 
> 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

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-06-14 15:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Daniel Vetter [this message]
2016-06-14 20:02   ` [PATCH] " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160614154524.GS1338@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=agoins@nvidia.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox