output: Replace wlr_output_adaptive_sync_status with bool

This commit is contained in:
Alexander Orzechowski 2023-06-20 22:54:40 -04:00
parent 28b03c3220
commit 6d8f3babe4
8 changed files with 15 additions and 32 deletions

View file

@ -302,8 +302,7 @@ static bool atomic_crtc_commit(struct wlr_drm_connector *conn,
&state->base->damage, &fb_damage_clips);
}
bool prev_vrr_enabled =
output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED;
bool prev_vrr_enabled = output->adaptive_sync_enabled;
bool vrr_enabled = prev_vrr_enabled;
if ((state->base->committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED)) {
if (!drm_connector_supports_vrr(conn)) {
@ -378,9 +377,7 @@ static bool atomic_crtc_commit(struct wlr_drm_connector *conn,
commit_blob(drm, &crtc->gamma_lut, gamma_lut);
if (vrr_enabled != prev_vrr_enabled) {
output->adaptive_sync_status = vrr_enabled ?
WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED :
WLR_OUTPUT_ADAPTIVE_SYNC_DISABLED;
output->adaptive_sync_enabled = vrr_enabled;
wlr_drm_conn_log(conn, WLR_DEBUG, "VRR %s",
vrr_enabled ? "enabled" : "disabled");
}

View file

@ -125,9 +125,7 @@ static bool legacy_crtc_commit(struct wlr_drm_connector *conn,
"drmModeObjectSetProperty(VRR_ENABLED) failed");
return false;
}
output->adaptive_sync_status = state->base->adaptive_sync_enabled ?
WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED :
WLR_OUTPUT_ADAPTIVE_SYNC_DISABLED;
output->adaptive_sync_enabled = state->base->adaptive_sync_enabled;
wlr_drm_conn_log(conn, WLR_DEBUG, "VRR %s",
state->base->adaptive_sync_enabled ? "enabled" : "disabled");
}

View file

@ -329,8 +329,7 @@ static bool crtc_commit(struct wlr_drm_connector *conn,
&state->base->damage, &fb_damage_clips);
}
bool prev_vrr_enabled =
output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED;
bool prev_vrr_enabled = output->adaptive_sync_enabled;
bool vrr_enabled = prev_vrr_enabled;
if ((state->base->committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED) &&
drm_connector_supports_vrr(conn)) {
@ -456,9 +455,7 @@ out:
commit_blob(drm, &crtc->gamma_lut, gamma_lut);
if (vrr_enabled != prev_vrr_enabled) {
output->adaptive_sync_status = vrr_enabled ?
WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED :
WLR_OUTPUT_ADAPTIVE_SYNC_DISABLED;
output->adaptive_sync_enabled = vrr_enabled;
wlr_drm_conn_log(conn, WLR_DEBUG, "VRR %s",
vrr_enabled ? "enabled" : "disabled");
}

View file

@ -261,7 +261,7 @@ static bool output_test(struct wlr_output *wlr_output,
// 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);
assert(wlr_output->adaptive_sync_enabled);
if (state->committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED) {
if (!state->adaptive_sync_enabled) {
return false;
@ -742,7 +742,7 @@ 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;
wlr_output->adaptive_sync_enabled = true;
size_t output_num = ++last_output_num;

View file

@ -124,7 +124,7 @@ static bool output_test(struct wlr_output *wlr_output,
// _VARIABLE_REFRESH window property like mesa automatically does. We don't
// have any control beyond that, so we set the state to enabled on creating
// the output and never allow changing it (just like the Wayland backend).
assert(wlr_output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED);
assert(wlr_output->adaptive_sync_enabled);
if (state->committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED) {
if (!state->adaptive_sync_enabled) {
return false;
@ -586,7 +586,7 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) {
xcb_change_property(x11->xcb, XCB_PROP_MODE_REPLACE, output->win,
x11->atoms.variable_refresh, XCB_ATOM_CARDINAL, 32, 1,
&enabled);
wlr_output->adaptive_sync_status = WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED;
wlr_output->adaptive_sync_enabled = true;
wlr_x11_output_set_title(wlr_output, NULL);