From 0abc4a5897fdd556f2a618400eff4f9677649024 Mon Sep 17 00:00:00 2001 From: Sally Qi Date: Thu, 26 Sep 2024 16:13:06 -0700 Subject: [Lut HAL backend] implementation 2nd patch 1. add gui/DisplayLuts.h structure. Mimic DisplayLuts.java. 2. add Lut parameter into Layer side. When SurfaceControl#setLuts is called, in native code, the lut information is passed to SurfaceFlinger and RenderEngine side via LayerState::eLutsChanged. 3. in OutputLayer::updateCompositionState, we compare the Lut requested from the app and the Lut from the HWC to decide GPU composition or not. 4. DPU or GPU composition? If the Lut from the app exactly matches the Lut from the hwc, do DPU. Otherwise, GPU composition instead. Bug: 329472856 Test: libcompositionengine_test Flag: NONE HAL backend interface change Change-Id: I8295fe419c6237d90b7ff9f02f62bafd6cd2cecf --- libs/gui/LayerState.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libs/gui/LayerState.cpp') diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index 422c57bc87..4b531345b0 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -664,6 +664,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eShadowRadiusChanged; shadowRadius = other.shadowRadius; } + if (other.what & eLutsChanged) { + what |= eLutsChanged; + luts = other.luts; + } if (other.what & eDefaultFrameRateCompatibilityChanged) { what |= eDefaultFrameRateCompatibilityChanged; defaultFrameRateCompatibility = other.defaultFrameRateCompatibility; @@ -821,6 +825,8 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const { CHECK_DIFF(diff, eColorSpaceAgnosticChanged, other, colorSpaceAgnostic); CHECK_DIFF(diff, eDimmingEnabledChanged, other, dimmingEnabled); if (other.what & eBufferReleaseChannelChanged) diff |= eBufferReleaseChannelChanged; + if (other.what & eLutsChanged) diff |= eLutsChanged; + return diff; } -- cgit v1.2.3-59-g8ed1b