diff options
author | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-11-05 01:41:42 +0000 |
---|---|---|
committer | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-11-05 01:41:42 +0000 |
commit | 1cdd1b5ad204cb319174f86b522fcb0dc7968ed6 (patch) | |
tree | 208c78f58721f44168992cf88ae8d2b821f090de /services/surfaceflinger/DisplayHardware | |
parent | 5e78568dab3b1bbddd1cbc0dd2004d9c2ddbdfeb (diff) | |
parent | 3492a21877f93b2240dc823392b7e8adb2e1809e (diff) | |
download | frameworks_native-1cdd1b5ad204cb319174f86b522fcb0dc7968ed6.zip frameworks_native-1cdd1b5ad204cb319174f86b522fcb0dc7968ed6.tar.gz frameworks_native-1cdd1b5ad204cb319174f86b522fcb0dc7968ed6.tar.bz2 |
Merge tag 'android-6.0.0_r26' into HEAD
Android 6.0.0 release 26
Conflicts:
include/android/input.h
Change-Id: Ifa374c6d3055be3b8a5d60967f8b4c0043da739b
Diffstat (limited to 'services/surfaceflinger/DisplayHardware')
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.cpp | 27 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.h | 1 |
2 files changed, 25 insertions, 3 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 5bdcd7f..c57dd5f 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -341,10 +341,20 @@ static const uint32_t DISPLAY_ATTRIBUTES[] = { HWC_DISPLAY_HEIGHT, HWC_DISPLAY_DPI_X, HWC_DISPLAY_DPI_Y, + HWC_DISPLAY_COLOR_TRANSFORM, HWC_DISPLAY_NO_ATTRIBUTE, }; #define NUM_DISPLAY_ATTRIBUTES (sizeof(DISPLAY_ATTRIBUTES) / sizeof(DISPLAY_ATTRIBUTES)[0]) +static const uint32_t PRE_HWC15_DISPLAY_ATTRIBUTES[] = { + HWC_DISPLAY_VSYNC_PERIOD, + HWC_DISPLAY_WIDTH, + HWC_DISPLAY_HEIGHT, + HWC_DISPLAY_DPI_X, + HWC_DISPLAY_DPI_Y, + HWC_DISPLAY_NO_ATTRIBUTE, +}; + status_t HWComposer::queryDisplayProperties(int disp) { LOG_ALWAYS_FATAL_IF(!mHwc || !hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1)); @@ -372,6 +382,12 @@ status_t HWComposer::queryDisplayProperties(int disp) { for (size_t c = 0; c < numConfigs; ++c) { err = mHwc->getDisplayAttributes(mHwc, disp, configs[c], DISPLAY_ATTRIBUTES, values); + // If this is a pre-1.5 HWC, it may not know about color transform, so + // try again with a smaller set of attributes + if (err != NO_ERROR) { + err = mHwc->getDisplayAttributes(mHwc, disp, configs[c], + PRE_HWC15_DISPLAY_ATTRIBUTES, values); + } if (err != NO_ERROR) { // we can't get this display's info. turn it off. mDisplayData[disp].connected = false; @@ -396,6 +412,9 @@ status_t HWComposer::queryDisplayProperties(int disp) { case HWC_DISPLAY_DPI_Y: config.ydpi = values[i] / 1000.0f; break; + case HWC_DISPLAY_COLOR_TRANSFORM: + config.colorTransform = values[i]; + break; default: ALOG_ASSERT(false, "unknown display attribute[%zu] %#x", i, DISPLAY_ATTRIBUTES[i]); @@ -1195,9 +1214,11 @@ void HWComposer::dump(String8& result) const { result.appendFormat(" Display[%zd] configurations (* current):\n", i); for (size_t c = 0; c < disp.configs.size(); ++c) { const DisplayConfig& config(disp.configs[c]); - result.appendFormat(" %s%zd: %ux%u, xdpi=%f, ydpi=%f, refresh=%" PRId64 "\n", - c == disp.currentConfig ? "* " : "", c, config.width, config.height, - config.xdpi, config.ydpi, config.refresh); + result.appendFormat(" %s%zd: %ux%u, xdpi=%f, ydpi=%f" + ", refresh=%" PRId64 ", colorTransform=%d\n", + c == disp.currentConfig ? "* " : "", c, + config.width, config.height, config.xdpi, config.ydpi, + config.refresh, config.colorTransform); } if (disp.list) { diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h index ea9a208..862288f 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.h +++ b/services/surfaceflinger/DisplayHardware/HWComposer.h @@ -264,6 +264,7 @@ public: float xdpi; float ydpi; nsecs_t refresh; + int colorTransform; }; // Query display parameters. Pass in a display index (e.g. |