[Aidl graphics API] split dataspace array into tuples.

- update VTS test to make sure primaries/transfers/ranges bits are
  correct.

Bug: 242588489
Test: build and flash; atest VtsHalGraphicsComposer3_TargetTest

Change-Id: I77536d97b98e4dead208b7c8aeed9cfbb0d82316
This commit is contained in:
Sally Qi
2023-01-13 14:50:20 -08:00
parent 1ae586175d
commit c2c392fbea
3 changed files with 36 additions and 9 deletions

View File

@@ -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;
}
}

View File

@@ -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

View File

@@ -812,7 +812,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";
@@ -820,6 +820,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) {