OSDN Git Service

drm_hwcomposer: Add blob property type
authorSean Paul <seanpaul@chromium.org>
Wed, 8 Jul 2015 14:43:54 +0000 (10:43 -0400)
committerSean Paul <seanpaul@chromium.org>
Wed, 8 Jul 2015 14:45:06 +0000 (10:45 -0400)
The blob property type doesn't use the values_ vector, instead
just storing the blob id directly in value_.

Change-Id: Ibde7c64cb7fe515ece9e9f396866de2da518707f
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drmproperty.cpp
drmproperty.h

index 6dca12e..378e3a2 100644 (file)
@@ -69,6 +69,9 @@ void DrmProperty::Init(drmModePropertyPtr p, uint64_t value) {
     type_ = DRM_PROPERTY_TYPE_ENUM;
   else if (flags_ & DRM_MODE_PROP_OBJECT)
     type_ = DRM_PROPERTY_TYPE_OBJECT;
+  else if (flags_ & DRM_MODE_PROP_BLOB)
+    type_ = DRM_PROPERTY_TYPE_BLOB;
+
 }
 
 uint32_t DrmProperty::id() const {
@@ -80,6 +83,11 @@ std::string DrmProperty::name() const {
 }
 
 int DrmProperty::value(uint64_t *value) const {
+  if (type_ == DRM_PROPERTY_TYPE_BLOB) {
+    *value = value_;
+    return 0;
+  }
+
   if (values_.size() == 0)
     return -ENOENT;
 
index a60ade3..96e8c20 100644 (file)
@@ -28,6 +28,7 @@ enum DrmPropertyType {
   DRM_PROPERTY_TYPE_INT,
   DRM_PROPERTY_TYPE_ENUM,
   DRM_PROPERTY_TYPE_OBJECT,
+  DRM_PROPERTY_TYPE_BLOB,
   DRM_PROPERTY_TYPE_INVALID,
 };