compositor: Try an immediate repaint if VRR enabled

When in VRR mode, repainting without a wait might happen instantly,
so do it.

This is likely not the best long term solution, but is ok for now
while weston's vrr support is experimental.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2025-02-04 08:38:04 -06:00 committed by Marius Vlad
parent c7cf87fe85
commit bfb2dfae63

View file

@ -4146,6 +4146,18 @@ weston_output_finish_frame(struct weston_output *output,
goto out;
}
/* If we're doing game mode VRR, repainting right away
* might be better than waiting, so try now.
* TODO: Come up with some better handling...
* We should probably try to use "repaint window" style behaviour
* if we're scheduling a repaint during the vactive display
* period, but try to render immediately if we're not.
*/
if (output->vrr_mode == WESTON_VRR_MODE_GAME) {
output->next_repaint = now;
goto out;
}
timespec_add_nsec(&output->next_repaint, stamp, refresh_nsec);
timespec_add_msec(&output->next_repaint, &output->next_repaint,
-compositor->repaint_msec);