Message ID | 1458588187-26002-2-git-send-email-gustavo@padovan.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi, On 21 March 2016 at 19:23, Gustavo Padovan <gustavo@padovan.org> wrote: > @@ -96,6 +98,11 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane, > plane->state->crtc_y, > plane->state->crtc_w, > plane->state->crtc_h); > + > + spin_lock_irqsave(&crtc->dev->event_lock, flags); > + if (crtc->state->event) > + drm_crtc_send_vblank_event(crtc, crtc->state->event); > + spin_unlock_irqrestore(&crtc->dev->event_lock, flags); This seems like the wrong place to do it, in that it will generate one flip event per plane, rather than one per CRTC. So this should probably be done in the overall atomic_commit hook I think. Also, without some kind of delay, this means that we'll generate flip-complete events immediately, which will cause compositors like Weston to render infinitely fast. It's probably worth looking at what happened when this came up with Bochs - I'm not sure if we fake a 16ms delay, or refuse to do async modesets, or what. Cheers, Daniel
diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 70b44a2..20260ad 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -63,9 +63,11 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane, { struct drm_device *dev = plane->dev; struct virtio_gpu_device *vgdev = dev->dev_private; - struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(plane->crtc); + struct drm_crtc *crtc = plane->crtc; + struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(crtc); struct virtio_gpu_framebuffer *vgfb; struct virtio_gpu_object *bo; + unsigned long flags; uint32_t handle; if (plane->state->fb) { @@ -96,6 +98,11 @@ static void virtio_gpu_plane_atomic_update(struct drm_plane *plane, plane->state->crtc_y, plane->state->crtc_w, plane->state->crtc_h); + + spin_lock_irqsave(&crtc->dev->event_lock, flags); + if (crtc->state->event) + drm_crtc_send_vblank_event(crtc, crtc->state->event); + spin_unlock_irqrestore(&crtc->dev->event_lock, flags); }