drm_hwcomposer: Fix bitmask property mask creation

Enum properties may have the flag DRM_MODE_PROP_BITMASK to indicate that
the enum values should be interpreted as bitshifts.

- Add a function DrmProperty::IsBitmask to check if this flag is set
- Check that this flag is set in DrmProperty::GetEnumMask
- Fix GetEnumMask to interpret the enum value as a bitshift

Fixes: da2fcf66 ("drm_hwcomposer: Simplify LayerTransform")
Change-Id: Ice50ac23344f508b6dee761a51879da99d848007
Signed-off-by: Drew Davenport <ddavenport@google.com>
diff --git a/drm/DrmProperty.cpp b/drm/DrmProperty.cpp
index 76fb4f9..8dc62f6 100644
--- a/drm/DrmProperty.cpp
+++ b/drm/DrmProperty.cpp
@@ -150,10 +150,15 @@
     return false;
   }
 
+  if (!IsBitmask()) {
+    ALOGE("Property %s is not a bitmask property.", name_.c_str());
+    return false;
+  }
+
   mask = 0;
 
   for (const auto &it : enums_) {
-    mask |= it.value;
+    mask |= (1 << it.value);
   }
 
   return true;