summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/DisplayHardware
diff options
context:
space:
mode:
authorMichael Lentine <mlentine@google.com>2014-07-14 13:48:55 -0700
committerMichael Lentine <mlentine@google.com>2014-07-29 16:56:30 +0000
commit6c9e34a98a63033b80bd1c24c7aa1304f912f10a (patch)
treec8cbcd3fcec54a08adbca574991fbd157fcb87c0 /services/surfaceflinger/DisplayHardware
parent03414a1cfe6c1222fd7723949bd622f9cba145aa (diff)
downloadframeworks_native-6c9e34a98a63033b80bd1c24c7aa1304f912f10a.zip
frameworks_native-6c9e34a98a63033b80bd1c24c7aa1304f912f10a.tar.gz
frameworks_native-6c9e34a98a63033b80bd1c24c7aa1304f912f10a.tar.bz2
Modified SurfaceFlinger to implment setActiveConfig and getActiveConfig.
This can be used to change the current display mode of the device. Change-Id: Icdc3fb58389b861dc77b68102083da6f7a96eccb Tested: None (cherry picked from commit 2651fa94635a96d653038fb389a0dd827338f8d3)
Diffstat (limited to 'services/surfaceflinger/DisplayHardware')
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.cpp10
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index a8fb5bd..5e3fe92 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -778,6 +778,16 @@ status_t HWComposer::setPowerMode(int disp, int mode) {
return NO_ERROR;
}
+status_t HWComposer::setActiveConfig(int disp, int mode) {
+ LOG_FATAL_IF(disp >= VIRTUAL_DISPLAY_ID_BASE);
+ if (mHwc && hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_4)) {
+ return (status_t)mHwc->setActiveConfig(mHwc, disp, mode);
+ } else {
+ LOG_FATAL_IF(mode != 0);
+ }
+ return NO_ERROR;
+}
+
void HWComposer::disconnectDisplay(int disp) {
LOG_ALWAYS_FATAL_IF(disp < 0 || disp == HWC_DISPLAY_PRIMARY);
DisplayData& dd(mDisplayData[disp]);
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h
index 9bd99eb..5cb56a0 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.h
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.h
@@ -100,6 +100,9 @@ public:
// set power mode
status_t setPowerMode(int disp, int mode);
+ // set active config
+ status_t setActiveConfig(int disp, int mode);
+
// reset state when an external, non-virtual display is disconnected
void disconnectDisplay(int disp);