diff mbox

[04/11] drm/i915: don't keep reassigning FBC_UNSUPPORTED

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

Commit Message

Paulo Zanoni Dec. 8, 2014, 4:09 p.m. UTC
From: Paulo Zanoni <paulo.r.zanoni@intel.com>

This may save a few picoseconds on !HAS_FBC platforms. And it also
satisfies my OCD.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_fbc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Rodrigo Vivi Dec. 13, 2014, 12:55 a.m. UTC | #1
On Mon, Dec 8, 2014 at 8:09 AM, Paulo Zanoni <przanoni@gmail.com> wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> This may save a few picoseconds on !HAS_FBC platforms. And it also
> satisfies my OCD.
>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_fbc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
> index 4647d57..f3d5764 100644
> --- a/drivers/gpu/drm/i915/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/intel_fbc.c
> @@ -516,10 +516,8 @@ void intel_fbc_update(struct drm_device *dev)
>         const struct drm_display_mode *adjusted_mode;
>         unsigned int max_width, max_height;
>
> -       if (!HAS_FBC(dev)) {
> -               set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED);

I really don't like this fbc_reasons... I believe a drm_debug here is enough.
but I can try to kill that later.

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

> +       if (!HAS_FBC(dev))
>                 return;
> -       }
>
>         if (i915.enable_fbc < 0) {
>                 if (set_no_fbc_reason(dev_priv, FBC_CHIP_DEFAULT))
> @@ -684,6 +682,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
>  {
>         if (!HAS_FBC(dev_priv)) {
>                 dev_priv->fbc.enabled = false;
> +               dev_priv->fbc.no_fbc_reason = FBC_UNSUPPORTED;
>                 return;
>         }
>
> --
> 2.1.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter Dec. 15, 2014, 8:37 a.m. UTC | #2
On Fri, Dec 12, 2014 at 04:55:52PM -0800, Rodrigo Vivi wrote:
> On Mon, Dec 8, 2014 at 8:09 AM, Paulo Zanoni <przanoni@gmail.com> wrote:
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> >
> > This may save a few picoseconds on !HAS_FBC platforms. And it also
> > satisfies my OCD.
> >
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_fbc.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
> > index 4647d57..f3d5764 100644
> > --- a/drivers/gpu/drm/i915/intel_fbc.c
> > +++ b/drivers/gpu/drm/i915/intel_fbc.c
> > @@ -516,10 +516,8 @@ void intel_fbc_update(struct drm_device *dev)
> >         const struct drm_display_mode *adjusted_mode;
> >         unsigned int max_width, max_height;
> >
> > -       if (!HAS_FBC(dev)) {
> > -               set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED);
> 
> I really don't like this fbc_reasons... I believe a drm_debug here is enough.
> but I can try to kill that later.

Yeah, I think the original reason for no_fbc_reason was that it's to
reduce dmesg spam since we recheck for every pageflip. So horribly noisy.
Once we have all this restructured to only recheck when something changes
(at modest and when changing planes) and no longer for the on/off stuff we
do around pageflips (only needed on pre-g4x anyway) or when disabling the
primary plane we can go with dmesg debug output.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 4647d57..f3d5764 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -516,10 +516,8 @@  void intel_fbc_update(struct drm_device *dev)
 	const struct drm_display_mode *adjusted_mode;
 	unsigned int max_width, max_height;
 
-	if (!HAS_FBC(dev)) {
-		set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED);
+	if (!HAS_FBC(dev))
 		return;
-	}
 
 	if (i915.enable_fbc < 0) {
 		if (set_no_fbc_reason(dev_priv, FBC_CHIP_DEFAULT))
@@ -684,6 +682,7 @@  void intel_fbc_init(struct drm_i915_private *dev_priv)
 {
 	if (!HAS_FBC(dev_priv)) {
 		dev_priv->fbc.enabled = false;
+		dev_priv->fbc.no_fbc_reason = FBC_UNSUPPORTED;
 		return;
 	}