Pass display arg to blank/unblank
This allows us to blank and unblank displays other than the built-in
display (e.g. HDMI).
Bug: 7240511
Change-Id: I89ea13f9e497be74c3e1231d0c62fb558e93e0f8
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index 987cc64..960fb0e 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -646,17 +646,19 @@
return (status_t)err;
}
-status_t HWComposer::release() const {
+status_t HWComposer::release(int disp) const {
+ LOG_FATAL_IF(disp >= HWC_NUM_DISPLAY_TYPES);
if (mHwc) {
- mHwc->eventControl(mHwc, HWC_DISPLAY_PRIMARY, HWC_EVENT_VSYNC, 0);
- return (status_t)mHwc->blank(mHwc, 0, 1);
+ mHwc->eventControl(mHwc, disp, HWC_EVENT_VSYNC, 0);
+ return (status_t)mHwc->blank(mHwc, disp, 1);
}
return NO_ERROR;
}
-status_t HWComposer::acquire() const {
+status_t HWComposer::acquire(int disp) const {
+ LOG_FATAL_IF(disp >= HWC_NUM_DISPLAY_TYPES);
if (mHwc) {
- return (status_t)mHwc->blank(mHwc, 0, 0);
+ return (status_t)mHwc->blank(mHwc, disp, 0);
}
return NO_ERROR;
}
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h
index 8f66651..633ca9c 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.h
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.h
@@ -92,10 +92,10 @@
status_t commit();
// release hardware resources and blank screen
- status_t release() const;
+ status_t release(int disp) const;
// acquire hardware resources and unblank screen
- status_t acquire() const;
+ status_t acquire(int disp) const;
// create a work list for numLayers layer. sets HWC_GEOMETRY_CHANGED.
status_t createWorkList(int32_t id, size_t numLayers);