diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index c0f0046d8078..2ba9d7fac345 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -106,6 +106,7 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc) | |||
106 | s64 diff_ns; | 106 | s64 diff_ns; |
107 | int vblrc; | 107 | int vblrc; |
108 | struct timeval tvblank; | 108 | struct timeval tvblank; |
109 | int count = DRM_TIMESTAMP_MAXRETRIES; | ||
109 | 110 | ||
110 | /* Prevent vblank irq processing while disabling vblank irqs, | 111 | /* Prevent vblank irq processing while disabling vblank irqs, |
111 | * so no updates of timestamps or count can happen after we've | 112 | * so no updates of timestamps or count can happen after we've |
@@ -131,7 +132,10 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc) | |||
131 | do { | 132 | do { |
132 | dev->last_vblank[crtc] = dev->driver->get_vblank_counter(dev, crtc); | 133 | dev->last_vblank[crtc] = dev->driver->get_vblank_counter(dev, crtc); |
133 | vblrc = drm_get_last_vbltimestamp(dev, crtc, &tvblank, 0); | 134 | vblrc = drm_get_last_vbltimestamp(dev, crtc, &tvblank, 0); |
134 | } while (dev->last_vblank[crtc] != dev->driver->get_vblank_counter(dev, crtc)); | 135 | } while (dev->last_vblank[crtc] != dev->driver->get_vblank_counter(dev, crtc) && (--count) && vblrc); |
136 | |||
137 | if (!count) | ||
138 | vblrc = 0; | ||
135 | 139 | ||
136 | /* Compute time difference to stored timestamp of last vblank | 140 | /* Compute time difference to stored timestamp of last vblank |
137 | * as updated by last invocation of drm_handle_vblank() in vblank irq. | 141 | * as updated by last invocation of drm_handle_vblank() in vblank irq. |