diff options
author | Isaac Freund <mail@isaacfreund.com> | 2022-06-28 19:55:48 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-08-30 17:53:50 +0000 |
commit | 2ec27d23e01377b341346036176cdc2faf0662cf (patch) | |
tree | feedc9d43356ee8d472151ec2b4047a17c68a860 /backend | |
parent | 8c70245d5fe044f09882653437e0a9dc7c336a0c (diff) |
backend/wayland: report adaptive sync as enabled
Adaptive sync is effectively always enabled when using the Wayland
backend. This is not something we have control over, so we set the
state to enabled on creating the output and never allow changing it.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/wayland/output.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c index 36b3911b..28fa5e99 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -29,7 +29,8 @@ static const uint32_t SUPPORTED_OUTPUT_STATE = WLR_OUTPUT_STATE_BACKEND_OPTIONAL | WLR_OUTPUT_STATE_BUFFER | - WLR_OUTPUT_STATE_MODE; + WLR_OUTPUT_STATE_MODE | + WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED; static struct wlr_wl_output *get_wl_output_from_output( struct wlr_output *wlr_output) { @@ -251,6 +252,16 @@ static bool output_test(struct wlr_output *wlr_output, return false; } + // Adaptive sync is effectively always enabled when using the Wayland + // backend. This is not something we have control over, so we set the state + // to enabled on creating the output and never allow changing it. + assert(wlr_output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED); + if (state->committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED) { + if (!state->adaptive_sync_enabled) { + return false; + } + } + if (state->committed & WLR_OUTPUT_STATE_MODE) { assert(state->mode_type == WLR_OUTPUT_STATE_MODE_CUSTOM); } @@ -521,6 +532,8 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *wlr_backend) { wlr_output_update_custom_mode(wlr_output, 1280, 720, 0); + wlr_output->adaptive_sync_status = WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED; + char name[64]; snprintf(name, sizeof(name), "WL-%zu", ++backend->last_output_num); wlr_output_set_name(wlr_output, name); |