kms/crtc: Track if the VRR_ENABLED property is supported

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3646>
This commit is contained in:
Sebastian Wick 2024-03-07 17:44:39 +01:00 committed by Marge Bot
parent f480de4ecd
commit 514a18fe0c
3 changed files with 13 additions and 7 deletions

View File

@ -229,7 +229,7 @@ meta_kms_crtc_state_changes (MetaKmsCrtcState *state,
if (!meta_drm_mode_equal (&state->drm_mode, &other_state->drm_mode)) if (!meta_drm_mode_equal (&state->drm_mode, &other_state->drm_mode))
return META_KMS_RESOURCE_CHANGE_FULL; return META_KMS_RESOURCE_CHANGE_FULL;
if (state->vrr_enabled != other_state->vrr_enabled) if (state->vrr.enabled != other_state->vrr.enabled)
return META_KMS_RESOURCE_CHANGE_FULL; return META_KMS_RESOURCE_CHANGE_FULL;
if (!gamma_equal (state, other_state)) if (!gamma_equal (state, other_state))
@ -274,7 +274,10 @@ meta_kms_crtc_read_state (MetaKmsCrtc *crtc,
prop = &crtc->prop_table.props[META_KMS_CRTC_PROP_VRR_ENABLED]; prop = &crtc->prop_table.props[META_KMS_CRTC_PROP_VRR_ENABLED];
if (prop->prop_id) if (prop->prop_id)
crtc_state.vrr_enabled = !!prop->value; {
crtc_state.vrr.supported = TRUE;
crtc_state.vrr.enabled = !!prop->value;
}
read_gamma_state (crtc, &crtc_state, impl_device, drm_crtc); read_gamma_state (crtc, &crtc_state, impl_device, drm_crtc);
@ -399,7 +402,7 @@ meta_kms_crtc_predict_state_in_impl (MetaKmsCrtc *crtc,
continue; continue;
if (crtc_update->vrr.has_update) if (crtc_update->vrr.has_update)
crtc->current_state.vrr_enabled = !!crtc_update->vrr.is_enabled; crtc->current_state.vrr.enabled = !!crtc_update->vrr.is_enabled;
break; break;
} }
@ -577,7 +580,7 @@ meta_kms_crtc_determine_deadline (MetaKmsCrtc *crtc,
return FALSE; return FALSE;
} }
if (crtc->current_state.vrr_enabled) if (crtc->current_state.vrr.enabled)
{ {
next_presentation_us = 0; next_presentation_us = 0;
next_deadline_us = next_deadline_us =

View File

@ -34,7 +34,10 @@ typedef struct _MetaKmsCrtcState
gboolean is_drm_mode_valid; gboolean is_drm_mode_valid;
drmModeModeInfo drm_mode; drmModeModeInfo drm_mode;
gboolean vrr_enabled; struct {
gboolean enabled;
gboolean supported;
} vrr;
struct { struct {
MetaGammaLut *value; MetaGammaLut *value;

View File

@ -111,7 +111,7 @@ assert_crtc_state_equals (const MetaKmsCrtcState *crtc_state1,
crtc_state2->drm_mode.name); crtc_state2->drm_mode.name);
} }
g_assert_true (crtc_state1->vrr_enabled == crtc_state2->vrr_enabled); g_assert_true (crtc_state1->vrr.enabled == crtc_state2->vrr.enabled);
g_assert_true (meta_gamma_lut_equal (crtc_state1->gamma.value, g_assert_true (meta_gamma_lut_equal (crtc_state1->gamma.value,
crtc_state2->gamma.value)); crtc_state2->gamma.value));
@ -211,7 +211,7 @@ copy_crtc_state (const MetaKmsCrtcState *crtc_state)
new_state = *crtc_state; new_state = *crtc_state;
new_state.vrr_enabled = crtc_state->vrr_enabled; new_state.vrr.enabled = crtc_state->vrr.enabled;
if (crtc_state->gamma.value) if (crtc_state->gamma.value)
new_state.gamma.value = meta_gamma_lut_copy (crtc_state->gamma.value); new_state.gamma.value = meta_gamma_lut_copy (crtc_state->gamma.value);