Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d98818c8 authored by Sasha McIntosh's avatar Sasha McIntosh
Browse files

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: default avatarSasha McIntosh <sashamcintosh@google.com>
parent 640b0b5a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ parcelable DisplayConfiguration {
  int configGroup;
  int vsyncPeriod;
  @nullable android.hardware.graphics.composer3.VrrConfig vrrConfig;
  android.hardware.graphics.composer3.OutputType hdrOutputType;
  parcelable Dpi {
    float x;
    float y;
+41 −0
Original line number Diff line number Diff line
/*
 * 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,
}
+7 −0
Original line number Diff line number Diff line
@@ -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 @@ parcelable DisplayConfiguration {
     * Non-VRR modes should set this to null.
     */
    @nullable VrrConfig vrrConfig;

    /**
     * The HDR output format available.
     */
    OutputType hdrOutputType;
}
+42 −0
Original line number Diff line number Diff line
/*
 * 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,
}
+14 −0
Original line number Diff line number Diff line
@@ -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, SetUnsupportedLayerLuts) {
    }
}

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,