diff options
author | TreeHugger Robot | 2017-08-02 13:35:41 -0500 |
---|---|---|
committer | Android (Google) Code Review | 2017-08-02 13:35:41 -0500 |
commit | ddd9c712727881acbedec8a66535ab31fa2a5b4f (patch) | |
tree | 3923fe3132b19051013550bdf1f8d3fe4d31e80c /services/surfaceflinger | |
parent | d5e8f47effe8f7d3cc64ab1e3ae3fea05b9400b5 (diff) | |
parent | 281e8113d0ce20c702e847caf971663021eb65e3 (diff) | |
download | frameworks-native-ddd9c712727881acbedec8a66535ab31fa2a5b4f.tar.gz frameworks-native-ddd9c712727881acbedec8a66535ab31fa2a5b4f.tar.xz frameworks-native-ddd9c712727881acbedec8a66535ab31fa2a5b4f.zip |
Merge changes If4271719,I9c9b5de9,I46a26a67 into oc-dr1-dev
* changes:
Communicate composition buffer dataspace to HWC
Add VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT.
Check wide-color support before adding extensions
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r-- | services/surfaceflinger/DisplayDevice.cpp | 5 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayDevice.h | 1 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp | 14 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 3 |
4 files changed, 16 insertions, 7 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index a0abf12f9..fc6000233 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp | |||
@@ -442,6 +442,11 @@ void DisplayDevice::setActiveColorMode(android_color_mode_t mode) { | |||
442 | android_color_mode_t DisplayDevice::getActiveColorMode() const { | 442 | android_color_mode_t DisplayDevice::getActiveColorMode() const { |
443 | return mActiveColorMode; | 443 | return mActiveColorMode; |
444 | } | 444 | } |
445 | |||
446 | void DisplayDevice::setCompositionDataSpace(android_dataspace dataspace) { | ||
447 | ANativeWindow* const window = mNativeWindow.get(); | ||
448 | native_window_set_buffers_data_space(window, dataspace); | ||
449 | } | ||
445 | #endif | 450 | #endif |
446 | 451 | ||
447 | // ---------------------------------------------------------------------------- | 452 | // ---------------------------------------------------------------------------- |
diff --git a/services/surfaceflinger/DisplayDevice.h b/services/surfaceflinger/DisplayDevice.h index e2852a7c6..578f81b69 100644 --- a/services/surfaceflinger/DisplayDevice.h +++ b/services/surfaceflinger/DisplayDevice.h | |||
@@ -189,6 +189,7 @@ public: | |||
189 | #ifdef USE_HWC2 | 189 | #ifdef USE_HWC2 |
190 | android_color_mode_t getActiveColorMode() const; | 190 | android_color_mode_t getActiveColorMode() const; |
191 | void setActiveColorMode(android_color_mode_t mode); | 191 | void setActiveColorMode(android_color_mode_t mode); |
192 | void setCompositionDataSpace(android_dataspace dataspace); | ||
192 | #endif | 193 | #endif |
193 | 194 | ||
194 | /* ------------------------------------------------------------------------ | 195 | /* ------------------------------------------------------------------------ |
diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp index 5b869e12c..68d7a18d3 100644 --- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp +++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp | |||
@@ -106,12 +106,6 @@ status_t FramebufferSurface::advanceFrame() { | |||
106 | if (result != NO_ERROR) { | 106 | if (result != NO_ERROR) { |
107 | ALOGE("error latching next FramebufferSurface buffer: %s (%d)", | 107 | ALOGE("error latching next FramebufferSurface buffer: %s (%d)", |
108 | strerror(-result), result); | 108 | strerror(-result), result); |
109 | return result; | ||
110 | } | ||
111 | result = mHwc.setClientTarget(mDisplayType, slot, | ||
112 | acquireFence, buf, dataspace); | ||
113 | if (result != NO_ERROR) { | ||
114 | ALOGE("error posting framebuffer: %d", result); | ||
115 | } | 109 | } |
116 | return result; | 110 | return result; |
117 | #else | 111 | #else |
@@ -182,7 +176,13 @@ status_t FramebufferSurface::nextBuffer(sp<GraphicBuffer>& outBuffer, sp<Fence>& | |||
182 | #else | 176 | #else |
183 | outBuffer = mCurrentBuffer; | 177 | outBuffer = mCurrentBuffer; |
184 | #endif | 178 | #endif |
185 | return NO_ERROR; | 179 | status_t result = |
180 | mHwc.setClientTarget(mDisplayType, outSlot, outFence, outBuffer, outDataspace); | ||
181 | if (result != NO_ERROR) { | ||
182 | ALOGE("error posting framebuffer: %d", result); | ||
183 | } | ||
184 | |||
185 | return result; | ||
186 | } | 186 | } |
187 | 187 | ||
188 | #ifndef USE_HWC2 | 188 | #ifndef USE_HWC2 |
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index d435dbc3c..702f32f19 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp | |||
@@ -385,6 +385,7 @@ void SurfaceFlinger::bootFinished() | |||
385 | #ifdef USE_HWC2 | 385 | #ifdef USE_HWC2 |
386 | sp<DisplayDevice> hw(getDisplayDevice(mBuiltinDisplays[DisplayDevice::DISPLAY_PRIMARY])); | 386 | sp<DisplayDevice> hw(getDisplayDevice(mBuiltinDisplays[DisplayDevice::DISPLAY_PRIMARY])); |
387 | if (hw->getWideColorSupport()) { | 387 | if (hw->getWideColorSupport()) { |
388 | hw->setCompositionDataSpace(HAL_DATASPACE_V0_SRGB); | ||
388 | setActiveColorModeInternal(hw, HAL_COLOR_MODE_SRGB); | 389 | setActiveColorModeInternal(hw, HAL_COLOR_MODE_SRGB); |
389 | } | 390 | } |
390 | #endif | 391 | #endif |
@@ -1224,6 +1225,7 @@ void SurfaceFlinger::createDefaultDisplayDevice() { | |||
1224 | hasWideColorModes && hasWideColorDisplay); | 1225 | hasWideColorModes && hasWideColorDisplay); |
1225 | mDisplays.add(token, hw); | 1226 | mDisplays.add(token, hw); |
1226 | setActiveColorModeInternal(hw, HAL_COLOR_MODE_NATIVE); | 1227 | setActiveColorModeInternal(hw, HAL_COLOR_MODE_NATIVE); |
1228 | hw->setCompositionDataSpace(HAL_DATASPACE_UNKNOWN); | ||
1227 | } | 1229 | } |
1228 | 1230 | ||
1229 | void SurfaceFlinger::onHotplugReceived(HWComposer* composer, int32_t disp, bool connected) { | 1231 | void SurfaceFlinger::onHotplugReceived(HWComposer* composer, int32_t disp, bool connected) { |
@@ -1873,6 +1875,7 @@ void SurfaceFlinger::setUpHWComposer() { | |||
1873 | // To achieve this we suppress color mode changes until after the boot animation | 1875 | // To achieve this we suppress color mode changes until after the boot animation |
1874 | if (mBootFinished) { | 1876 | if (mBootFinished) { |
1875 | setActiveColorModeInternal(displayDevice, newColorMode); | 1877 | setActiveColorModeInternal(displayDevice, newColorMode); |
1878 | displayDevice->setCompositionDataSpace(newDataSpace); | ||
1876 | } | 1879 | } |
1877 | } | 1880 | } |
1878 | } | 1881 | } |