public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Zanoni, Paulo R" <paulo.r.zanoni@intel.com>
To: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"chris@chris-wilson.co.uk" <chris@chris-wilson.co.uk>
Cc: "Vetter, Daniel" <daniel.vetter@intel.com>,
	"drm-intel-fixes@lists.freedesktop.org"
	<drm-intel-fixes@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Call intel_fbc_pre_update() after pinning the new pageflip
Date: Tue, 16 Aug 2016 16:49:26 +0000	[thread overview]
Message-ID: <1471366163.5339.23.camel@intel.com> (raw)
In-Reply-To: <1471333390-4450-1-git-send-email-chris@chris-wilson.co.uk>

Em Ter, 2016-08-16 às 08:43 +0100, Chris Wilson escreveu:
> intel_fbc_pre_update() depends upon the new state being already
> pinned
> in place in the Global GTT (primarily for both fencing which wants
> both
> an offset and a fence register, if assigned). This requires the call
> to
> intel_fbc_pre_update() be after intel_pin_and_fence_fb() - but commit
> 5a21b6650a23 ("drm/i915: Revert async unpin and nonblocking atomic
> commit") seems to have returned the code to a different state.
> 
> Fixes 5a21b6650a23 ("drm/i915: Revert async unpin and
> nonblocking...")

I think it actually fixes e8216e502acaad129210c3c8b30cb4ab41e70239
("drm/i915/fbc: call intel_fbc_pre_update earlier during page flips").

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: "Zanoni, Paulo R" <paulo.r.zanoni@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
> Cc: drm-intel-fixes@lists.freedesktop.org
> ---
>  drivers/gpu/drm/i915/intel_display.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index 37d71d5d2369..916ce7b2d4d7 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12061,9 +12061,6 @@ static int intel_crtc_page_flip(struct
> drm_crtc *crtc,
>  	crtc->primary->fb = fb;
>  	update_state_fb(crtc->primary);
>  
> -	intel_fbc_pre_update(intel_crtc, intel_crtc->config,
> -			     to_intel_plane_state(primary->state));
> -
>  	work->pending_flip_obj = i915_gem_object_get(obj);
>  
>  	ret = i915_mutex_lock_interruptible(dev);
> @@ -12109,6 +12106,9 @@ static int intel_crtc_page_flip(struct
> drm_crtc *crtc,
>  	work->gtt_offset += intel_crtc->dspaddr_offset;
>  	work->rotation = crtc->primary->state->rotation;
>  
> +	intel_fbc_pre_update(intel_crtc, intel_crtc->config,
> +			     to_intel_plane_state(primary->state));
> +

After you reported the problem yesterday I wrote almost the exact same
patch and just didn't submit it because I didn't have time to test it.
I also added a little comment on top of the call to try to prevent us
from further regressions:

/* There's the potential that the next frame will not be compatible
with FBC, so we want to call pre_update() before the actual page flip.
The problem is that pre_update() caches some information about the fb
object, so we want to do this only after the object is pinned. Let's be
on the safe side and do this immediately before scheduling the
flip. */

With or without this or some other comment:
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

>  	if (mmio_flip) {
>  		INIT_WORK(&work->mmio_work,
> intel_mmio_flip_work_func);
>  
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-08-16 16:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16  7:43 [PATCH] drm/i915: Call intel_fbc_pre_update() after pinning the new pageflip Chris Wilson
2016-08-16  8:25 ` ✗ Ro.CI.BAT: warning for " Patchwork
2016-08-16 16:49 ` Zanoni, Paulo R [this message]
2016-08-16 17:04   ` [PATCH] " chris
2016-08-17 19:41     ` Paulo Zanoni
2016-08-17 19:49       ` Chris Wilson
2016-08-17 20:00         ` Zanoni, Paulo R
2016-08-22 10:29           ` chris
2016-08-18  6:49 ` ✗ Ro.CI.BAT: warning for drm/i915: Call intel_fbc_pre_update() after pinning the new pageflip (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=1471366163.5339.23.camel@intel.com \
    --to=paulo.r.zanoni@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@intel.com \
    --cc=drm-intel-fixes@lists.freedesktop.org \
    --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