From 9f492a0ee06e06db132ff45634abc277787977ed Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Tue, 13 Jul 2021 15:26:08 +0800 Subject: [PATCH] kms: Add fixed point formatting to MUTTER_DEBUG=kms printing Part-of: --- .../native/meta-kms-impl-device-atomic.c | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/backends/native/meta-kms-impl-device-atomic.c b/src/backends/native/meta-kms-impl-device-atomic.c index 66246e87e..8e41207ee 100644 --- a/src/backends/native/meta-kms-impl-device-atomic.c +++ b/src/backends/native/meta-kms-impl-device-atomic.c @@ -348,14 +348,28 @@ add_plane_property (MetaKmsImplDevice *impl_device, return FALSE; } - meta_topic (META_DEBUG_KMS, - "[atomic] Setting plane %u (%s) property '%s' (%u) to %" - G_GUINT64_FORMAT, - meta_kms_plane_get_id (plane), - meta_kms_impl_device_get_path (impl_device), - meta_kms_plane_get_prop_name (plane, prop), - meta_kms_plane_get_prop_id (plane, prop), - value); + switch (meta_kms_plane_get_prop_internal_type (plane, prop)) + { + case META_KMS_PROP_TYPE_RAW: + meta_topic (META_DEBUG_KMS, + "[atomic] Setting plane %u (%s) property '%s' (%u) to %" + G_GUINT64_FORMAT, + meta_kms_plane_get_id (plane), + meta_kms_impl_device_get_path (impl_device), + meta_kms_plane_get_prop_name (plane, prop), + meta_kms_plane_get_prop_id (plane, prop), + value); + break; + case META_KMS_PROP_TYPE_FIXED_16: + meta_topic (META_DEBUG_KMS, + "[atomic] Setting plane %u (%s) property '%s' (%u) to %.2f", + meta_kms_plane_get_id (plane), + meta_kms_impl_device_get_path (impl_device), + meta_kms_plane_get_prop_name (plane, prop), + meta_kms_plane_get_prop_id (plane, prop), + meta_fixed_16_to_double (value)); + break; + } ret = drmModeAtomicAddProperty (req, meta_kms_plane_get_id (plane), prop_id,