modetest: support bitmask properties
authorRob Clark <rob@ti.com>
Tue, 5 Jun 2012 17:28:38 +0000 (12:28 -0500)
committerRob Clark <rob@ti.com>
Fri, 8 Jun 2012 14:27:21 +0000 (09:27 -0500)
Add support to display bitmask properties.

Signed-off-by: Rob Clark <rob@ti.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
tests/modetest/modetest.c

index ce57e65d0725ab80479bd604fbd3c57f59dd3459..dea271a43863cfc30b51d371f018f5b94d4bc51c 100644 (file)
@@ -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);
        }