surfaceflinger: call into hardware composer to blank screen
Call into the new HWC blank operation to blank or unblank the screen.
Legacy systems may have already blanked the screen via early suspend,
and can choose to not implement the blank operation in their hardware
composer implementation.
Change-Id: Ib403c8c0e36367a2cfef3e1d124872fcfeb9e7cb
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index 4ed692f..122be5e 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -286,11 +286,33 @@
mHwc->methods->eventControl(mHwc, HWC_EVENT_VSYNC, 0);
}
int err = mHwc->set(mHwc, NULL, NULL, NULL);
+ if (err < 0) {
+ return (status_t)err;
+ }
+
+ if (hwcHasVersion(mHwc, HWC_DEVICE_API_VERSION_1_0)) {
+ if (mHwc->methods && mHwc->methods->blank) {
+ err = mHwc->methods->blank(mHwc, 1);
+ }
+ }
return (status_t)err;
}
return NO_ERROR;
}
+status_t HWComposer::acquire() const {
+ if (mHwc) {
+ if (hwcHasVersion(mHwc, HWC_DEVICE_API_VERSION_1_0)) {
+ if (mHwc->methods && mHwc->methods->blank) {
+ int err = mHwc->methods->blank(mHwc, 0);
+ return (status_t)err;
+ }
+ }
+ }
+
+ return NO_ERROR;
+}
+
status_t HWComposer::disable() {
if (mHwc) {
free(mList);