All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Alex Goins <agoins@nvidia.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH i915 v3 1/2] i915: wait for fences in mmio_flip()
Date: Fri, 13 Nov 2015 10:08:11 +0000	[thread overview]
Message-ID: <20151113100811.GO6247@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <ba4558149d3c81305c975817b3972363c3b310cd.1447378621.git.agoins@nvidia.com>

On Thu, Nov 12, 2015 at 05:49:28PM -0800, Alex Goins wrote:
> If a buffer is backed by dmabuf, wait on its reservation object's fences
> before flipping.
> 
> Signed-off-by: Alex Goins <agoins@nvidia.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index b2270d5..acec108a 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -44,6 +44,8 @@
>  #include <drm/drm_plane_helper.h>
>  #include <drm/drm_rect.h>
>  #include <linux/dma_remapping.h>
> +#include <linux/reservation.h>
> +#include <linux/dma-buf.h>
>  
>  /* Primary plane formats for gen <= 3 */
>  static const uint32_t i8xx_primary_formats[] = {
> @@ -11170,10 +11172,19 @@ static void ilk_do_mmio_flip(struct intel_crtc *intel_crtc)
>  static void intel_do_mmio_flip(struct intel_crtc *intel_crtc)
>  {
>  	struct drm_device *dev = intel_crtc->base.dev;
> +	struct drm_i915_gem_object *pending_flip_obj =
> +		intel_crtc->unpin_work->pending_flip_obj;
>  	u32 start_vbl_count;
>  
>  	intel_mark_page_flip_active(intel_crtc);
>  
> +	/* For framebuffer backed by dmabuf, wait for fence */
> +	if (pending_flip_obj->base.dma_buf) {
> +		reservation_object_wait_timeout_rcu(
> +			pending_flip_obj->base.dma_buf->resv,
> +			true, false, msecs_to_jiffies(96));
> +	}

This wait should be prior to marking the flip as waiting for the
flip-completion interrupt. My personal preference (aside from putting
this next to the other wait) would to have been to use crtc->primary->fb
to match the do_mmip_flips funcs (I expect that we will eliminate the
pending_flip_obj in the near future).

Also we are missing the addition of
if (obj->base.dma_buf && obj->base.dma_buf->resv->fence_excl)
  return true;
to use_mmio_flip().
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-11-13 10:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13  1:49 [PATCH i915 v3 0/2] PRIME Synchronization Alex Goins
2015-11-13  1:49 ` [PATCH i915 v3 1/2] i915: wait for fences in mmio_flip() Alex Goins
2015-11-13 10:08   ` Chris Wilson [this message]
2015-11-13 10:38     ` Daniel Stone
2015-11-13 10:45       ` Chris Wilson
2015-11-13 19:38         ` Alexander Goins
2015-11-17 10:23           ` Daniel Vetter
2015-11-13 19:57     ` Alexander Goins
2015-11-13  1:49 ` [PATCH i915 v3 2/2] i915: wait for fence in prepare_plane_fb Alex Goins

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=20151113100811.GO6247@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=agoins@nvidia.com \
    --cc=dri-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.