[mutter] kms: Add an internal MetaKmsPropType to distinguish fixed point values



commit ea75ea0b73fd192d166d21b34ad9c410f5cf8edc
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Tue Jul 13 14:01:32 2021 +0800

    kms: Add an internal MetaKmsPropType to distinguish fixed point values
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1923>

 src/backends/native/meta-kms-impl-device.h   |  1 +
 src/backends/native/meta-kms-plane-private.h |  3 +++
 src/backends/native/meta-kms-plane.c         | 11 +++++++++++
 src/backends/native/meta-kms-types.h         |  6 ++++++
 4 files changed, 21 insertions(+)
---
diff --git a/src/backends/native/meta-kms-impl-device.h b/src/backends/native/meta-kms-impl-device.h
index 7dbb14b8ec..e77024ecd6 100644
--- a/src/backends/native/meta-kms-impl-device.h
+++ b/src/backends/native/meta-kms-impl-device.h
@@ -48,6 +48,7 @@ struct _MetaKmsProp
 {
   const char *name;
   uint32_t type;
+  MetaKmsPropType internal_type;
   void (* parse) (MetaKmsImplDevice  *impl_device,
                   MetaKmsProp        *prop,
                   drmModePropertyPtr  drm_prop,
diff --git a/src/backends/native/meta-kms-plane-private.h b/src/backends/native/meta-kms-plane-private.h
index ca200c753e..92f9cfcc9a 100644
--- a/src/backends/native/meta-kms-plane-private.h
+++ b/src/backends/native/meta-kms-plane-private.h
@@ -58,4 +58,7 @@ uint32_t meta_kms_plane_get_prop_id (MetaKmsPlane     *plane,
 const char * meta_kms_plane_get_prop_name (MetaKmsPlane     *plane,
                                            MetaKmsPlaneProp  prop);
 
+MetaKmsPropType meta_kms_plane_get_prop_internal_type (MetaKmsPlane     *plane,
+                                                       MetaKmsPlaneProp  prop);
+
 #endif /* META_KMS_PLANE_PRIVATE_H */
diff --git a/src/backends/native/meta-kms-plane.c b/src/backends/native/meta-kms-plane.c
index 6e4add910f..73fab7d8f8 100644
--- a/src/backends/native/meta-kms-plane.c
+++ b/src/backends/native/meta-kms-plane.c
@@ -97,6 +97,13 @@ meta_kms_plane_get_prop_name (MetaKmsPlane     *plane,
   return plane->prop_table.props[prop].name;
 }
 
+MetaKmsPropType
+meta_kms_plane_get_prop_internal_type (MetaKmsPlane     *plane,
+                                       MetaKmsPlaneProp  prop)
+{
+  return plane->prop_table.props[prop].internal_type;
+}
+
 void
 meta_kms_plane_update_set_rotation (MetaKmsPlane           *plane,
                                     MetaKmsPlaneAssignment *plane_assignment,
@@ -389,21 +396,25 @@ init_properties (MetaKmsPlane            *plane,
         {
           .name = "SRC_X",
           .type = DRM_MODE_PROP_RANGE,
+          .internal_type = META_KMS_PROP_TYPE_FIXED_16,
         },
       [META_KMS_PLANE_PROP_SRC_Y] =
         {
           .name = "SRC_Y",
           .type = DRM_MODE_PROP_RANGE,
+          .internal_type = META_KMS_PROP_TYPE_FIXED_16,
         },
       [META_KMS_PLANE_PROP_SRC_W] =
         {
           .name = "SRC_W",
           .type = DRM_MODE_PROP_RANGE,
+          .internal_type = META_KMS_PROP_TYPE_FIXED_16,
         },
       [META_KMS_PLANE_PROP_SRC_H] =
         {
           .name = "SRC_H",
           .type = DRM_MODE_PROP_RANGE,
+          .internal_type = META_KMS_PROP_TYPE_FIXED_16,
         },
       [META_KMS_PLANE_PROP_CRTC_X] =
         {
diff --git a/src/backends/native/meta-kms-types.h b/src/backends/native/meta-kms-types.h
index 739aca7801..5786ff51fb 100644
--- a/src/backends/native/meta-kms-types.h
+++ b/src/backends/native/meta-kms-types.h
@@ -66,4 +66,10 @@ typedef enum _MetaKmsDeviceFlag
 
 typedef enum _MetaKmsPlaneType MetaKmsPlaneType;
 
+typedef enum _MetaKmsPropType
+{
+  META_KMS_PROP_TYPE_RAW = 0,
+  META_KMS_PROP_TYPE_FIXED_16,
+} MetaKmsPropType;
+
 #endif /* META_KMS_IMPL_TYPES_H */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]