summaryrefslogtreecommitdiff
path: root/tests/modetest
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2013-10-12 12:16:44 -0400
committerRob Clark <robclark@freedesktop.org>2014-11-24 19:56:50 -0500
commitfb4177046de19730a784c3c16e4b73aab0ec6e41 (patch)
tree7801e10d14aa85d38b94fd868b7124587f22ad28 /tests/modetest
parentc2c0346e1f5ddec4f6497d7c6359157c5f32d442 (diff)
update signed/object prop types
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'tests/modetest')
-rw-r--r--tests/modetest/modetest.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index bee1a36b..d3252b64 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -116,6 +116,10 @@ struct device {
};
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+static inline int64_t U642I64(uint64_t val)
+{
+ return (int64_t)*((int64_t *)&val);
+}
struct type_name {
int type;
@@ -296,32 +300,43 @@ static void dump_prop(struct device *dev, drmModePropertyPtr prop,
printf("\t\tflags:");
if (prop->flags & DRM_MODE_PROP_PENDING)
printf(" pending");
- if (prop->flags & DRM_MODE_PROP_RANGE)
- printf(" range");
if (prop->flags & DRM_MODE_PROP_IMMUTABLE)
printf(" immutable");
- if (prop->flags & DRM_MODE_PROP_ENUM)
+ if (drm_property_type_is(prop, DRM_MODE_PROP_SIGNED_RANGE))
+ printf(" signed range");
+ if (drm_property_type_is(prop, DRM_MODE_PROP_RANGE))
+ printf(" range");
+ if (drm_property_type_is(prop, DRM_MODE_PROP_ENUM))
printf(" enum");
- if (prop->flags & DRM_MODE_PROP_BITMASK)
+ if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK))
printf(" bitmask");
- if (prop->flags & DRM_MODE_PROP_BLOB)
+ if (drm_property_type_is(prop, DRM_MODE_PROP_BLOB))
printf(" blob");
+ if (drm_property_type_is(prop, DRM_MODE_PROP_OBJECT))
+ printf(" object");
printf("\n");
- if (prop->flags & DRM_MODE_PROP_RANGE) {
+ if (drm_property_type_is(prop, DRM_MODE_PROP_SIGNED_RANGE)) {
+ printf("\t\tvalues:");
+ for (i = 0; i < prop->count_values; i++)
+ printf(" %"PRId64, U642I64(prop->values[i]));
+ printf("\n");
+ }
+
+ if (drm_property_type_is(prop, DRM_MODE_PROP_RANGE)) {
printf("\t\tvalues:");
for (i = 0; i < prop->count_values; i++)
printf(" %"PRIu64, prop->values[i]);
printf("\n");
}
- if (prop->flags & DRM_MODE_PROP_ENUM) {
+ if (drm_property_type_is(prop, DRM_MODE_PROP_ENUM)) {
printf("\t\tenums:");
for (i = 0; i < prop->count_enums; i++)
printf(" %s=%llu", prop->enums[i].name,
prop->enums[i].value);
printf("\n");
- } else if (prop->flags & DRM_MODE_PROP_BITMASK) {
+ } else if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK)) {
printf("\t\tvalues:");
for (i = 0; i < prop->count_enums; i++)
printf(" %s=0x%llx", prop->enums[i].name,
@@ -331,7 +346,7 @@ static void dump_prop(struct device *dev, drmModePropertyPtr prop,
assert(prop->count_enums == 0);
}
- if (prop->flags & DRM_MODE_PROP_BLOB) {
+ if (drm_property_type_is(prop, DRM_MODE_PROP_BLOB)) {
printf("\t\tblobs:\n");
for (i = 0; i < prop->count_blobs; i++)
dump_blob(dev, prop->blob_ids[i]);
@@ -341,7 +356,7 @@ static void dump_prop(struct device *dev, drmModePropertyPtr prop,
}
printf("\t\tvalue:");
- if (prop->flags & DRM_MODE_PROP_BLOB)
+ if (drm_property_type_is(prop, DRM_MODE_PROP_BLOB))
dump_blob(dev, value);
else
printf(" %"PRIu64"\n", value);