[PATCH weston v3] compositor-drm: pageflip timeout implementation

Pekka Paalanen ppaalanen at gmail.com
Tue Mar 7 12:30:42 UTC 2017


On Mon,  6 Mar 2017 20:15:05 +0000
Emmanuel Gil Peyrot <emmanuel.peyrot at collabora.com> wrote:

> Weston will not repaint until previous update has been acked by a
> pageflip event coming from the drm driver. However, some buggy drivers
> won’t return those events or will stop sending them at some point and
> Weston output repaints will completely freeze. To ease developers’ task
> in testing their drivers, this patch makes compositor-drm use a timer
> to detect cases where those pageflip events stop coming.
> 
> This timeout implementation is software only and includes basic
> features usually found in a watchdog. We simply exit Weston gracefully
> with a log message and an exit code when the timout is reached.
> 
> The timeout value can be set via weston.ini by adding a
> pageflip-timeout=<MILLISECONDS> entry under a new [compositor-drm]
> section. Setting it to 0 disables the timeout feature.
> 
> v2:
> - Made sure we would get both the pageflip and the vblank events before
>   stopping the timer.
> - Reordered the error and success cases in
>   drm_output_pageflip_timer_create() to be more in line with the rest
>   of the code.
> 
> v3:
> - Reordered (de)arming of the timer with the code around it to avoid it
>   being rearmed before the current dearming.
> - Return the proper value for the dispatcher in the pageflip_timeout
>   callback.
> - Also display the output name in case the timer fires.
> 
> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=83884
> Signed-off-by: Frederic Plourde <frederic.plourde at collabora.co.uk>
> Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot at collabora.com>
> Reviewed-by: Daniel Stone <daniels at collabora.com>
> ---
>  compositor/main.c          |  2 ++
>  libweston/compositor-drm.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++
>  libweston/compositor-drm.h |  7 +++++
>  man/weston.ini.man         |  5 ++++
>  4 files changed, 79 insertions(+)

> @@ -749,6 +791,10 @@ drm_output_repaint(struct weston_output *output_base,
>  		output_base->set_dpms(output_base, WESTON_DPMS_ON);
>  	}
>  
> +	if (output->pageflip_timer)
> +		wl_event_source_timer_update(output->pageflip_timer,
> +		                             backend->pageflip_timeout);
> +
>  	if (drmModePageFlip(backend->drm.fd, output->crtc_id,

Hi,

looks like you forgot to flip the order here. Should try to pageflip
first, arm the timer then.

Otherwise it all looks good, and I'll probably merge the next revision
immediately.


Thanks,
pq

>  			    output->next->fb_id,
>  			    DRM_MODE_PAGE_FLIP_EVENT, output) < 0) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170307/88f12b21/attachment.sig>


More information about the wayland-devel mailing list