drm-backend: limit reset/restart to output of a failed commit

When a commit fails, then only the outputs that where part of this commit should
be reset or restarted.

Otherwise an unrelated output that has another successful pending commit may be
restarted incorrectly. Then the output is in an inconsistent state and will
trigger an assertion:

weston: ../libweston/backend-drm/state-propose.c:627: drm_output_propose_state: Assertion `!output->state_last' failed.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
Michael Olbrich 2024-06-21 21:36:05 +02:00
parent ef175c8ed4
commit f843ba34d1
1 changed files with 5 additions and 7 deletions

View File

@ -946,7 +946,7 @@ drm_repaint_flush_device(struct drm_device *device)
{
struct drm_backend *b = device->backend;
struct drm_pending_state *pending_state;
struct weston_output *base;
struct drm_output_state *output_state;
int ret;
pending_state = device->repaint_data;
@ -964,15 +964,13 @@ drm_repaint_flush_device(struct drm_device *device)
if (ret == 0)
return;
wl_list_for_each(base, &b->compositor->output_list, link) {
struct drm_output *tmp = to_drm_output(base);
if (!tmp || tmp->device != device)
continue;
wl_list_for_each(output_state, &pending_state->output_list, link) {
struct drm_output *tmp = output_state->output;
if (ret == -EBUSY)
weston_output_schedule_repaint_restart(base);
weston_output_schedule_repaint_restart(&tmp->base);
else
weston_output_schedule_repaint_reset(base);
weston_output_schedule_repaint_reset(&tmp->base);
}
}