Loading services/surfaceflinger/CompositionEngine/src/DisplayColorProfile.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ void DisplayColorProfile::populateColorModes( } // add all known HDR combinations for (auto intent : sHdrRenderIntents) { for (auto intent : hdrRenderIntents) { for (auto mode : sHdrColorModes) { addColorMode(hwcColorModes, mode, intent); } Loading services/surfaceflinger/CompositionEngine/tests/DisplayColorProfileTest.cpp +109 −111 File changed.Preview size limit exceeded, changes collapsed. Show changes services/surfaceflinger/SurfaceFlinger.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,9 @@ void SurfaceFlinger::readPersistentProperties() { property_get("persist.sys.sf.native_mode", value, "0"); mDisplayColorSetting = static_cast<DisplayColorSetting>(atoi(value)); property_get("persist.sys.sf.color_mode", value, "0"); mForceColorMode = static_cast<ColorMode>(atoi(value)); } void SurfaceFlinger::startBootAnim() { Loading Loading @@ -2498,6 +2501,17 @@ void SurfaceFlinger::pickColorMode(const sp<DisplayDevice>& display, ColorMode* auto* profile = display->getCompositionDisplay()->getDisplayColorProfile(); switch (mForceColorMode) { case ColorMode::SRGB: bestDataSpace = Dataspace::V0_SRGB; break; case ColorMode::DISPLAY_P3: bestDataSpace = Dataspace::DISPLAY_P3; break; default: break; } // respect hdrDataSpace only when there is no legacy HDR support const bool isHdr = hdrDataSpace != Dataspace::UNKNOWN && !profile->hasLegacyHdrSupport(hdrDataSpace); Loading services/surfaceflinger/SurfaceFlinger.h +9 −0 Original line number Diff line number Diff line Loading @@ -1089,6 +1089,15 @@ private: DisplayColorSetting mDisplayColorSetting = DisplayColorSetting::ENHANCED; // Color mode forced by setting persist.sys.sf.color_mode, it must: // 1. not be NATIVE color mode, NATIVE color mode means no forced color mode; // 2. be one of the supported color modes returned by hardware composer, otherwise // it will not be respected. // persist.sys.sf.color_mode will only take effect when persist.sys.sf.native_mode // is not set to 1. // This property can be used to force SurfaceFlinger to always pick a certain color mode. ui::ColorMode mForceColorMode = ui::ColorMode::NATIVE; ui::Dataspace mDefaultCompositionDataspace; ui::Dataspace mWideColorGamutCompositionDataspace; Loading Loading
services/surfaceflinger/CompositionEngine/src/DisplayColorProfile.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ void DisplayColorProfile::populateColorModes( } // add all known HDR combinations for (auto intent : sHdrRenderIntents) { for (auto intent : hdrRenderIntents) { for (auto mode : sHdrColorModes) { addColorMode(hwcColorModes, mode, intent); } Loading
services/surfaceflinger/CompositionEngine/tests/DisplayColorProfileTest.cpp +109 −111 File changed.Preview size limit exceeded, changes collapsed. Show changes
services/surfaceflinger/SurfaceFlinger.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,9 @@ void SurfaceFlinger::readPersistentProperties() { property_get("persist.sys.sf.native_mode", value, "0"); mDisplayColorSetting = static_cast<DisplayColorSetting>(atoi(value)); property_get("persist.sys.sf.color_mode", value, "0"); mForceColorMode = static_cast<ColorMode>(atoi(value)); } void SurfaceFlinger::startBootAnim() { Loading Loading @@ -2498,6 +2501,17 @@ void SurfaceFlinger::pickColorMode(const sp<DisplayDevice>& display, ColorMode* auto* profile = display->getCompositionDisplay()->getDisplayColorProfile(); switch (mForceColorMode) { case ColorMode::SRGB: bestDataSpace = Dataspace::V0_SRGB; break; case ColorMode::DISPLAY_P3: bestDataSpace = Dataspace::DISPLAY_P3; break; default: break; } // respect hdrDataSpace only when there is no legacy HDR support const bool isHdr = hdrDataSpace != Dataspace::UNKNOWN && !profile->hasLegacyHdrSupport(hdrDataSpace); Loading
services/surfaceflinger/SurfaceFlinger.h +9 −0 Original line number Diff line number Diff line Loading @@ -1089,6 +1089,15 @@ private: DisplayColorSetting mDisplayColorSetting = DisplayColorSetting::ENHANCED; // Color mode forced by setting persist.sys.sf.color_mode, it must: // 1. not be NATIVE color mode, NATIVE color mode means no forced color mode; // 2. be one of the supported color modes returned by hardware composer, otherwise // it will not be respected. // persist.sys.sf.color_mode will only take effect when persist.sys.sf.native_mode // is not set to 1. // This property can be used to force SurfaceFlinger to always pick a certain color mode. ui::ColorMode mForceColorMode = ui::ColorMode::NATIVE; ui::Dataspace mDefaultCompositionDataspace; ui::Dataspace mWideColorGamutCompositionDataspace; Loading