diff options
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
| -rw-r--r-- | drivers/gpu/drm/drm_irq.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 1f86f6c6ecc6..fc1525a499d9 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
| @@ -1095,6 +1095,18 @@ void drm_vblank_on(struct drm_device *dev, int crtc) | |||
| 1095 | atomic_dec(&dev->vblank[crtc].refcount); | 1095 | atomic_dec(&dev->vblank[crtc].refcount); |
| 1096 | dev->vblank[crtc].inmodeset = 0; | 1096 | dev->vblank[crtc].inmodeset = 0; |
| 1097 | } | 1097 | } |
| 1098 | |||
| 1099 | /* | ||
| 1100 | * sample the current counter to avoid random jumps | ||
| 1101 | * when drm_vblank_enable() applies the diff | ||
| 1102 | * | ||
| 1103 | * -1 to make sure user will never see the same | ||
| 1104 | * vblank counter value before and after a modeset | ||
| 1105 | */ | ||
| 1106 | dev->vblank[crtc].last = | ||
| 1107 | (dev->driver->get_vblank_counter(dev, crtc) - 1) & | ||
| 1108 | dev->max_vblank_count; | ||
| 1109 | |||
| 1098 | /* re-enable interrupts if there's are users left */ | 1110 | /* re-enable interrupts if there's are users left */ |
| 1099 | if (atomic_read(&dev->vblank[crtc].refcount) != 0) | 1111 | if (atomic_read(&dev->vblank[crtc].refcount) != 0) |
| 1100 | WARN_ON(drm_vblank_enable(dev, crtc)); | 1112 | WARN_ON(drm_vblank_enable(dev, crtc)); |
