Add white point plumbing into command buffer

Bug: 200310158
Test: builds, boots
Change-Id: I67cadb441b24663346452850a86e3d9151868749
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h
index bdf97ca..b586e7f 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h
@@ -294,6 +294,11 @@
         getLayerCommand(display, layer).genericMetadata.emplace(std::move(metadata));
     }
 
+    void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) {
+        getLayerCommand(display, layer)
+                .whitePointNits.emplace(command::WhitePointNits{.nits = whitePointNits});
+    }
+
     const std::vector<command::CommandPayload>& getPendingCommands() {
         if (mLayerCommand.has_value()) {
             mCommands.emplace_back(std::move(*mLayerCommand));
@@ -305,6 +310,7 @@
         }
         return mCommands;
     }
+
     std::vector<command::CommandResultPayload> getPendingCommandResults() {
         return std::move(mCommandsResults);
     }
@@ -489,18 +495,21 @@
     }
 
     // Get the client target properties requested by hardware composer.
-    void takeClientTargetProperty(int64_t display, ClientTargetProperty* outClientTargetProperty) {
+    void takeClientTargetProperty(int64_t display, ClientTargetProperty* outClientTargetProperty,
+                                  float* outWhitePointNits) {
         auto found = mReturnData.find(display);
 
         // If not found, return the default values.
         if (found == mReturnData.end()) {
             outClientTargetProperty->pixelFormat = common::PixelFormat::RGBA_8888;
             outClientTargetProperty->dataspace = Dataspace::UNKNOWN;
+            *outWhitePointNits = -1.f;
             return;
         }
 
         ReturnData& data = found->second;
         *outClientTargetProperty = data.clientTargetProperty;
+        *outWhitePointNits = data.clientTargetWhitePointNits;
     }
 
   private:
@@ -578,6 +587,7 @@
         data.clientTargetProperty.pixelFormat =
                 clientTargetProperty.clientTargetProperty.pixelFormat;
         data.clientTargetProperty.dataspace = clientTargetProperty.clientTargetProperty.dataspace;
+        data.clientTargetWhitePointNits = clientTargetProperty.whitePointNits;
     }
 
     struct ReturnData {
@@ -598,6 +608,7 @@
 
         ClientTargetProperty clientTargetProperty{common::PixelFormat::RGBA_8888,
                                                   Dataspace::UNKNOWN};
+        float clientTargetWhitePointNits = -1.f;
     };
 
     std::vector<command::Error> mErrors;