diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/drm/drm_crtc.h | 17 | ||||
| -rw-r--r-- | include/uapi/drm/drm_mode.h | 13 |
2 files changed, 30 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 90bd1a25e2c6..92f6ec2de86a 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
| @@ -930,6 +930,23 @@ extern void drm_mode_config_cleanup(struct drm_device *dev); | |||
| 930 | 930 | ||
| 931 | extern int drm_mode_connector_update_edid_property(struct drm_connector *connector, | 931 | extern int drm_mode_connector_update_edid_property(struct drm_connector *connector, |
| 932 | struct edid *edid); | 932 | struct edid *edid); |
| 933 | |||
| 934 | static inline bool drm_property_type_is(struct drm_property *property, | ||
| 935 | uint32_t type) | ||
| 936 | { | ||
| 937 | /* instanceof for props.. handles extended type vs original types: */ | ||
| 938 | if (property->flags & DRM_MODE_PROP_EXTENDED_TYPE) | ||
| 939 | return (property->flags & DRM_MODE_PROP_EXTENDED_TYPE) == type; | ||
| 940 | return property->flags & type; | ||
| 941 | } | ||
| 942 | |||
| 943 | static inline bool drm_property_type_valid(struct drm_property *property) | ||
| 944 | { | ||
| 945 | if (property->flags & DRM_MODE_PROP_EXTENDED_TYPE) | ||
| 946 | return !(property->flags & DRM_MODE_PROP_LEGACY_TYPE); | ||
| 947 | return !!(property->flags & DRM_MODE_PROP_LEGACY_TYPE); | ||
| 948 | } | ||
| 949 | |||
| 933 | extern int drm_object_property_set_value(struct drm_mode_object *obj, | 950 | extern int drm_object_property_set_value(struct drm_mode_object *obj, |
| 934 | struct drm_property *property, | 951 | struct drm_property *property, |
| 935 | uint64_t val); | 952 | uint64_t val); |
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 719add464f95..caeaa6f7ebde 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h | |||
| @@ -252,6 +252,19 @@ struct drm_mode_get_connector { | |||
| 252 | #define DRM_MODE_PROP_BLOB (1<<4) | 252 | #define DRM_MODE_PROP_BLOB (1<<4) |
| 253 | #define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ | 253 | #define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ |
| 254 | 254 | ||
| 255 | /* non-extended types: legacy bitmask, one bit per type: */ | ||
| 256 | #define DRM_MODE_PROP_LEGACY_TYPE ( \ | ||
| 257 | DRM_MODE_PROP_RANGE | \ | ||
| 258 | DRM_MODE_PROP_ENUM | \ | ||
| 259 | DRM_MODE_PROP_BLOB | \ | ||
| 260 | DRM_MODE_PROP_BITMASK) | ||
| 261 | |||
| 262 | /* extended-types: rather than continue to consume a bit per type, | ||
| 263 | * grab a chunk of the bits to use as integer type id. | ||
| 264 | */ | ||
| 265 | #define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 | ||
| 266 | #define DRM_MODE_PROP_TYPE(n) ((n) << 6) | ||
| 267 | |||
| 255 | struct drm_mode_property_enum { | 268 | struct drm_mode_property_enum { |
| 256 | __u64 value; | 269 | __u64 value; |
| 257 | char name[DRM_PROP_NAME_LEN]; | 270 | char name[DRM_PROP_NAME_LEN]; |
