Plumb display brightness nits to composer hal.
OEM feedback was that the display brightness in nits should be known to
the Hardware Composer for correct tone-mapping behavior by the DPU.
Inteperpolating the display brightness curve that's defined in display
config files is possible, but it would require the vendor to re-implement
DisplayManager logic for interpolating a spline curve.
Bug: 220396224
Test: builds, boots
Change-Id: I28d936c118bed1184d4f742478c8862f9e0aba95
diff --git a/services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp b/services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp
index 9a61667..0e5a7b6 100644
--- a/services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp
+++ b/services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp
@@ -640,8 +640,9 @@
// values, use a Sequence to control the matching so the values are returned in a known
// order.
constexpr float kDisplayBrightness = 0.5f;
+ constexpr float kDisplayBrightnessNits = 200.f;
EXPECT_CALL(mHwComposer,
- setDisplayBrightness(DEFAULT_DISPLAY_ID, kDisplayBrightness,
+ setDisplayBrightness(DEFAULT_DISPLAY_ID, kDisplayBrightness, kDisplayBrightnessNits,
Hwc2::Composer::DisplayBrightnessOptions{.applyImmediately =
false}))
.WillOnce(Return(ByMove(ftl::yield<status_t>(NO_ERROR))));
@@ -650,6 +651,7 @@
mock::RenderSurface* renderSurface = new StrictMock<mock::RenderSurface>();
EXPECT_CALL(*renderSurface, beginFrame(_)).Times(1);
mDisplay->setRenderSurfaceForTest(std::unique_ptr<RenderSurface>(renderSurface));
+ mDisplay->editState().displayBrightnessNits = kDisplayBrightnessNits;
mDisplay->beginFrame();
auto& state = mDisplay->getState();