diff mbox

[3/4] drm/i915: don't disable FBC for pipe A when flipping pipe B

Message ID 1436902154-6979-5-git-send-email-przanoni@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paulo Zanoni July 14, 2015, 7:29 p.m. UTC
From: Paulo Zanoni <paulo.r.zanoni@intel.com>

Use the appropriate call.

I know there's a discussion about whether we need this call here at
all, but removing the call means we'll only update FBC after we get
the page flip IRQ. So the user may only see the new frame a little
after it should. Let's wait just a little bit more before removing
this call since we can rely in the HW tracking for accurate flips.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Vetter July 15, 2015, 12:33 p.m. UTC | #1
On Tue, Jul 14, 2015 at 04:29:13PM -0300, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> Use the appropriate call.
> 
> I know there's a discussion about whether we need this call here at
> all, but removing the call means we'll only update FBC after we get
> the page flip IRQ. So the user may only see the new frame a little
> after it should. Let's wait just a little bit more before removing
> this call since we can rely in the HW tracking for accurate flips.

Afaik fbc2 on g4x+ does correctly invalidate the fbc cache when flipping
the frontbuffer. This was needed for fbc1 which just didn't handle flips -
there we had to essentially disable and then re-enable fbc to make sure
the update was tracked correctly.

The other problem is correctly synchronizing the fence update (for hw gtt
tracking) against the flip. I'm not sure whether we still have races left
there, but simply updating the fence window before we flip should be all
that's required.
-Daniel

> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 37b2528..6e3ba5f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11544,7 +11544,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
>  			  to_intel_plane(primary)->frontbuffer_bit);
>  	mutex_unlock(&dev->struct_mutex);
>  
> -	intel_fbc_disable(dev_priv);
> +	intel_fbc_disable_crtc(intel_crtc);
>  	intel_frontbuffer_flip_prepare(dev,
>  				       to_intel_plane(primary)->frontbuffer_bit);
>  
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Rodrigo Vivi July 30, 2015, 11:46 p.m. UTC | #2
On Wed, Jul 15, 2015 at 5:31 AM Daniel Vetter <daniel@ffwll.ch> wrote:

> On Tue, Jul 14, 2015 at 04:29:13PM -0300, Paulo Zanoni wrote:
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> >
> > Use the appropriate call.
>

Good!

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>


> >
> > I know there's a discussion about whether we need this call here at
> > all, but removing the call means we'll only update FBC after we get
> > the page flip IRQ. So the user may only see the new frame a little
> > after it should. Let's wait just a little bit more before removing
> > this call since we can rely in the HW tracking for accurate flips.
>

I'm in favor of remove or at least move to frontbuffer prepare for flip..


>
> Afaik fbc2 on g4x+ does correctly invalidate the fbc cache when flipping
> the frontbuffer. This was needed for fbc1 which just didn't handle flips -
> there we had to essentially disable and then re-enable fbc to make sure
> the update was tracked correctly.
>
> The other problem is correctly synchronizing the fence update (for hw gtt
> tracking) against the flip. I'm not sure whether we still have races left
> there, but simply updating the fence window before we flip should be all
> that's required.


But anyway I'm also in favor of removing the old fbc...


> -Daniel
>
> >
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> > index 37b2528..6e3ba5f 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -11544,7 +11544,7 @@ static int intel_crtc_page_flip(struct drm_crtc
> *crtc,
> >                         to_intel_plane(primary)->frontbuffer_bit);
> >       mutex_unlock(&dev->struct_mutex);
> >
> > -     intel_fbc_disable(dev_priv);
> > +     intel_fbc_disable_crtc(intel_crtc);
> >       intel_frontbuffer_flip_prepare(dev,
> >
> to_intel_plane(primary)->frontbuffer_bit);
> >
> > --
> > 2.1.4
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://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
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 37b2528..6e3ba5f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11544,7 +11544,7 @@  static int intel_crtc_page_flip(struct drm_crtc *crtc,
 			  to_intel_plane(primary)->frontbuffer_bit);
 	mutex_unlock(&dev->struct_mutex);
 
-	intel_fbc_disable(dev_priv);
+	intel_fbc_disable_crtc(intel_crtc);
 	intel_frontbuffer_flip_prepare(dev,
 				       to_intel_plane(primary)->frontbuffer_bit);