<div dir="ltr">I thought about this one again and opposed to my previous comment now
think it's fine, also for drivers without hw vblank counter queries.<br>
<br>
-mario<br><br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 6, 2014 at 1:49 PM, <span dir="ltr"><<a href="mailto:ville.syrjala@linux.intel.com" target="_blank">ville.syrjala@linux.intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Ville Syrjälä <<a href="mailto:ville.syrjala@linux.intel.com">ville.syrjala@linux.intel.com</a>><br>
<br>
If we already have a timestamp for the current vblank counter, don't<br>
update it with a new timestmap. Small errors can creep in between two<br>
timestamp queries for the same vblank count, which could be confusing to<br>
userspace when it queries the timestamp for the same vblank sequence<br>
number twice.<br>
<br>
This problem gets exposed when the vblank disable timer is not used<br>
(or is set to expire quickly) and thus we can get multiple vblank<br>
disable<->enable transition during the same frame which would all<br>
attempt to update the timestamp with the latest estimate.<br>
<br>
Testcase: igt/kms_flip/flip-vs-expired-vblank<br>
Signed-off-by: Ville Syrjälä <<a href="mailto:ville.syrjala@linux.intel.com">ville.syrjala@linux.intel.com</a>><br>
---<br>
drivers/gpu/drm/drm_irq.c | 3 +++<br>
1 file changed, 3 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c<br>
index af33df1..0523f5b 100644<br>
--- a/drivers/gpu/drm/drm_irq.c<br>
+++ b/drivers/gpu/drm/drm_irq.c<br>
@@ -106,6 +106,9 @@ static void drm_update_vblank_count(struct drm_device *dev, int crtc)<br>
DRM_DEBUG("enabling vblank interrupts on crtc %d, missed %d\n",<br>
crtc, diff);<br>
<br>
+ if (diff == 0)<br>
+ return;<br>
+<br>
/* Reinitialize corresponding vblank timestamp if high-precision query<br>
* available. Skip this step if query unsupported or failed. Will<br>
* reinitialize delayed at next vblank interrupt in that case.<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.5.5<br>
<br>
</font></span></blockquote></div><br></div>