summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2016-02-10 15:35:17 -0800
committerRobert Foss <robert.foss@collabora.com>2017-02-28 13:53:06 -0500
commit406dbfc4c7c9ae5a5d669c6cec00394fcc9bfa87 (patch)
tree26d7cfee51d57fd752fc994391dda7d89a44c669
parenta5df1defa12bc38ed2e5c9cb2fdef85fe7ea0cd7 (diff)
downloaddrm_hwcomposer-406dbfc4c7c9ae5a5d669c6cec00394fcc9bfa87.tar.gz
drm_hwcomposer-406dbfc4c7c9ae5a5d669c6cec00394fcc9bfa87.tar.xz
drm_hwcomposer: Harvest min/max resolutions from drm
Store the minimum and maximum resolutions from drm in DrmResources BUG=None TEST=None Change-Id: I21b9a3fc5f220585295733cc754fe0f6df0abae9 Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Robert Foss <robert.foss@collabora.com>
-rw-r--r--drmresources.cpp5
-rw-r--r--drmresources.h11
2 files changed, 16 insertions, 0 deletions
diff --git a/drmresources.cpp b/drmresources.cpp
index e433239..6b8ed03 100644
--- a/drmresources.cpp
+++ b/drmresources.cpp
@@ -71,6 +71,11 @@ int DrmResources::Init() {
return -ENODEV;
}
+ min_resolution_ =
+ std::pair<uint32_t, uint32_t>(res->min_width, res->min_height);
+ max_resolution_ =
+ std::pair<uint32_t, uint32_t>(res->max_width, res->max_height);
+
bool found_primary = false;
int display_num = 1;
diff --git a/drmresources.h b/drmresources.h
index 64e6b57..011f87e 100644
--- a/drmresources.h
+++ b/drmresources.h
@@ -47,6 +47,14 @@ class DrmResources {
return planes_;
}
+ std::pair<uint32_t, uint32_t> min_resolution() const {
+ return min_resolution_;
+ }
+
+ std::pair<uint32_t, uint32_t> max_resolution() const {
+ return max_resolution_;
+ }
+
DrmConnector *GetConnectorForDisplay(int display) const;
DrmCrtc *GetCrtcForDisplay(int display) const;
DrmPlane *GetPlane(uint32_t id) const;
@@ -83,6 +91,9 @@ class DrmResources {
std::vector<std::unique_ptr<DrmPlane>> planes_;
DrmCompositor compositor_;
DrmEventListener event_listener_;
+
+ std::pair<uint32_t, uint32_t> min_resolution_;
+ std::pair<uint32_t, uint32_t> max_resolution_;
};
}