drm_hwcomposer: Add DRM_CURSOR_CAP to DrmDevice
This change reads the DRM_CURSOR_CAP_{WIDTH|HEIGHT} capabilities of
DrmDevice, and exposes their values. These values can be used to
convey a reasonable cursor plane size [1].
[1] https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#c.DRM_CAP_CURSOR_WIDTH
Change-Id: Iecf01d00a9562656c6d5b5aa8e0ac49b1dc739e5
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
diff --git a/drm/DrmDevice.h b/drm/DrmDevice.h
index baa719d..ac20855 100644
--- a/drm/DrmDevice.h
+++ b/drm/DrmDevice.h
@@ -106,6 +106,10 @@
int GetProperty(uint32_t obj_id, uint32_t obj_type, const char *prop_name,
DrmProperty *property) const;
+ const std::optional<std::pair<uint64_t, uint64_t>> &GetCapCursorSize() const {
+ return cap_cursor_size_;
+ }
+
private:
explicit DrmDevice(ResourceManager *res_man, uint32_t index);
auto Init(const char *path) -> int;
@@ -123,6 +127,7 @@
std::pair<uint32_t, uint32_t> min_resolution_;
std::pair<uint32_t, uint32_t> max_resolution_;
+ std::optional<std::pair<uint64_t, uint64_t>> cap_cursor_size_;
bool HasAddFb2ModifiersSupport_{};
@@ -130,4 +135,5 @@
ResourceManager *const res_man_;
};
+
} // namespace android