Cleanup to composer apis for HDR:
1. Remove the setDisplayBrightness method, as it's been moved to a
display command
2. Rename the WhitePointNits stable stuct to Luminance, since it's a
more general descriptor.
Bug: 210151839
Test: builds
Change-Id: Ic948dce737ce718772100b0e976ec93069d5e8e1
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 2d17e0f..e9d9745 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
@@ -65,7 +65,6 @@
void setClientTargetSlotCount(long display, int clientTargetSlotCount);
void setColorMode(long display, android.hardware.graphics.composer3.ColorMode mode, android.hardware.graphics.composer3.RenderIntent intent);
void setContentType(long display, android.hardware.graphics.composer3.ContentType type);
- void setDisplayBrightness(long display, float brightness);
void setDisplayedContentSamplingEnabled(long display, boolean enable, android.hardware.graphics.composer3.FormatColorComponent componentMask, long maxFrames);
void setPowerMode(long display, android.hardware.graphics.composer3.PowerMode mode);
void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in @nullable ParcelFileDescriptor releaseFence);
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
index ab77880..7e6c00b 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -51,7 +51,7 @@
@nullable android.hardware.graphics.common.Rect[] visibleRegion;
@nullable android.hardware.graphics.composer3.ZOrder z;
@nullable float[] colorTransform;
- @nullable android.hardware.graphics.composer3.WhitePointNits whitePointNits;
+ @nullable android.hardware.graphics.composer3.Luminance whitePointNits;
@nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata;
@nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Luminance.aidl
similarity index 98%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Luminance.aidl
index c3925d2..adb49a8 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Luminance.aidl
@@ -33,6 +33,6 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable WhitePointNits {
+parcelable Luminance {
float nits;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index ab7f397..3ab6329 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -616,25 +616,6 @@
void setContentType(long display, ContentType type);
/**
- * Sets the brightness of a display.
- *
- * Ideally, the brightness change should take effect in the next frame post (so that it can be
- * aligned with color transforms).
- *
- * @param display
- * The display whose brightness is set.
- * @param brightness
- * A number between 0.0f (minimum brightness) and 1.0f (maximum brightness), or -1.0 to
- * turn the backlight off.
- *
- * @exception EX_BAD_DISPLAY when the display is invalid, or
- * @exception EX_UNSUPPORTED when brightness operations are not supported, or
- * @exception EX_BAD_PARAMETER when the brightness is invalid, or
- * @exception EX_NO_RESOURCES when the brightness cannot be applied.
- */
- void setDisplayBrightness(long display, float brightness);
-
- /**
* Enables or disables the collection of color content statistics
* on this display.
*
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
index 44fd4dc..fa2d154 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -23,6 +23,7 @@
import android.hardware.graphics.composer3.Buffer;
import android.hardware.graphics.composer3.Color;
import android.hardware.graphics.composer3.FloatColor;
+import android.hardware.graphics.composer3.Luminance;
import android.hardware.graphics.composer3.ParcelableBlendMode;
import android.hardware.graphics.composer3.ParcelableComposition;
import android.hardware.graphics.composer3.ParcelableDataspace;
@@ -30,7 +31,6 @@
import android.hardware.graphics.composer3.PerFrameMetadata;
import android.hardware.graphics.composer3.PerFrameMetadataBlob;
import android.hardware.graphics.composer3.PlaneAlpha;
-import android.hardware.graphics.composer3.WhitePointNits;
import android.hardware.graphics.composer3.ZOrder;
@VintfStability
@@ -243,7 +243,7 @@
* brightness in nits, and accordingly SDR content shall be dimmed to the desired white point
* provided.
*/
- @nullable WhitePointNits whitePointNits;
+ @nullable Luminance whitePointNits;
/**
* Sets the PerFrameMetadata for the display. This metadata must be used
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Luminance.aidl
similarity index 66%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/Luminance.aidl
index 2a1d1c6..5b1c1b4 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Luminance.aidl
@@ -17,13 +17,10 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable WhitePointNits {
+parcelable Luminance {
/**
- * 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.
- * @see LayerCommand.whitePointNits.
+ * Photometric measure of luminous intensity per unit area of light.
+ * Units are nits, or cd/m^2.
*/
float nits;
}
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
index b202b34..2d927cd 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
@@ -31,9 +31,9 @@
#include <aidl/android/hardware/graphics/composer3/Composition.h>
#include <aidl/android/hardware/graphics/composer3/DisplayBrightness.h>
#include <aidl/android/hardware/graphics/composer3/FloatColor.h>
+#include <aidl/android/hardware/graphics/composer3/Luminance.h>
#include <aidl/android/hardware/graphics/composer3/PerFrameMetadata.h>
#include <aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h>
-#include <aidl/android/hardware/graphics/composer3/WhitePointNits.h>
#include <aidl/android/hardware/graphics/composer3/DisplayCommand.h>
@@ -215,8 +215,7 @@
}
void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) {
- getLayerCommand(display, layer)
- .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits});
+ getLayerCommand(display, layer).whitePointNits.emplace(Luminance{.nits = whitePointNits});
}
const std::vector<DisplayCommand>& getPendingCommands() {