drm_hwcomposer: Add blob support to DrmProperty
This changes adds support for accessing blob data of DrmProperties with
type casting. When invoked, the data corresponding to the blob id
indicated by the property value is read from the device, and returned
as a vector with the provided template typing.
This change adds the fd as an additional init parameter for DrmProperty,
which is required in order to read the blob data.
Change-Id: I9531d0e7e2f13a4fd2840564783859d1dec1efd5
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
diff --git a/drm/DrmDevice.cpp b/drm/DrmDevice.cpp
index 6fd5c0c..fa5849f 100644
--- a/drm/DrmDevice.cpp
+++ b/drm/DrmDevice.cpp
@@ -200,7 +200,7 @@
drmModePropertyPtr p = drmModeGetProperty(*GetFd(), props->props[i]);
if (strcmp(p->name, prop_name) == 0) {
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
- property->Init(obj_id, p, props->prop_values[i]);
+ property->Init(GetFd(), obj_id, p, props->prop_values[i]);
found = true;
}
drmModeFreeProperty(p);