All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/i915: Suppress redundant syncs with mmio page flips
Date: Fri, 19 Sep 2014 20:58:58 +0300	[thread overview]
Message-ID: <20140919175858.GQ12416@intel.com> (raw)
In-Reply-To: <1403090597-26210-1-git-send-email-chris@chris-wilson.co.uk>

On Wed, Jun 18, 2014 at 12:23:14PM +0100, Chris Wilson wrote:
> Since mmio-flips do not occur on the suggested ring, we are introducing
> an extra sync operation where none is required. Pass the current
> obj->ring, which is what mmio flip will use, to pin_to_display_plane so
> that we emit the appropriate synchronisation (none).
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

I had a vague recollection that I had seen something like this and now I
found it...

The patch could use a rebase I think, and perhaps it could use a boolean
to avoid duplicating the buffer pinning in two place? I was thinking
something like:

ring = whatever;
bool mmio_flip = use_mmio_flip(ring);
if (mmio_flip)
	ring = obj->ring;
pin_and_fence(ring);
...
if (mmio_flip)
	...
else
	...

But either way this gets
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 29 ++++++++++++++++++++---------
>  1 file changed, 20 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 5e8e711..55cb343 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9492,21 +9492,32 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
>  		ring = &dev_priv->ring[RCS];
>  	}
>  
> -	ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
> -	if (ret)
> -		goto cleanup_pending;
> +	if (use_mmio_flip(ring, obj)) {
> +		ret = intel_pin_and_fence_fb_obj(dev, obj, obj->ring);
> +		if (ret)
> +			goto cleanup_pending;
>  
> -	work->gtt_offset =
> -		i915_gem_obj_ggtt_offset(obj) + intel_crtc->dspaddr_offset;
> +		work->gtt_offset =
> +			i915_gem_obj_ggtt_offset(obj) + intel_crtc->dspaddr_offset;
>  
> -	if (use_mmio_flip(ring, obj))
>  		ret = intel_queue_mmio_flip(dev, crtc, fb, obj, ring,
>  					    page_flip_flags);
> -	else
> +		if (ret)
> +			goto cleanup_unpin;
> +
> +	} else {
> +		ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
> +		if (ret)
> +			goto cleanup_pending;
> +
> +		work->gtt_offset =
> +			i915_gem_obj_ggtt_offset(obj) + intel_crtc->dspaddr_offset;
> +
>  		ret = dev_priv->display.queue_flip(dev, crtc, fb, obj, ring,
>  				page_flip_flags);
> -	if (ret)
> -		goto cleanup_unpin;
> +		if (ret)
> +			goto cleanup_unpin;
> +	}
>  
>  	intel_disable_fbc(dev);
>  	intel_mark_fb_busy(obj, NULL);
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC

  parent reply	other threads:[~2014-09-19 18:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18 11:23 [PATCH 1/4] drm/i915: Suppress redundant syncs with mmio page flips Chris Wilson
2014-06-18 11:23 ` [PATCH 2/4] drm/i915: Check for a stalled page flip after each vblank Chris Wilson
2014-06-18 11:23 ` [PATCH 3/4] drm/i915: Decouple the stuck pageflip on modeset Chris Wilson
2014-06-18 11:23 ` [PATCH 4/4] drm/i915: Boost GPU frequency if we detect outstanding pageflips Chris Wilson
2014-09-19 17:58 ` Ville Syrjälä [this message]
2014-09-19 20:30   ` [PATCH 1/4] drm/i915: Suppress redundant syncs with mmio page flips Chris Wilson
2014-09-23  8:13   ` Daniel Vetter

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=20140919175858.GQ12416@intel.com \
    --to=ville.syrjala@linux.intel.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 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.