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

Commit a0545e30 authored by Sally Qi's avatar Sally Qi Committed by Android (Google) Code Review
Browse files

Merge "[Aidl graphics API] split dataspace array into tuples."

parents cbcc57f3 c2c392fb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ parcelable OverlayProperties {
  boolean supportMixedColorSpaces;
  parcelable SupportedBufferCombinations {
    android.hardware.graphics.common.PixelFormat[] pixelFormats;
    android.hardware.graphics.common.Dataspace[] dataspaces;
    android.hardware.graphics.common.Dataspace[] standards;
    android.hardware.graphics.common.Dataspace[] transfers;
    android.hardware.graphics.common.Dataspace[] ranges;
  }
}
+15 −7
Original line number Diff line number Diff line
@@ -19,16 +19,24 @@ package android.hardware.graphics.composer3;
@VintfStability
parcelable OverlayProperties {
    parcelable SupportedBufferCombinations {
        // List of pixelformats and dataspaces that can be used together.
        // All pixelformats and dataspaces stored inside are valid combinations.
        // List of pixelformats, standards, transfers and ranges dataspaces that can be used
        // together.
        // The pixelformats, standards, transfers and ranges stored inside are valid
        // combinations.
        // Dataspace identifies three components of colors - standard, transfer and
        // range.
        android.hardware.graphics.common.PixelFormat[] pixelFormats;
        android.hardware.graphics.common.Dataspace[] dataspaces;
        android.hardware.graphics.common.Dataspace[] standards;
        android.hardware.graphics.common.Dataspace[] transfers;
        android.hardware.graphics.common.Dataspace[] ranges;
    }
    // Array of all valid pixelformat and dataspace combinations.
    // If all supported formats work with all supported dataspaces,
    // Array of all valid pixelformat, standard, transfer and range combinations.
    // If all supported formats work with all standards, transfers and ranges,
    // then this list may only have 1 entry.
    // If some dataspaces, e.g. scRGB, only work with specific formats,
    // then this list may contain more than 1 entry.
    // If some dataspaces, e.g. scRGB (STANDARD_BT709 | TRANSFER_SRGB | RANGE_EXTENDED),
    // only work with specific formats, then this list may contain more than 1 entry.
    // If some ranges, e.g. RANGE_LIMITED, only work with specific
    // formats/standards/transfers, then this list may contain more than 1 entry.
    SupportedBufferCombinations[] combinations;

    // True if the DPU is able to color manage at least two overlays
+18 −1
Original line number Diff line number Diff line
@@ -869,7 +869,7 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayName) {
}

TEST_P(GraphicsComposerAidlTest, GetOverlaySupport) {
    const auto& [status, _] = mComposerClient->getOverlaySupport();
    const auto& [status, properties] = mComposerClient->getOverlaySupport();
    if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC &&
        status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
        GTEST_SUCCEED() << "getOverlaySupport is not supported";
@@ -877,6 +877,23 @@ TEST_P(GraphicsComposerAidlTest, GetOverlaySupport) {
    }

    ASSERT_TRUE(status.isOk());
    for (const auto& i : properties.combinations) {
        for (const auto standard : i.standards) {
            const auto val = static_cast<int32_t>(standard) &
                             static_cast<int32_t>(common::Dataspace::STANDARD_MASK);
            ASSERT_TRUE(val == static_cast<int32_t>(standard));
        }
        for (const auto transfer : i.transfers) {
            const auto val = static_cast<int32_t>(transfer) &
                             static_cast<int32_t>(common::Dataspace::TRANSFER_MASK);
            ASSERT_TRUE(val == static_cast<int32_t>(transfer));
        }
        for (const auto range : i.ranges) {
            const auto val = static_cast<int32_t>(range) &
                             static_cast<int32_t>(common::Dataspace::RANGE_MASK);
            ASSERT_TRUE(val == static_cast<int32_t>(range));
        }
    }
}

TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation_BadDisplay) {