connector/kms: Detect variable refresh rate capability

The "vrr_capable" property indicates whether variable refresh rate is
supported for a connector.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154>
This commit is contained in:
Dor Askayo 2020-03-17 21:42:37 +02:00 committed by Marge Bot
parent d5f68c8140
commit b7128b1d12
3 changed files with 16 additions and 0 deletions

View File

@ -40,6 +40,7 @@ typedef enum _MetaKmsConnectorProp
META_KMS_CONNECTOR_PROP_COLORSPACE,
META_KMS_CONNECTOR_PROP_HDR_OUTPUT_METADATA,
META_KMS_CONNECTOR_PROP_BROADCAST_RGB,
META_KMS_CONNECTOR_PROP_VRR_CAPABLE,
META_KMS_CONNECTOR_N_PROPS
} MetaKmsConnectorProp;

View File

@ -397,6 +397,10 @@ state_set_properties (MetaKmsConnectorState *state,
prop = &props[META_KMS_CONNECTOR_PROP_UNDERSCAN];
if (prop->prop_id)
state->underscan.supported = TRUE;
prop = &props[META_KMS_CONNECTOR_PROP_VRR_CAPABLE];
if (prop->prop_id)
state->vrr_capable = !!prop->value;
}
static CoglSubpixelOrder
@ -829,6 +833,7 @@ meta_kms_connector_state_new (void)
state = g_new0 (MetaKmsConnectorState, 1);
state->suggested_x = -1;
state->suggested_y = -1;
state->vrr_capable = FALSE;
return state;
}
@ -1007,6 +1012,9 @@ meta_kms_connector_state_changes (MetaKmsConnectorState *state,
state->broadcast_rgb.supported != new_state->broadcast_rgb.supported)
return META_KMS_RESOURCE_CHANGE_FULL;
if (state->vrr_capable != new_state->vrr_capable)
return META_KMS_RESOURCE_CHANGE_FULL;
if (state->privacy_screen_state != new_state->privacy_screen_state)
return META_KMS_RESOURCE_CHANGE_PRIVACY_SCREEN;
@ -1357,6 +1365,11 @@ init_properties (MetaKmsConnector *connector,
.num_enum_values = META_KMS_CONNECTOR_BROADCAST_RGB_N_PROPS,
.default_value = META_KMS_CONNECTOR_BROADCAST_RGB_UNKNOWN,
},
[META_KMS_CONNECTOR_PROP_VRR_CAPABLE] =
{
.name = "vrr_capable",
.type = DRM_MODE_PROP_RANGE,
},
},
.dpms_enum = {
[META_KMS_CONNECTOR_DPMS_ON] =

View File

@ -83,6 +83,8 @@ typedef struct _MetaKmsConnectorState
struct {
gboolean supported;
} underscan;
gboolean vrr_capable;
} MetaKmsConnectorState;
META_EXPORT_TEST