HDR: Add HDR type to DisplayConfiguration
When hdrOutputType is populated, the HWC has the ability to set the
display into an HDR mode. This information is required during modeset to
ensure that adequate bandwidth is preset to support an HDR mode.
Bug: 374183675
Test: GraphicsComposerAidlV3Test#GetDisplayConfigurations
Flag: com.android.graphics.surfaceflinger.flags.connected_display_hdr
Change-Id: Id6000244bc5f3e30235cb4cef8e71d028b1d21f8
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl
index 040afd7..c522188 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl
@@ -41,6 +41,7 @@
int configGroup;
int vsyncPeriod;
@nullable android.hardware.graphics.composer3.VrrConfig vrrConfig;
+ android.hardware.graphics.composer3.OutputType hdrOutputType;
parcelable Dpi {
float x;
float y;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OutputType.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OutputType.aidl
new file mode 100644
index 0000000..e1149cb
--- /dev/null
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OutputType.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.graphics.composer3;
+@Backing(type="int") @VintfStability
+enum OutputType {
+ INVALID = 0,
+ SYSTEM = 1,
+ SDR = 2,
+ HDR10 = 3,
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl
index 09c42dc..80d1337 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl
@@ -15,6 +15,8 @@
*/
package android.hardware.graphics.composer3;
+
+import android.hardware.graphics.composer3.OutputType;
import android.hardware.graphics.composer3.VrrConfig;
@VintfStability
@@ -67,4 +69,9 @@
* Non-VRR modes should set this to null.
*/
@nullable VrrConfig vrrConfig;
+
+ /**
+ * The HDR output format available.
+ */
+ OutputType hdrOutputType;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/OutputType.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/OutputType.aidl
new file mode 100644
index 0000000..bf4a786
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/OutputType.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.graphics.composer3;
+
+/**
+ * Display output formats for HDR content.
+ */
+@VintfStability
+@Backing(type="int")
+enum OutputType {
+ /**
+ * Invalid HDR output type
+ */
+ INVALID = 0,
+ /**
+ * Display output format will be chosen by the HAL implementation
+ * and will not adjust to match the content format
+ */
+ SYSTEM = 1,
+ /**
+ * Display supports SDR output type
+ */
+ SDR = 2,
+ /**
+ * Display supports HDR10 output type
+ */
+ HDR10 = 3,
+}
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index 8006523..2459b5e 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -22,6 +22,7 @@
#include <aidl/android/hardware/graphics/common/PixelFormat.h>
#include <aidl/android/hardware/graphics/common/Rect.h>
#include <aidl/android/hardware/graphics/composer3/Composition.h>
+#include <aidl/android/hardware/graphics/composer3/OutputType.h>
#include <aidl/android/hardware/graphics/composer3/IComposer.h>
#include <android-base/properties.h>
#include <android/binder_process.h>
@@ -3373,6 +3374,19 @@
}
}
+TEST_P(GraphicsComposerAidlCommandV4Test, GetDisplayConfigurations_hasHdrType) {
+ for (const auto& display : mDisplays) {
+ const auto& [status, displayConfigurations] =
+ mComposerClient->getDisplayConfigurations(display.getDisplayId());
+ EXPECT_TRUE(status.isOk());
+ EXPECT_FALSE(displayConfigurations.empty());
+
+ for (const auto& displayConfig : displayConfigurations) {
+ EXPECT_NE(displayConfig.hdrOutputType, OutputType::INVALID);
+ }
+ }
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest);
INSTANTIATE_TEST_SUITE_P(
PerInstance, GraphicsComposerAidlCommandTest,