summaryrefslogtreecommitdiff
path: root/drmconnector.cpp
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2015-06-03 14:08:27 -0400
committerSean Paul <seanpaul@chromium.org>2015-06-15 16:30:48 -0400
commit877be974a2d4fc518700be8ffe803a50cb716ead (patch)
treefd3bb735012580ddaf2edf31ffd31b1083bb6117 /drmconnector.cpp
parent1f4ff5aec7bec305558228adb65ba56bd0b9f366 (diff)
drm_hwcomposer: Use atomic modeset to set crtc timing
Use the new drm blob ioctl and atomic modeset properties to do atomic modesetting, as opposed to the old setCrtc call. This allows us to set timing as soon as the system layer requests a new active config, as opposed to delaying it until we have an fb. Aside from reducing complexity, this should help with event control requests as we'll be able to service them with hw vblanks instead of synthesized sleeps. Change-Id: I9c80d44f52f52881a3a25b2ae518973d468bc110 Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drmconnector.cpp')
-rw-r--r--drmconnector.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/drmconnector.cpp b/drmconnector.cpp
index 44864b9..7e9b0c1 100644
--- a/drmconnector.cpp
+++ b/drmconnector.cpp
@@ -50,6 +50,11 @@ int DrmConnector::Init() {
ALOGE("Could not get DPMS property\n");
return ret;
}
+ ret = drm_->GetConnectorProperty(*this, "CRTC_ID", &crtc_id_property_);
+ if (ret) {
+ ALOGE("Could not get CRTC_ID property\n");
+ return ret;
+ }
return 0;
}
@@ -105,21 +110,18 @@ const DrmMode &DrmConnector::active_mode() const {
return active_mode_;
}
-int DrmConnector::set_active_mode(uint32_t mode_id) {
- for (std::vector<DrmMode>::const_iterator iter = modes_.begin();
- iter != modes_.end(); ++iter) {
- if (iter->id() == mode_id) {
- active_mode_ = *iter;
- return 0;
- }
- }
- return -ENOENT;
+void DrmConnector::set_active_mode(const DrmMode &mode) {
+ active_mode_ = mode;
}
const DrmProperty &DrmConnector::dpms_property() const {
return dpms_property_;
}
+const DrmProperty &DrmConnector::crtc_id_property() const {
+ return crtc_id_property_;
+}
+
DrmConnector::ModeIter DrmConnector::begin_modes() const {
return modes_.begin();
}