diff --git a/src/backends/native/meta-kms-connector-private.h b/src/backends/native/meta-kms-connector-private.h index e1d9b44cd..73757a8fc 100644 --- a/src/backends/native/meta-kms-connector-private.h +++ b/src/backends/native/meta-kms-connector-private.h @@ -39,6 +39,7 @@ typedef enum _MetaKmsConnectorProp META_KMS_CONNECTOR_PROP_SCALING_MODE, META_KMS_CONNECTOR_PROP_PANEL_ORIENTATION, META_KMS_CONNECTOR_PROP_NON_DESKTOP, + META_KMS_CONNECTOR_PROP_MAX_BPC, META_KMS_CONNECTOR_N_PROPS } MetaKmsConnectorProp; diff --git a/src/backends/native/meta-kms-connector.c b/src/backends/native/meta-kms-connector.c index 724f96e36..2bc337291 100644 --- a/src/backends/native/meta-kms-connector.c +++ b/src/backends/native/meta-kms-connector.c @@ -190,6 +190,19 @@ has_privacy_screen_software_toggle (MetaKmsConnector *connector) META_KMS_CONNECTOR_PROP_PRIVACY_SCREEN_SW_STATE) != 0; } +const MetaKmsRange * +meta_kms_connector_get_max_bpc (MetaKmsConnector *connector) +{ + const MetaKmsRange *range = NULL; + + if (connector->current_state && + meta_kms_connector_get_prop_id (connector, + META_KMS_CONNECTOR_PROP_MAX_BPC)) + range = &connector->current_state->max_bpc; + + return range; +} + static void sync_fd_held (MetaKmsConnector *connector, MetaKmsImplDevice *impl_device) @@ -308,6 +321,14 @@ state_set_properties (MetaKmsConnectorState *state, prop = &props[META_KMS_CONNECTOR_PROP_PRIVACY_SCREEN_HW_STATE]; if (prop->prop_id) set_privacy_screen (state, connector, prop); + + prop = &props[META_KMS_CONNECTOR_PROP_MAX_BPC]; + if (prop->prop_id) + { + state->max_bpc.value = prop->value; + state->max_bpc.min_value = prop->range_min; + state->max_bpc.max_value = prop->range_max; + } } static CoglSubpixelOrder @@ -622,6 +643,11 @@ meta_kms_connector_state_changes (MetaKmsConnectorState *state, if (!kms_modes_equal (state->modes, new_state->modes)) return META_KMS_RESOURCE_CHANGE_FULL; + if (state->max_bpc.value != new_state->max_bpc.value || + state->max_bpc.min_value != new_state->max_bpc.min_value || + state->max_bpc.max_value != new_state->max_bpc.max_value) + return META_KMS_RESOURCE_CHANGE_FULL; + if (state->privacy_screen_state != new_state->privacy_screen_state) return META_KMS_RESOURCE_CHANGE_PRIVACY_SCREEN; @@ -940,6 +966,11 @@ init_properties (MetaKmsConnector *connector, .name = "non-desktop", .type = DRM_MODE_PROP_RANGE, }, + [META_KMS_CONNECTOR_PROP_MAX_BPC] = + { + .name = "max bpc", + .type = DRM_MODE_PROP_RANGE, + }, }, .dpms_enum = { [META_KMS_CONNECTOR_DPMS_ON] = diff --git a/src/backends/native/meta-kms-connector.h b/src/backends/native/meta-kms-connector.h index c2b763548..bbd59d342 100644 --- a/src/backends/native/meta-kms-connector.h +++ b/src/backends/native/meta-kms-connector.h @@ -59,6 +59,8 @@ typedef struct _MetaKmsConnectorState gboolean hotplug_mode_update; MetaMonitorTransform panel_orientation_transform; + + MetaKmsRange max_bpc; } MetaKmsConnectorState; META_EXPORT_TEST @@ -83,4 +85,6 @@ gboolean meta_kms_connector_is_underscanning_supported (MetaKmsConnector *connec gboolean meta_kms_connector_is_privacy_screen_supported (MetaKmsConnector *connector); +const MetaKmsRange * meta_kms_connector_get_max_bpc (MetaKmsConnector *connector); + #endif /* META_KMS_CONNECTOR_H */