aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2023-10-06 00:14:32 +0200
committerSimon Ser <contact@emersion.fr>2023-10-09 08:31:35 +0000
commit2cf78f4c5bcfce88c7e485a92c1c4f9d70a636d7 (patch)
tree4e32e735db49f9f75140626751f63d32ed380777
parent291431c14f5e5c33c14a6fff4284c3de03ff292c (diff)
output: allow_artifacts -> allow_reconfiguration
The name "allow_artifacts" and associated description is very vague, and theoretically allow for tearing behavior. Clarify that we only intend to mean artifacts related to output configuration (e.g., modesets). References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3740
-rw-r--r--backend/drm/drm.c2
-rw-r--r--include/wlr/types/wlr_output.h6
-rw-r--r--types/output/render.c2
-rw-r--r--types/output/state.c6
4 files changed, 8 insertions, 8 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 80d62fa8..3db27749 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -452,7 +452,7 @@ static void drm_connector_state_init(struct wlr_drm_connector_state *state,
const struct wlr_output_state *base) {
*state = (struct wlr_drm_connector_state){
.base = base,
- .modeset = base->allow_artifacts,
+ .modeset = base->allow_reconfiguration,
.active = (base->committed & WLR_OUTPUT_STATE_ENABLED) ?
base->enabled : conn->output.enabled,
};
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h
index 7b57042c..28a5ebcb 100644
--- a/include/wlr/types/wlr_output.h
+++ b/include/wlr/types/wlr_output.h
@@ -77,9 +77,9 @@ enum wlr_output_state_mode_type {
*/
struct wlr_output_state {
uint32_t committed; // enum wlr_output_state_field
- // Set to true to allow temporary visual artifacts (e.g. black screen) while
- // the update is being applied
- bool allow_artifacts;
+ // Set to true to allow output reconfiguration to occur which may result
+ // in temporary output disruptions and content misrepresentations.
+ bool allow_reconfiguration;
pixman_region32_t damage; // output-buffer-local coordinates
bool enabled;
float scale;
diff --git a/types/output/render.c b/types/output/render.c
index a185d844..acc6f6b0 100644
--- a/types/output/render.c
+++ b/types/output/render.c
@@ -155,7 +155,7 @@ bool output_ensure_buffer(struct wlr_output *output,
if (state->committed & WLR_OUTPUT_STATE_RENDER_FORMAT) {
needs_new_buffer = true;
}
- if (state->allow_artifacts && output->commit_seq == 0 && enabled) {
+ if (state->allow_reconfiguration && output->commit_seq == 0 && enabled) {
// On first commit, require a new buffer if the compositor called a
// mode-setting function, even if the mode won't change. This makes it
// so the swapchain is created now.
diff --git a/types/output/state.c b/types/output/state.c
index 41610f03..0909b3e8 100644
--- a/types/output/state.c
+++ b/types/output/state.c
@@ -22,7 +22,7 @@ void wlr_output_state_set_enabled(struct wlr_output_state *state,
bool enabled) {
state->committed |= WLR_OUTPUT_STATE_ENABLED;
state->enabled = enabled;
- state->allow_artifacts = true;
+ state->allow_reconfiguration = true;
}
void wlr_output_state_set_mode(struct wlr_output_state *state,
@@ -30,7 +30,7 @@ void wlr_output_state_set_mode(struct wlr_output_state *state,
state->committed |= WLR_OUTPUT_STATE_MODE;
state->mode_type = WLR_OUTPUT_STATE_MODE_FIXED;
state->mode = mode;
- state->allow_artifacts = true;
+ state->allow_reconfiguration = true;
}
void wlr_output_state_set_custom_mode(struct wlr_output_state *state,
@@ -40,7 +40,7 @@ void wlr_output_state_set_custom_mode(struct wlr_output_state *state,
state->custom_mode.width = width;
state->custom_mode.height = height;
state->custom_mode.refresh = refresh;
- state->allow_artifacts = true;
+ state->allow_reconfiguration = true;
}
void wlr_output_state_set_scale(struct wlr_output_state *state, float scale) {