From 2b561a369ca57e68625973ac83bb56460b35665d Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Fri, 13 May 2022 16:26:10 +0800 Subject: [PATCH] kms-update: Add function meta_kms_update_set_max_bpc Part-of: --- src/backends/native/meta-kms-update-private.h | 5 +++++ src/backends/native/meta-kms-update.c | 14 ++++++++++++++ src/backends/native/meta-kms-update.h | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/src/backends/native/meta-kms-update-private.h b/src/backends/native/meta-kms-update-private.h index 9dab7c133..3a648ba0d 100644 --- a/src/backends/native/meta-kms-update-private.h +++ b/src/backends/native/meta-kms-update-private.h @@ -82,6 +82,11 @@ typedef struct _MetaKmsConnectorUpdate gboolean has_update; gboolean is_enabled; } privacy_screen; + + struct { + gboolean has_update; + uint64_t value; + } max_bpc; } MetaKmsConnectorUpdate; typedef struct _MetaKmsPageFlipListener diff --git a/src/backends/native/meta-kms-update.c b/src/backends/native/meta-kms-update.c index 042714d0a..4c34000ef 100644 --- a/src/backends/native/meta-kms-update.c +++ b/src/backends/native/meta-kms-update.c @@ -356,6 +356,20 @@ meta_kms_update_set_privacy_screen (MetaKmsUpdate *update, connector_update->privacy_screen.is_enabled = enabled; } +void +meta_kms_update_set_max_bpc (MetaKmsUpdate *update, + MetaKmsConnector *connector, + uint64_t max_bpc) +{ + MetaKmsConnectorUpdate *connector_update; + + g_assert (meta_kms_connector_get_device (connector) == update->device); + + connector_update = ensure_connector_update (update, connector); + connector_update->max_bpc.value = max_bpc; + connector_update->max_bpc.has_update = TRUE; +} + void meta_kms_crtc_gamma_free (MetaKmsCrtcGamma *gamma) { diff --git a/src/backends/native/meta-kms-update.h b/src/backends/native/meta-kms-update.h index f31e36aad..d5557d7ce 100644 --- a/src/backends/native/meta-kms-update.h +++ b/src/backends/native/meta-kms-update.h @@ -107,6 +107,10 @@ void meta_kms_update_set_privacy_screen (MetaKmsUpdate *update, MetaKmsConnector *connector, gboolean enabled); +void meta_kms_update_set_max_bpc (MetaKmsUpdate *update, + MetaKmsConnector *connector, + uint64_t max_bpc); + META_EXPORT_TEST void meta_kms_update_set_power_save (MetaKmsUpdate *update);