kms: Add an internal MetaKmsPropType to distinguish fixed point values

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1923>
This commit is contained in:
Daniel van Vugt 2021-07-13 14:01:32 +08:00
parent c5c7982e33
commit ea75ea0b73
4 changed files with 21 additions and 0 deletions

View File

@ -48,6 +48,7 @@ struct _MetaKmsProp
{ {
const char *name; const char *name;
uint32_t type; uint32_t type;
MetaKmsPropType internal_type;
void (* parse) (MetaKmsImplDevice *impl_device, void (* parse) (MetaKmsImplDevice *impl_device,
MetaKmsProp *prop, MetaKmsProp *prop,
drmModePropertyPtr drm_prop, drmModePropertyPtr drm_prop,

View File

@ -58,4 +58,7 @@ uint32_t meta_kms_plane_get_prop_id (MetaKmsPlane *plane,
const char * meta_kms_plane_get_prop_name (MetaKmsPlane *plane, const char * meta_kms_plane_get_prop_name (MetaKmsPlane *plane,
MetaKmsPlaneProp prop); MetaKmsPlaneProp prop);
MetaKmsPropType meta_kms_plane_get_prop_internal_type (MetaKmsPlane *plane,
MetaKmsPlaneProp prop);
#endif /* META_KMS_PLANE_PRIVATE_H */ #endif /* META_KMS_PLANE_PRIVATE_H */

View File

@ -97,6 +97,13 @@ meta_kms_plane_get_prop_name (MetaKmsPlane *plane,
return plane->prop_table.props[prop].name; 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 void
meta_kms_plane_update_set_rotation (MetaKmsPlane *plane, meta_kms_plane_update_set_rotation (MetaKmsPlane *plane,
MetaKmsPlaneAssignment *plane_assignment, MetaKmsPlaneAssignment *plane_assignment,
@ -389,21 +396,25 @@ init_properties (MetaKmsPlane *plane,
{ {
.name = "SRC_X", .name = "SRC_X",
.type = DRM_MODE_PROP_RANGE, .type = DRM_MODE_PROP_RANGE,
.internal_type = META_KMS_PROP_TYPE_FIXED_16,
}, },
[META_KMS_PLANE_PROP_SRC_Y] = [META_KMS_PLANE_PROP_SRC_Y] =
{ {
.name = "SRC_Y", .name = "SRC_Y",
.type = DRM_MODE_PROP_RANGE, .type = DRM_MODE_PROP_RANGE,
.internal_type = META_KMS_PROP_TYPE_FIXED_16,
}, },
[META_KMS_PLANE_PROP_SRC_W] = [META_KMS_PLANE_PROP_SRC_W] =
{ {
.name = "SRC_W", .name = "SRC_W",
.type = DRM_MODE_PROP_RANGE, .type = DRM_MODE_PROP_RANGE,
.internal_type = META_KMS_PROP_TYPE_FIXED_16,
}, },
[META_KMS_PLANE_PROP_SRC_H] = [META_KMS_PLANE_PROP_SRC_H] =
{ {
.name = "SRC_H", .name = "SRC_H",
.type = DRM_MODE_PROP_RANGE, .type = DRM_MODE_PROP_RANGE,
.internal_type = META_KMS_PROP_TYPE_FIXED_16,
}, },
[META_KMS_PLANE_PROP_CRTC_X] = [META_KMS_PLANE_PROP_CRTC_X] =
{ {

View File

@ -66,4 +66,10 @@ typedef enum _MetaKmsDeviceFlag
typedef enum _MetaKmsPlaneType MetaKmsPlaneType; 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 */ #endif /* META_KMS_IMPL_TYPES_H */