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/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 8850c76..115dc64 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1709,6 +1709,7 @@
                        return getHwComposer()
                                .setDisplayBrightness(display->getPhysicalId(),
                                                      brightness.displayBrightness,
+                                                     brightness.displayBrightnessNits,
                                                      Hwc2::Composer::DisplayBrightnessOptions{
                                                              .applyImmediately = true});
                    }
@@ -3249,6 +3250,9 @@
                 const status_t error =
                         getHwComposer()
                                 .setDisplayBrightness(display->getPhysicalId(), *brightness,
+                                                      display->getCompositionDisplay()
+                                                              ->getState()
+                                                              .displayBrightnessNits,
                                                       Hwc2::Composer::DisplayBrightnessOptions{
                                                               .applyImmediately = true})
                                 .get();