xf86drmMode: introduce drmModeGetPropertyType
authorSimon Ser <contact@emersion.fr>
Thu, 25 Feb 2021 11:19:43 +0000 (12:19 +0100)
committerSimon Ser <contact@emersion.fr>
Wed, 31 Mar 2021 07:42:15 +0000 (07:42 +0000)
We already have drm_property_type_is, but it's needlessly complicated
and doesn't cover all use-cases (requires the caller to provide a
type).

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
xf86drmMode.h

index 7269678..4bde6e3 100644 (file)
@@ -151,6 +151,11 @@ static __inline int drm_property_type_is(drmModePropertyPtr property,
        return property->flags & type;
 }
 
+static inline uint32_t drmModeGetPropertyType(const drmModePropertyRes *prop)
+{
+       return prop->flags & (DRM_MODE_PROP_LEGACY_TYPE | DRM_MODE_PROP_EXTENDED_TYPE);
+}
+
 typedef struct _drmModeCrtc {
        uint32_t crtc_id;
        uint32_t buffer_id; /**< FB id to connect to 0 = disconnect */