diff --git a/src/backends/native/meta-kms-connector.c b/src/backends/native/meta-kms-connector.c index 4cb133d9c..53837418f 100644 --- a/src/backends/native/meta-kms-connector.c +++ b/src/backends/native/meta-kms-connector.c @@ -195,19 +195,6 @@ 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) @@ -446,6 +433,7 @@ state_set_properties (MetaKmsConnectorState *state, prop = &props[META_KMS_CONNECTOR_PROP_MAX_BPC]; if (prop->prop_id) { + state->max_bpc.supported = TRUE; state->max_bpc.value = prop->value; state->max_bpc.min_value = prop->range_min; state->max_bpc.max_value = prop->range_max; @@ -1063,7 +1051,8 @@ 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 || + if (state->max_bpc.supported != new_state->max_bpc.supported || + 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; diff --git a/src/backends/native/meta-kms-connector.h b/src/backends/native/meta-kms-connector.h index e29398a11..5f5fb73d1 100644 --- a/src/backends/native/meta-kms-connector.h +++ b/src/backends/native/meta-kms-connector.h @@ -57,7 +57,12 @@ typedef struct _MetaKmsConnectorState MetaMonitorTransform panel_orientation_transform; - MetaKmsRange max_bpc; + struct { + uint64_t value; + uint64_t min_value; + uint64_t max_value; + gboolean supported; + } max_bpc; struct { MetaOutputColorspace value; @@ -100,8 +105,6 @@ const MetaKmsConnectorState * meta_kms_connector_get_current_state (MetaKmsConne gboolean meta_kms_connector_is_privacy_screen_supported (MetaKmsConnector *connector); -const MetaKmsRange * meta_kms_connector_get_max_bpc (MetaKmsConnector *connector); - gboolean meta_kms_connector_is_color_space_supported (MetaKmsConnector *connector, MetaOutputColorspace color_space); diff --git a/src/backends/native/meta-kms-types.h b/src/backends/native/meta-kms-types.h index a065bd207..3a093a1c4 100644 --- a/src/backends/native/meta-kms-types.h +++ b/src/backends/native/meta-kms-types.h @@ -88,10 +88,3 @@ typedef enum _MetaKmsPropType META_KMS_PROP_TYPE_RAW = 0, META_KMS_PROP_TYPE_FIXED_16, } MetaKmsPropType; - -typedef struct _MetaKmsRange -{ - uint64_t value; - uint64_t min_value; - uint64_t max_value; -} MetaKmsRange; diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c index dca04a61b..109d34cf2 100644 --- a/src/backends/native/meta-output-kms.c +++ b/src/backends/native/meta-output-kms.c @@ -316,7 +316,6 @@ meta_output_kms_new (MetaGpuKms *gpu_kms, const MetaKmsConnectorState *connector_state; GArray *crtcs; GList *l; - const MetaKmsRange *max_bpc_range; gpu_id = meta_gpu_kms_get_id (gpu_kms); connector_id = meta_kms_connector_get_id (kms_connector); @@ -367,11 +366,10 @@ meta_output_kms_new (MetaGpuKms *gpu_kms, output_info->hotplug_mode_update = connector_state->hotplug_mode_update; output_info->supports_underscanning = connector_state->underscan.supported; - max_bpc_range = meta_kms_connector_get_max_bpc (kms_connector); - if (max_bpc_range) + if (connector_state->max_bpc.supported) { - output_info->max_bpc_min = max_bpc_range->min_value; - output_info->max_bpc_max = max_bpc_range->max_value; + output_info->max_bpc_min = connector_state->max_bpc.min_value; + output_info->max_bpc_max = connector_state->max_bpc.max_value; } if (connector_state->edid_data)