summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2012-09-12 22:22:31 -0500
committerDave Airlie <airlied@redhat.com>2014-06-04 13:23:11 +1000
commitebc44cf386734374983922c6fc1ae8ac47f88bef (patch)
tree84ce7743bac2ee1b2be5727792e65348a3499766 /include/drm
parent98f75de40e9d83c3a90d294b8fd25fa2874212a9 (diff)
drm: add signed-range property type
Like range, but values are signed. Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_crtc.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index cb2e599f769f..849cfdccff09 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -65,6 +65,15 @@ struct drm_object_properties {
uint64_t values[DRM_OBJECT_MAX_PROPERTY];
};
+static inline int64_t U642I64(uint64_t val)
+{
+ return (int64_t)*((int64_t *)&val);
+}
+static inline uint64_t I642U64(int64_t val)
+{
+ return (uint64_t)*((uint64_t *)&val);
+}
+
enum drm_connector_force {
DRM_FORCE_UNSPECIFIED,
DRM_FORCE_OFF,
@@ -982,6 +991,9 @@ struct drm_property *drm_property_create_bitmask(struct drm_device *dev,
struct drm_property *drm_property_create_range(struct drm_device *dev, int flags,
const char *name,
uint64_t min, uint64_t max);
+struct drm_property *drm_property_create_signed_range(struct drm_device *dev,
+ int flags, const char *name,
+ int64_t min, int64_t max);
struct drm_property *drm_property_create_object(struct drm_device *dev,
int flags, const char *name, uint32_t type);
extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property);