[PATCH weston v3 08/11] Change boolean repaint_scheduled to quad-state enum

Pekka Paalanen ppaalanen at gmail.com
Wed Mar 8 13:22:33 UTC 2017


On Fri,  3 Mar 2017 16:59:42 +0000
Daniel Stone <daniels at collabora.com> wrote:

> repaint_scheduled is actually cleverly a quad-state, disguised as a
> boolean. There are four possible conditions for the repaint loop to be
> in at any time:
>   - loop idle; no repaint will occur until specifically requested, which
>     may be never (repaint_scheduled == 0)
>   - loop schedule to begin: the loop was previously idle, but due to a
>     repaint-schedule request, we will call the start_repaint_loop hook
>     in the next idle timer

s/timer/task/

I can fix that when merging. Right?

>   - repaint scheduled: the compositor has definitively scheduled a
>     repaint request for this output, which will occur in fixed time
>   - awaiting repaint completion: the backend has not yet signaled
>     completion of the last repaint request, and the compositor will not
>     schedule another until it does so
> 
> All but the first condition were previously conflated as
> repaint_scheduled == 1, but break them out into separate conditions to
> aid clarity, backed up by some asserts.
> 
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
>  libweston/compositor.c | 20 +++++++++++++++++---
>  libweston/compositor.h | 10 +++++++++-
>  2 files changed, 26 insertions(+), 4 deletions(-)
> 
> v3: Only this patch has changed in this revision of the series.
>     Tri-state wasn't actually enough on multi-output setups: if
>     both outputs were set to REPAINT_SCHEDULED to call
>     start_repaint_loop, one output could trigger a full repaint,
>     arm the timer, and clear the repaint status before the other's
>     idle_repaint hook was called. This would then fail the assert
>     (good thing it was there!) in start_repaint_loop.
>     Fix this by expanding to quad-state, handling
>     waiting-for-idle_repaint-to-start_repaint_loop as a separate
>     status.

Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


Thanks,
pq
-------------- 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/20170308/3dcafc58/attachment.sig>


More information about the wayland-devel mailing list