From e9e613a6c3a12c5bfad074924ba8a2d67f0a6b95 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Mon, 29 Jan 2024 16:36:17 +0100 Subject: [PATCH] kms/connector: Track underscan in KmsConnectorState Part-of: --- src/backends/native/meta-kms-connector.c | 16 ++++------------ src/backends/native/meta-kms-connector.h | 6 ++++-- src/backends/native/meta-output-kms.c | 3 +-- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/backends/native/meta-kms-connector.c b/src/backends/native/meta-kms-connector.c index 6948ea686..4cb133d9c 100644 --- a/src/backends/native/meta-kms-connector.c +++ b/src/backends/native/meta-kms-connector.c @@ -181,18 +181,6 @@ meta_kms_connector_get_current_state (MetaKmsConnector *connector) return connector->current_state; } -gboolean -meta_kms_connector_is_underscanning_supported (MetaKmsConnector *connector) -{ - uint32_t underscan_prop_id; - - underscan_prop_id = - meta_kms_connector_get_prop_id (connector, - META_KMS_CONNECTOR_PROP_UNDERSCAN); - - return underscan_prop_id != 0; -} - gboolean meta_kms_connector_is_privacy_screen_supported (MetaKmsConnector *connector) { @@ -480,6 +468,10 @@ state_set_properties (MetaKmsConnectorState *state, state->broadcast_rgb.supported = supported_drm_broadcast_rgb_to_output_rgb_range (prop->supported_variants); } + + prop = &props[META_KMS_CONNECTOR_PROP_UNDERSCAN]; + if (prop->prop_id) + state->underscan.supported = TRUE; } static CoglSubpixelOrder diff --git a/src/backends/native/meta-kms-connector.h b/src/backends/native/meta-kms-connector.h index e4a481632..e29398a11 100644 --- a/src/backends/native/meta-kms-connector.h +++ b/src/backends/native/meta-kms-connector.h @@ -74,6 +74,10 @@ typedef struct _MetaKmsConnectorState MetaOutputRGBRange value; uint64_t supported; } broadcast_rgb; + + struct { + gboolean supported; + } underscan; } MetaKmsConnectorState; META_EXPORT_TEST @@ -94,8 +98,6 @@ MetaKmsMode * meta_kms_connector_get_preferred_mode (MetaKmsConnector *connector META_EXPORT_TEST const MetaKmsConnectorState * meta_kms_connector_get_current_state (MetaKmsConnector *connector); -gboolean meta_kms_connector_is_underscanning_supported (MetaKmsConnector *connector); - gboolean meta_kms_connector_is_privacy_screen_supported (MetaKmsConnector *connector); const MetaKmsRange * meta_kms_connector_get_max_bpc (MetaKmsConnector *connector); diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c index f0c019547..dca04a61b 100644 --- a/src/backends/native/meta-output-kms.c +++ b/src/backends/native/meta-output-kms.c @@ -365,8 +365,7 @@ meta_output_kms_new (MetaGpuKms *gpu_kms, output_info->suggested_x = connector_state->suggested_x; output_info->suggested_y = connector_state->suggested_y; output_info->hotplug_mode_update = connector_state->hotplug_mode_update; - output_info->supports_underscanning = - meta_kms_connector_is_underscanning_supported (kms_connector); + output_info->supports_underscanning = connector_state->underscan.supported; max_bpc_range = meta_kms_connector_get_max_bpc (kms_connector); if (max_bpc_range)