summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-build-prod@system.gserviceaccount.com>2021-12-28 16:58:00 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-12-28 16:58:00 +0000
commit9e828ba7315f35cb4b85e1635cebbf851260ad78 (patch)
tree96658d0134bb44a3a98cb733c29acded4fb58424
parentd6439d5f152fa089de110dc2a7a1432199bd085e (diff)
parent8bd3433316bd91c1e8bc21102dcb4e940104d2b3 (diff)
Merge "sf: Reset dataspace for FBT when color mode changes from previous cycle" into s-keystone-qcom-dev
-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);