drm_hwcomposer: Process DPMS requests through compositor
This patch changes the behavior of DPMS in hwcomposer from
applying asynchronously/immediately, to queuing in the
compositor and being processed in order. This is desirable
for a couple of reasons:
1- It ensures all frames set before set_power_mode are
shown on the screen before it turns off
2- We make sure we don't rmfb a framebuffer that is
currently applied to a disabled crtc.
The second reason above can cause the display to turn back
off once it's on since the fb will dereference to zero in
the kernel and it will disable the pipe without notifying
us.
Change-Id: I2aab9ee0353b12fecced46766ed2dbb64f0aef4b
Signed-off-by: Sean Paul <seanpaul@chromium.org>
diff --git a/drmdisplaycomposition.h b/drmdisplaycomposition.h
index bc8cf2e..2ae696f 100644
--- a/drmdisplaycomposition.h
+++ b/drmdisplaycomposition.h
@@ -31,6 +31,7 @@
enum DrmCompositionType {
DRM_COMPOSITION_TYPE_EMPTY,
DRM_COMPOSITION_TYPE_FRAME,
+ DRM_COMPOSITION_TYPE_DPMS,
};
typedef struct DrmCompositionLayer {
@@ -55,10 +56,12 @@
int AddLayer(hwc_layer_1_t *layer, hwc_drm_bo_t *bo, DrmCrtc *crtc,
DrmPlane *plane);
+ int AddDpmsMode(uint32_t dpms_mode);
int FinishComposition();
DrmCompositionLayerVector_t *GetCompositionLayers();
+ uint32_t dpms_mode() const;
private:
DrmDisplayComposition(const DrmDisplayComposition &) = delete;
@@ -74,6 +77,7 @@
int timeline_;
DrmCompositionLayerVector_t layers_;
+ uint32_t dpms_mode_;
};
}