summaryrefslogtreecommitdiffstats
path: root/include/drm/drm_crtc.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2014-05-30 11:34:01 -0400
committerDave Airlie <airlied@redhat.com>2014-06-04 13:22:53 +1000
commit5ea22f24d77b511d68c4ecaf4e6fd5d6ab462b8f (patch)
treee6c3287bee5fec51e3deb8b905c156926c6a8985 /include/drm/drm_crtc.h
parenta2b34e226ac9fbd20179091fad0ee1a24ad48669 (diff)
downloadop-kernel-dev-5ea22f24d77b511d68c4ecaf4e6fd5d6ab462b8f.zip
op-kernel-dev-5ea22f24d77b511d68c4ecaf4e6fd5d6ab462b8f.tar.gz
drm: add extended property types
If we continue to use bitmask for type, we will quickly run out of room to add new types. Split this up so existing part of bitmask range continues to function as before, but reserve a chunk of the remaining space for an integer type-id. Wrap this all up in some type-check helpers to keep the backwards-compat uglyness contained. Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm/drm_crtc.h')
-rw-r--r--include/drm/drm_crtc.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 90bd1a2..92f6ec2 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);
extern int drm_mode_connector_update_edid_property(struct drm_connector *connector,
struct edid *edid);
+
+static inline bool drm_property_type_is(struct drm_property *property,
+ uint32_t type)
+{
+ /* instanceof for props.. handles extended type vs original types: */
+ if (property->flags & DRM_MODE_PROP_EXTENDED_TYPE)
+ return (property->flags & DRM_MODE_PROP_EXTENDED_TYPE) == type;
+ return property->flags & type;
+}
+
+static inline bool drm_property_type_valid(struct drm_property *property)
+{
+ if (property->flags & DRM_MODE_PROP_EXTENDED_TYPE)
+ return !(property->flags & DRM_MODE_PROP_LEGACY_TYPE);
+ return !!(property->flags & DRM_MODE_PROP_LEGACY_TYPE);
+}
+
extern int drm_object_property_set_value(struct drm_mode_object *obj,
struct drm_property *property,
uint64_t val);
OpenPOWER on IntegriCloud