diff options
author | Simon Ser <contact@emersion.fr> | 2024-02-26 17:19:51 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2024-02-26 17:19:51 +0100 |
commit | ef4997b722fa0b88607ebee6fadb10b01a3f4f29 (patch) | |
tree | 2fdb6b34bf9f54d097d4ff378d4460d9f00e6ede /backend/drm | |
parent | 374daeb2560350cf5075837077a3564dfcf316b6 (diff) |
backend/drm: use output_pending_enabled()
Use the helper instead of hand-rolling the logic.
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 564a60e2..64d3e45c 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -27,6 +27,7 @@ #include "render/pixel_format.h" #include "render/drm_format_set.h" #include "render/wlr_renderer.h" +#include "types/wlr_output.h" #include "util/env.h" #include "config.h" @@ -508,8 +509,7 @@ static void drm_connector_state_init(struct wlr_drm_connector_state *state, *state = (struct wlr_drm_connector_state){ .base = base, .modeset = base->allow_reconfiguration, - .active = (base->committed & WLR_OUTPUT_STATE_ENABLED) ? - base->enabled : conn->output.enabled, + .active = output_pending_enabled(&conn->output, base), // The wlr_output API requires non-modeset commits with a new buffer to // wait for the frame event. However compositors often perform // non-modesets commits without a new buffer without waiting for the @@ -672,9 +672,7 @@ static bool drm_connector_test(struct wlr_output *output, } } - if (((state->committed & WLR_OUTPUT_STATE_ENABLED) - ? state->enabled : output->enabled) && - !drm_connector_alloc_crtc(conn)) { + if (output_pending_enabled(output, state) && !drm_connector_alloc_crtc(conn)) { wlr_drm_conn_log(conn, WLR_DEBUG, "No CRTC available for this connector"); return false; |