drm: Add whether planes are enabled or not to the drm output state

This will be handy later when trying to determine when it's ok to reuse
output state, as changing this would invalidate previous state.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2025-10-23 14:26:48 -05:00
parent 2bb8cdba83
commit 87776413ba
2 changed files with 4 additions and 0 deletions

View file

@ -354,6 +354,7 @@ struct drm_output_state {
enum weston_hdcp_protection protection; enum weston_hdcp_protection protection;
struct wl_list plane_list; struct wl_list plane_list;
bool tear; bool tear;
bool planes_enabled;
}; };
/** /**

View file

@ -890,6 +890,7 @@ drm_output_propose_state(struct weston_output *output_base,
pending_state, pending_state,
DRM_OUTPUT_STATE_CLEAR_PLANES); DRM_OUTPUT_STATE_CLEAR_PLANES);
state->dpms = WESTON_DPMS_ON; state->dpms = WESTON_DPMS_ON;
state->planes_enabled = !output_base->disable_planes;
/* Start with the assumption that we're going to do a tearing commit, /* Start with the assumption that we're going to do a tearing commit,
* if the hardware supports it and we're not compositing with the * if the hardware supports it and we're not compositing with the
@ -1249,6 +1250,8 @@ drm_assign_planes(struct weston_output *output_base)
} }
assert(state); assert(state);
assert(state->planes_enabled == !output_base->disable_planes);
drm_debug(b, "\t[repaint] Using %s composition\n", drm_debug(b, "\t[repaint] Using %s composition\n",
drm_propose_state_mode_to_string(mode)); drm_propose_state_mode_to_string(mode));