From a0345f28540a577c83bb23243639078caf94d75c Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 28 Sep 2022 11:09:53 +0200 Subject: output: add wlr_output_state.allow_artifacts When starting up, the compositor might call wlr_output_set_mode() with a mode which is already the current one. wlroots will detect this and make the wlr_output_set_mode() call a no-op. During the next wlr_output_commit() call, wlroots will perform an atomic commit without the ALLOW_MODESET flag. This is an issue, because some drivers need ALLOW_MODESET even if the mode is the same. For instance, if the FB stride or modifier changed, some drivers require a modeset. Add a new flag "allow_artifacts" which is set when the compositor calls mode-setting functions. Use this flag to figure out whether we want to perform atomic commits with ALLOW_MODESET. (The name "allow_artifacts" is picked because ALLOW_MODESET is a misnomer, see [1].) [1]: https://patchwork.freedesktop.org/patch/505107/ Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3499 --- backend/drm/drm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'backend/drm') diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 3b14c63e..2b09ca91 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -384,8 +384,7 @@ static void drm_connector_state_init(struct wlr_drm_connector_state *state, const struct wlr_output_state *base) { memset(state, 0, sizeof(*state)); state->base = base; - state->modeset = base->committed & - (WLR_OUTPUT_STATE_ENABLED | WLR_OUTPUT_STATE_MODE); + state->modeset = base->allow_artifacts; state->active = (base->committed & WLR_OUTPUT_STATE_ENABLED) ? base->enabled : conn->output.enabled; -- cgit v1.2.3