diff options
author | Sean Paul <seanpaul@chromium.org> | 2015-07-08 10:43:54 -0400 |
---|---|---|
committer | Sean Paul <seanpaul@chromium.org> | 2015-07-08 10:45:06 -0400 |
commit | 85c58c63ff707874d62e7b088e5ed439b8724d6f (patch) | |
tree | 290a09a3e0cd90d71979621ad1d74e33d6e39b10 | |
parent | be98c8cb94511d374238e4a02c92b545b6e5fde2 (diff) | |
download | drm_hwcomposer-85c58c63ff707874d62e7b088e5ed439b8724d6f.tar.gz |
drm_hwcomposer: Add blob property type
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>
-rw-r--r-- | drmproperty.cpp | 8 | ||||
-rw-r--r-- | drmproperty.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drmproperty.cpp b/drmproperty.cpp index 6dca12e..378e3a2 100644 --- a/drmproperty.cpp +++ b/drmproperty.cpp @@ -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; diff --git a/drmproperty.h b/drmproperty.h index a60ade3..96e8c20 100644 --- a/drmproperty.h +++ b/drmproperty.h @@ -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, }; |