diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2016-04-14 13:58:54 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-04-26 19:32:04 -0400 |
commit | 9a11d2e7e66b6b8764a2430686b8716637bf812e (patch) | |
tree | a03fb96546e7dd0665360cdb44be91dc3d8bc018 /drivers/gpu/drm/virtio | |
parent | 9dc0487d96a0396367a1451b31873482080b527f (diff) |
drm/virtio: send vblank event after crtc updates
virtio_gpu was failing to send vblank events when using the atomic IOCTL
with the DRM_MODE_PAGE_FLIP_EVENT flag set. This patch fixes each and
enables atomic pageflips updates.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_display.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index 4854dac87e24..5fd1fd06effc 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c | |||
@@ -267,11 +267,23 @@ static int virtio_gpu_crtc_atomic_check(struct drm_crtc *crtc, | |||
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
269 | 269 | ||
270 | static void virtio_gpu_crtc_atomic_flush(struct drm_crtc *crtc, | ||
271 | struct drm_crtc_state *old_state) | ||
272 | { | ||
273 | unsigned long flags; | ||
274 | |||
275 | spin_lock_irqsave(&crtc->dev->event_lock, flags); | ||
276 | if (crtc->state->event) | ||
277 | drm_crtc_send_vblank_event(crtc, crtc->state->event); | ||
278 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | ||
279 | } | ||
280 | |||
270 | static const struct drm_crtc_helper_funcs virtio_gpu_crtc_helper_funcs = { | 281 | static const struct drm_crtc_helper_funcs virtio_gpu_crtc_helper_funcs = { |
271 | .enable = virtio_gpu_crtc_enable, | 282 | .enable = virtio_gpu_crtc_enable, |
272 | .disable = virtio_gpu_crtc_disable, | 283 | .disable = virtio_gpu_crtc_disable, |
273 | .mode_set_nofb = virtio_gpu_crtc_mode_set_nofb, | 284 | .mode_set_nofb = virtio_gpu_crtc_mode_set_nofb, |
274 | .atomic_check = virtio_gpu_crtc_atomic_check, | 285 | .atomic_check = virtio_gpu_crtc_atomic_check, |
286 | .atomic_flush = virtio_gpu_crtc_atomic_flush, | ||
275 | }; | 287 | }; |
276 | 288 | ||
277 | static void virtio_gpu_enc_mode_set(struct drm_encoder *encoder, | 289 | static void virtio_gpu_enc_mode_set(struct drm_encoder *encoder, |