backend-drm: don't try to commit an empty state

With multiple DRM devices, the state for one device may be empty during
repaint_flush(). This can happen for example if an output of one device triggers
the repaint and there are no screens attached to the other device and therefore
no active outputs.

The atomic commit will actually fail because the commit contains the
DRM_MODE_PAGE_FLIP_EVENT flag but no CRTCs.

Avoid this by skipping the commit entirly. There is nothing to to anyways.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
Michael Olbrich 2023-03-06 15:50:15 +01:00 committed by Daniel Stone
parent 183d92e291
commit 0edcc9e5ba

View file

@ -1522,6 +1522,11 @@ drm_pending_state_apply(struct drm_pending_state *pending_state)
struct drm_output_state *output_state, *tmp;
struct drm_crtc *crtc;
if (wl_list_empty(&pending_state->output_list)) {
drm_pending_state_free(pending_state);
return 0;
}
if (device->atomic_modeset)
return drm_pending_state_apply_atomic(pending_state,
DRM_STATE_APPLY_ASYNC);