Merge "Add sdr white point information to composer3"
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl
index 3b31149..e19105d 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl
@@ -72,4 +72,5 @@
   SET_LAYER_PER_FRAME_METADATA_BLOBS = 50593792,
   SET_CLIENT_TARGET_PROPERTY = 17104896,
   SET_LAYER_GENERIC_METADATA = 68026368,
+  SET_LAYER_WHITE_POINT_NITS = 50659328,
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
index 531fd14..8824f5a 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -40,7 +40,7 @@
   void destroyVirtualDisplay(long display);
   android.hardware.graphics.composer3.ExecuteCommandsStatus executeCommands(int inLength, in android.hardware.common.NativeHandle[] inHandles);
   int getActiveConfig(long display);
-  void getClientTargetSupport(long display, int width, int height, android.hardware.graphics.common.PixelFormat format, android.hardware.graphics.common.Dataspace dataspace);
+  void getClientTargetSupport(long display, int width, int height, in android.hardware.graphics.composer3.ClientTargetProperty clientTargetProperty);
   android.hardware.graphics.composer3.ColorMode[] getColorModes(long display);
   float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace);
   int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute);
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl
index 5f987d0..95c07ac 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl
@@ -689,8 +689,16 @@
      *
      *     0 - 3: clientTargetProperty.pixelFormat
      *     4 - 7: clientTargetProperty.dataspace
+     *     8 - 11: whitePointNits
      *
-     *   setClientTargetProperty(ClientTargetProperty clientTargetProperty);
+     * The white point parameter describes the intended white point of the client target buffer.
+     * When client composition blends both HDR and SDR content, the client must composite to the
+     * brightness space as specified by the hardware composer. This is so that adjusting the real
+     * display brightness may be applied atomically with compensating the client target output. For
+     * instance, client-compositing a list of SDR layers requires dimming the brightness space of
+     * the SDR buffers when an HDR layer is simultaneously device-composited.
+     *
+     *   setClientTargetProperty(ClientTargetProperty clientTargetProperty, float whitePointNits);
      */
     SET_CLIENT_TARGET_PROPERTY = 0x105 << OPCODE_SHIFT,
 
@@ -738,4 +746,18 @@
      *        corresponding to the key as described above
      */
     SET_LAYER_GENERIC_METADATA = 0x40e << OPCODE_SHIFT,
+
+    /**
+     * SET_LAYER_WHITE_POINT_NITS has this pseudo prototype
+     *
+     *   setLayerWhitePointNits(float sdrWhitePointNits);
+     *
+     * Sets the desired white point for the layer. This is intended to be used when presenting
+     * an SDR layer alongside HDR content. The HDR content will be presented at the display
+     * brightness in nits, and accordingly SDR content shall be dimmed to the desired white point
+     * provided.
+     *
+     * @param whitePointNits is the white point in nits.
+     */
+    SET_LAYER_WHITE_POINT_NITS = 0x305 << OPCODE_SHIFT,
 }
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index 87a3a50..20a6ffc 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -200,15 +200,12 @@
      * @param display is the display to query.
      * @param width is the client target width in pixels.
      * @param height is the client target height in pixels.
-     * @param format is the client target format.
-     * @param dataspace is the client target dataspace, as described in
-     *     setLayerDataspace.
+     * @param clientTargetProperty is the client target format and dataspace.
      * @exception EX_BAD_DISPLAY when an invalid display handle was passed in.
      * @exception EX_UNSUPPORTED when the given configuration is not supported.
      */
-    void getClientTargetSupport(long display, int width, int height,
-            android.hardware.graphics.common.PixelFormat format,
-            android.hardware.graphics.common.Dataspace dataspace);
+    void getClientTargetSupport(
+            long display, int width, int height, in ClientTargetProperty clientTargetProperty);
 
     /**
      * Returns the color modes supported on this display.