From 281e8113d0ce20c702e847caf971663021eb65e3 Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Thu, 13 Jul 2017 17:54:01 -0600 Subject: Communicate composition buffer dataspace to HWC Test: adb shell dumpsys SurfaceFlinger look for dataspace info in DisplayDevice section Bug: 63146977 Change-Id: If427171994fbc91faacf5bad9cc736ddfbd35ec3 (cherry picked from commit 79d272442ce13418c3ea81c95d7fea0159b4b481) --- services/surfaceflinger/SurfaceFlinger.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 63f260a958..0ae5209884 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -383,6 +383,7 @@ void SurfaceFlinger::bootFinished() #ifdef USE_HWC2 sp hw(getDisplayDevice(mBuiltinDisplays[DisplayDevice::DISPLAY_PRIMARY])); if (hw->getWideColorSupport()) { + hw->setCompositionDataSpace(HAL_DATASPACE_V0_SRGB); setActiveColorModeInternal(hw, HAL_COLOR_MODE_SRGB); } #endif @@ -1222,6 +1223,7 @@ void SurfaceFlinger::createDefaultDisplayDevice() { hasWideColorModes && hasWideColorDisplay); mDisplays.add(token, hw); setActiveColorModeInternal(hw, HAL_COLOR_MODE_NATIVE); + hw->setCompositionDataSpace(HAL_DATASPACE_UNKNOWN); } void SurfaceFlinger::onHotplugReceived(HWComposer* composer, int32_t disp, bool connected) { @@ -1871,6 +1873,7 @@ void SurfaceFlinger::setUpHWComposer() { // To achieve this we suppress color mode changes until after the boot animation if (mBootFinished) { setActiveColorModeInternal(displayDevice, newColorMode); + displayDevice->setCompositionDataSpace(newDataSpace); } } } -- cgit v1.2.3-59-g8ed1b