backend-headless: Don't try to finish frame if it was cancelled

When multiple outputs are present, a failure in one's repaint will
cause any repaints of all other outputs to be cancelled. If this
happens during the headless "frame" time, the assertion on
repaint_status in weston_output_finish_frame fails.

Do the same as the DRM backend does in its equivalent callback
drm_output_update_complete and don't finish the frame.

Signed-off-by: Ray Smith <rsmith@brightsign.biz>
This commit is contained in:
Ray Smith 2023-12-06 16:40:35 +00:00 committed by Daniel Stone
parent dedcfb40dd
commit 433f648adb
1 changed files with 8 additions and 0 deletions

View File

@ -140,6 +140,14 @@ finish_frame_handler(void *data)
struct timespec ts;
weston_compositor_read_presentation_clock(output->base.compositor, &ts);
/* If another output's repaint failed before this repaint finished,
* this repaint will have been cancelled by now. In this case we cannot
* go through finish_frame, because the repaint machinery does not
* expect this. */
if (output->base.repaint_status != REPAINT_AWAITING_COMPLETION)
return -1;
weston_output_finish_frame(&output->base, &ts, 0);
return 1;