[PATCH libdrm 5/8] modetest: support bitmask properties
Rob Clark
rob.clark at linaro.org
Tue Jun 5 11:06:31 PDT 2012
From: Rob Clark <rob at ti.com>
Add support to display bitmask properties.
Signed-off-by: Rob Clark <rob at ti.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
---
tests/modetest/modetest.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index ce57e65..dea271a 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -207,6 +207,8 @@ dump_prop(uint32_t prop_id, uint64_t value)
printf(" immutable");
if (prop->flags & DRM_MODE_PROP_ENUM)
printf(" enum");
+ if (prop->flags & DRM_MODE_PROP_BITMASK)
+ printf(" bitmask");
if (prop->flags & DRM_MODE_PROP_BLOB)
printf(" blob");
printf("\n");
@@ -224,6 +226,12 @@ dump_prop(uint32_t prop_id, uint64_t value)
printf(" %s=%llu", prop->enums[i].name,
prop->enums[i].value);
printf("\n");
+ } else if (prop->flags & DRM_MODE_PROP_BITMASK) {
+ printf("\t\tvalues:");
+ for (i = 0; i < prop->count_enums; i++)
+ printf(" %s=0x%llx", prop->enums[i].name,
+ (1LL << prop->enums[i].value));
+ printf("\n");
} else {
assert(prop->count_enums == 0);
}
--
1.7.9.5
More information about the dri-devel
mailing list