diff mbox series

[4/8] drm/i915: Clear no_fbc_reason on activate

Message ID 20210414022309.30898-5-ville.syrjala@linux.intel.com (mailing list archive)
State New
Headers show
Series drm/i915: FBC cleanups | expand

Commit Message

Ville Syrjälä April 14, 2021, 2:23 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We try to set no_fbc_reason when FBC is not possible, let's
consistently clear when activating FBC.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbc.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Comments

Jani Nikula April 21, 2021, 1:48 p.m. UTC | #1
On Wed, 14 Apr 2021, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We try to set no_fbc_reason when FBC is not possible, let's
> consistently clear when activating FBC.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_fbc.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> index 4968e79a6235..fb8c0872a2b7 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> @@ -411,6 +411,17 @@ bool intel_fbc_is_active(struct drm_i915_private *dev_priv)
>  	return dev_priv->fbc.active;
>  }
>  
> +static void intel_fbc_activate(struct drm_i915_private *dev_priv)
> +{
> +	struct intel_fbc *fbc = &dev_priv->fbc;
> +
> +	drm_WARN_ON(&dev_priv->drm, !mutex_is_locked(&fbc->lock));
> +
> +	intel_fbc_hw_activate(dev_priv);
> +
> +	fbc->no_fbc_reason = NULL;
> +}
> +
>  static void intel_fbc_deactivate(struct drm_i915_private *dev_priv,
>  				 const char *reason)
>  {
> @@ -1094,7 +1105,7 @@ static void __intel_fbc_post_update(struct intel_crtc *crtc)
>  		return;
>  
>  	if (!fbc->busy_bits)
> -		intel_fbc_hw_activate(dev_priv);
> +		intel_fbc_activate(dev_priv);
>  	else
>  		intel_fbc_deactivate(dev_priv, "frontbuffer write");
>  }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 4968e79a6235..fb8c0872a2b7 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -411,6 +411,17 @@  bool intel_fbc_is_active(struct drm_i915_private *dev_priv)
 	return dev_priv->fbc.active;
 }
 
+static void intel_fbc_activate(struct drm_i915_private *dev_priv)
+{
+	struct intel_fbc *fbc = &dev_priv->fbc;
+
+	drm_WARN_ON(&dev_priv->drm, !mutex_is_locked(&fbc->lock));
+
+	intel_fbc_hw_activate(dev_priv);
+
+	fbc->no_fbc_reason = NULL;
+}
+
 static void intel_fbc_deactivate(struct drm_i915_private *dev_priv,
 				 const char *reason)
 {
@@ -1094,7 +1105,7 @@  static void __intel_fbc_post_update(struct intel_crtc *crtc)
 		return;
 
 	if (!fbc->busy_bits)
-		intel_fbc_hw_activate(dev_priv);
+		intel_fbc_activate(dev_priv);
 	else
 		intel_fbc_deactivate(dev_priv, "frontbuffer write");
 }