<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 14, 2015 at 12:30 PM Paulo Zanoni <<a href="mailto:przanoni@gmail.com">przanoni@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Paulo Zanoni <<a href="mailto:paulo.r.zanoni@intel.com" target="_blank">paulo.r.zanoni@intel.com</a>><br>
<br>
Due to the way busy_bits was handled, we were not doing any flushes if<br>
we didn't previously get an invalidate. Since it's possible to get<br>
flushes without an invalidate first, remove the busy_bits early<br>
return.<br>
<br>
So now that we don't have the busy_bits guard anymore we'll need the<br>
origin check for the GTT tracking (we were not doing anything on GTT<br>
flushes due to the GTT check at invalidate()).<br>
<br>
As a last detail, since we can get multiple consecutive flushes,<br>
disable FBC before updating it, otherwise intel_fbc_update() will just<br>
keep FBC enabled instead of restarting it.<br>
<br>
Notice that this does not fix any of the current IGT tests due to the<br>
fact that we still have a few intel_fbc() calls at points where we<br>
also have the frontbuffer tracking calls: we didn't fully convert to<br>
frontbuffer tracking yet. Once we remove those calls and start relying<br>
only on the frontbuffer tracking infrastructure we'll need this patch.<br>
<br>
Signed-off-by: Paulo Zanoni <<a href="mailto:paulo.r.zanoni@intel.com" target="_blank">paulo.r.zanoni@intel.com</a>><br>
---<br>
drivers/gpu/drm/i915/intel_drv.h | 2 +-<br>
drivers/gpu/drm/i915/intel_fbc.c | 13 +++++++------<br>
drivers/gpu/drm/i915/intel_frontbuffer.c | 2 +-<br>
3 files changed, 9 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h<br>
index f4abce1..2437666 100644<br>
--- a/drivers/gpu/drm/i915/intel_drv.h<br>
+++ b/drivers/gpu/drm/i915/intel_drv.h<br>
@@ -1240,7 +1240,7 @@ void intel_fbc_invalidate(struct drm_i915_private *dev_priv,<br>
unsigned int frontbuffer_bits,<br>
enum fb_op_origin origin);<br>
void intel_fbc_flush(struct drm_i915_private *dev_priv,<br>
- unsigned int frontbuffer_bits);<br>
+ unsigned int frontbuffer_bits, enum fb_op_origin origin);<br>
const char *intel_no_fbc_reason_str(enum no_fbc_reason reason);<br>
void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv);<br>
<br>
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c<br>
index c271af7..1f97fb5 100644<br>
--- a/drivers/gpu/drm/i915/intel_fbc.c<br>
+++ b/drivers/gpu/drm/i915/intel_fbc.c<br>
@@ -884,22 +884,23 @@ void intel_fbc_invalidate(struct drm_i915_private *dev_priv,<br>
}<br>
<br>
void intel_fbc_flush(struct drm_i915_private *dev_priv,<br>
- unsigned int frontbuffer_bits)<br>
+ unsigned int frontbuffer_bits, enum fb_op_origin origin)<br>
{<br>
if (!dev_priv->fbc.enable_fbc)<br>
return;<br>
<br>
- mutex_lock(&dev_priv->fbc.lock);<br>
+ if (origin == ORIGIN_GTT)<br>
+ return;<br>
<br>
- if (!dev_priv->fbc.busy_bits)<br>
- goto out;<br>
+ mutex_lock(&dev_priv->fbc.lock);<br>
<br>
dev_priv->fbc.busy_bits &= ~frontbuffer_bits;<br>
<br>
- if (!dev_priv->fbc.busy_bits)<br>
+ if (!dev_priv->fbc.busy_bits) {<br>
+ __intel_fbc_disable(dev_priv);<br>
__intel_fbc_update(dev_priv);<br></blockquote><div><br></div><div>are we going to kill fbc_update for good? ;)</div><div><br></div><div>But yes, we need to force the disable on flush so this is good.</div><div>I'd just add in a separated patch, but anyway feel free to use</div><div><br></div><div>Reviewed-by: Rodrigo Vivi <<a href="mailto:rodrigo.vivi@intel.com">rodrigo.vivi@intel.com</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ }<br>
<br>
-out:<br>
mutex_unlock(&dev_priv->fbc.lock);<br>
}<br>
<br>
diff --git a/drivers/gpu/drm/i915/intel_frontbuffer.c b/drivers/gpu/drm/i915/intel_frontbuffer.c<br>
index 777b1d3..ac85357 100644<br>
--- a/drivers/gpu/drm/i915/intel_frontbuffer.c<br>
+++ b/drivers/gpu/drm/i915/intel_frontbuffer.c<br>
@@ -129,7 +129,7 @@ static void intel_frontbuffer_flush(struct drm_device *dev,<br>
<br>
intel_edp_drrs_flush(dev, frontbuffer_bits);<br>
intel_psr_flush(dev, frontbuffer_bits, origin);<br>
- intel_fbc_flush(dev_priv, frontbuffer_bits);<br>
+ intel_fbc_flush(dev_priv, frontbuffer_bits, origin);<br>
}<br>
<br>
/**<br>
--<br>
2.1.4<br>
<br>
_______________________________________________<br>
Intel-gfx mailing list<br>
<a href="mailto:Intel-gfx@lists.freedesktop.org" target="_blank">Intel-gfx@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/intel-gfx" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/intel-gfx</a><br>
</blockquote></div></div>