Re: [PATCH 2/2] drm/virtio: send vblank event on plane atomic update

From: Daniel Stone
Date: Tue Mar 22 2016 - 09:17:37 EST


On 21 March 2016 at 19:23, Gustavo Padovan <gustavo@xxxxxxxxxxx> 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.