mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-22 18:09:49 +01:00
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.
This commit is contained in:
parent
8c70245d5f
commit
2ec27d23e0
1 changed files with 14 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue