[2/9] drm/i915: Filter out no-op frontbuffer tracking flushes
diff mbox

Message ID 1434616228-28358-2-git-send-email-daniel.vetter@ffwll.ch
State New
Headers show

Commit Message

Daniel Vetter June 18, 2015, 8:30 a.m. UTC
Paulo noticed that the fbc frontbuffer tracking flush callback
occasionally gets a call without any bit set. This can happen when we
have to filter flush calls due to e.g. gpu rendering. Filter these
out.

Reported-by: Paulo Zanoni <przanoni@gmail.com>
Cc: Paulo Zanoni <przanoni@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/intel_frontbuffer.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Paulo Zanoni June 23, 2015, 7:02 p.m. UTC | #1
2015-06-18 5:30 GMT-03:00 Daniel Vetter <daniel.vetter@ffwll.ch>:
> Paulo noticed that the fbc frontbuffer tracking flush callback
> occasionally gets a call without any bit set. This can happen when we
> have to filter flush calls due to e.g. gpu rendering. Filter these
> out.
>
> Reported-by: Paulo Zanoni <przanoni@gmail.com>
> Cc: Paulo Zanoni <przanoni@gmail.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_frontbuffer.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_frontbuffer.c b/drivers/gpu/drm/i915/intel_frontbuffer.c
> index 2a1611a7ce1d..899b6112bbe0 100644
> --- a/drivers/gpu/drm/i915/intel_frontbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_frontbuffer.c
> @@ -179,6 +179,9 @@ void intel_frontbuffer_flush(struct drm_device *dev,
>         frontbuffer_bits &= ~dev_priv->fb_tracking.busy_bits;
>         mutex_unlock(&dev_priv->fb_tracking.lock);
>
> +       if (!frontbuffer_bits)
> +               return;
> +
>         intel_mark_fb_busy(dev, frontbuffer_bits, NULL);
>
>         intel_edp_drrs_flush(dev, frontbuffer_bits);
> --
> 2.1.0
>

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_frontbuffer.c b/drivers/gpu/drm/i915/intel_frontbuffer.c
index 2a1611a7ce1d..899b6112bbe0 100644
--- a/drivers/gpu/drm/i915/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/intel_frontbuffer.c
@@ -179,6 +179,9 @@  void intel_frontbuffer_flush(struct drm_device *dev,
 	frontbuffer_bits &= ~dev_priv->fb_tracking.busy_bits;
 	mutex_unlock(&dev_priv->fb_tracking.lock);
 
+	if (!frontbuffer_bits)
+		return;
+
 	intel_mark_fb_busy(dev, frontbuffer_bits, NULL);
 
 	intel_edp_drrs_flush(dev, frontbuffer_bits);