aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark2012-06-05 12:28:22 -0500
committerRob Clark2012-06-08 09:27:21 -0500
commit7b228e900f59cda3cafb60692be9dd7aced6ad96 (patch)
treea83fb716e3567ec9af83466a4de1b5241fc57c5f /xf86drmMode.c
parent86dece4cf2f7180b854fbd318fa1a57793f0deac (diff)
downloadexternal-libgbm-7b228e900f59cda3cafb60692be9dd7aced6ad96.tar.gz
external-libgbm-7b228e900f59cda3cafb60692be9dd7aced6ad96.tar.xz
external-libgbm-7b228e900f59cda3cafb60692be9dd7aced6ad96.zip
Add support for bitmask properties
A bitmask property is similar to an enum. The enum value is a bit position (0-63), and valid property values consist of a mask of zero or more of (1 << enum_val[n]). Signed-off-by: Rob Clark <rob@ti.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'xf86drmMode.c')
-rw-r--r--xf86drmMode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xf86drmMode.c b/xf86drmMode.c
index a60c7cb1..04fdf1ff 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -575,7 +575,7 @@ drmModePropertyPtr drmModeGetProperty(int fd, uint32_t property_id)
575 if (prop.count_values) 575 if (prop.count_values)
576 prop.values_ptr = VOID2U64(drmMalloc(prop.count_values * sizeof(uint64_t))); 576 prop.values_ptr = VOID2U64(drmMalloc(prop.count_values * sizeof(uint64_t)));
577 577
578 if (prop.count_enum_blobs && (prop.flags & DRM_MODE_PROP_ENUM)) 578 if (prop.count_enum_blobs && (prop.flags & (DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BITMASK)))
579 prop.enum_blob_ptr = VOID2U64(drmMalloc(prop.count_enum_blobs * sizeof(struct drm_mode_property_enum))); 579 prop.enum_blob_ptr = VOID2U64(drmMalloc(prop.count_enum_blobs * sizeof(struct drm_mode_property_enum)));
580 580
581 if (prop.count_enum_blobs && (prop.flags & DRM_MODE_PROP_BLOB)) { 581 if (prop.count_enum_blobs && (prop.flags & DRM_MODE_PROP_BLOB)) {
@@ -597,7 +597,7 @@ drmModePropertyPtr drmModeGetProperty(int fd, uint32_t property_id)
597 r->flags = prop.flags; 597 r->flags = prop.flags;
598 if (prop.count_values) 598 if (prop.count_values)
599 r->values = drmAllocCpy(U642VOID(prop.values_ptr), prop.count_values, sizeof(uint64_t)); 599 r->values = drmAllocCpy(U642VOID(prop.values_ptr), prop.count_values, sizeof(uint64_t));
600 if (prop.flags & DRM_MODE_PROP_ENUM) { 600 if (prop.flags & (DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BITMASK)) {
601 r->count_enums = prop.count_enum_blobs; 601 r->count_enums = prop.count_enum_blobs;
602 r->enums = drmAllocCpy(U642VOID(prop.enum_blob_ptr), prop.count_enum_blobs, sizeof(struct drm_mode_property_enum)); 602 r->enums = drmAllocCpy(U642VOID(prop.enum_blob_ptr), prop.count_enum_blobs, sizeof(struct drm_mode_property_enum));
603 } else if (prop.flags & DRM_MODE_PROP_BLOB) { 603 } else if (prop.flags & DRM_MODE_PROP_BLOB) {