summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevanshi Bansal <quic_devanshi@quicinc.com>2021-12-23 22:38:07 +0530
committerDevanshi Bansal <quic_devanshi@quicinc.com>2021-12-28 10:33:15 +0000
commit8bd3433316bd91c1e8bc21102dcb4e940104d2b3 (patch)
tree5814b23786e20de0fe445f289daebcb607455bf2
parentfcca5733ee804e505e97eb1f9218e790c8f4a443 (diff)
sf: Reset dataspace for FBT when color mode changes from previous cycle
Change-Id: I45e08d90fdd4855da8e42093a69d66641954788d CRs-Fixed: 3094472
-rw-r--r--services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h2
-rw-r--r--services/surfaceflinger/CompositionEngine/src/Display.cpp11
2 files changed, 12 insertions, 1 deletions
diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h
index e3558cd3e5..9e1abf0fd1 100644
--- a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h
+++ b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h
@@ -93,6 +93,8 @@ private:
composer::DisplayExtnIntf *mDisplayExtnIntf = nullptr;
void beginDraw();
void endDraw();
+ ColorProfile mColorProfile = {ui::ColorMode::NATIVE, ui::Dataspace::UNKNOWN,
+ ui::RenderIntent::COLORIMETRIC, ui::Dataspace::UNKNOWN};
};
// This template factory function standardizes the implementation details of the
diff --git a/services/surfaceflinger/CompositionEngine/src/Display.cpp b/services/surfaceflinger/CompositionEngine/src/Display.cpp
index 0a30928947..4850e2893e 100644
--- a/services/surfaceflinger/CompositionEngine/src/Display.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Display.cpp
@@ -146,7 +146,16 @@ void Display::setColorProfile(const ColorProfile& colorProfile) {
const auto physicalId = PhysicalDisplayId::tryCast(mId);
LOG_FATAL_IF(!physicalId);
- mIsColorModeChanged = true;
+ if (colorProfile.mode != mColorProfile.mode ||
+ colorProfile.dataspace != mColorProfile.dataspace ||
+ colorProfile.renderIntent != mColorProfile.renderIntent) {
+ mIsColorModeChanged = true;
+ }
+
+ mColorProfile.mode = colorProfile.mode;
+ mColorProfile.dataspace = colorProfile.dataspace;
+ mColorProfile.renderIntent = colorProfile.renderIntent;
+ mColorProfile.colorSpaceAgnosticDataspace = colorProfile.colorSpaceAgnosticDataspace;
getCompositionEngine().getHwComposer().setActiveColorMode(*physicalId, colorProfile.mode,
colorProfile.renderIntent);