summaryrefslogtreecommitdiff
path: root/drmdisplaycomposition.cpp
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2015-09-19 09:14:34 -0400
committerSean Paul <seanpaul@chromium.org>2015-10-01 14:11:24 -0400
commit573554106db499d323bea12ff00363b1816f8c8a (patch)
treed9f5fe8cace780a4c44fb964474ca9f9560663b9 /drmdisplaycomposition.cpp
parent7acc59be7f12ad45b9abfa56c2d21726edf6224e (diff)
downloaddrm_hwcomposer-573554106db499d323bea12ff00363b1816f8c8a.tar.gz
drm_hwcomposer-573554106db499d323bea12ff00363b1816f8c8a.tar.xz
drm_hwcomposer: Process modesets via compositor
This patch queues modeset in the compositor for application on the next frame. This allows us to perform the modeset atomically with the first frame that comes in after the mode is changed. Change-Id: I6bb9edd17bbdd6dbee5c0474f2e43599781cc7a7 Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drmdisplaycomposition.cpp')
-rw-r--r--drmdisplaycomposition.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/drmdisplaycomposition.cpp b/drmdisplaycomposition.cpp
index 457fb5a..d47b5dc 100644
--- a/drmdisplaycomposition.cpp
+++ b/drmdisplaycomposition.cpp
@@ -231,6 +231,15 @@ int DrmDisplayComposition::SetDpmsMode(uint32_t dpms_mode) {
return 0;
}
+int DrmDisplayComposition::SetDisplayMode(const DrmMode &display_mode) {
+ if (!validate_composition_type(DRM_COMPOSITION_TYPE_MODESET))
+ return -EINVAL;
+ display_mode_ = display_mode;
+ dpms_mode_ = DRM_MODE_DPMS_ON;
+ type_ = DRM_COMPOSITION_TYPE_MODESET;
+ return 0;
+}
+
int DrmDisplayComposition::AddPlaneDisable(DrmPlane *plane) {
layers_.emplace_back();
DrmCompositionLayer &c_layer = layers_.back();
@@ -271,6 +280,10 @@ uint64_t DrmDisplayComposition::frame_no() const {
return frame_no_;
}
+const DrmMode &DrmDisplayComposition::display_mode() const {
+ return display_mode_;
+}
+
Importer *DrmDisplayComposition::importer() const {
return importer_;
}