[Intel-gfx] [PATCH] drm/i915: Avoid reading fbc registers in vain when fbc was never enabled.
Chris Wilson
chris at chris-wilson.co.uk
Thu Sep 18 08:28:48 CEST 2014
On Wed, Sep 17, 2014 at 04:59:20PM -0400, Rodrigo Vivi wrote:
> If it wasn't never enabled by kernel parameter or platform default
> we can avoid reading registers so many times in vain
Nak.
> Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
> drivers/gpu/drm/i915/intel_pm.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index a988862..afcc284 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -339,6 +339,12 @@ bool intel_fbc_enabled(struct drm_device *dev)
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
>
> + /* If it wasn't never enabled by kernel parameter or platform default
> + * we can avoid reading registers so many times in vain
> + */
> + if (!i915.enable_fbc)
> + return false;
> +
> if (!dev_priv->display.fbc_enabled)
> return false;
The correct state to check here is whether we have enabled fbc, not the
module parameter which just rules whether we should turn it on.
Look at making dev_priv->fbc.no_fbc_reason always correct instead.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list