mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "[HWC3.0] Add capability BOOT_DISPLAY_CONFIG" into tm-dev
This commit is contained in:
@@ -39,4 +39,5 @@ enum Capability {
|
||||
SKIP_CLIENT_COLOR_TRANSFORM = 2,
|
||||
PRESENT_FENCE_IS_NOT_RELIABLE = 3,
|
||||
SKIP_VALIDATE = 4,
|
||||
BOOT_DISPLAY_CONFIG = 5,
|
||||
}
|
||||
|
||||
@@ -57,4 +57,13 @@ enum Capability {
|
||||
* validateDisplay step is needed.
|
||||
*/
|
||||
SKIP_VALIDATE = 4,
|
||||
|
||||
/**
|
||||
* Specifies that the device supports setting a display configuration that
|
||||
* the device should boot at.
|
||||
* @see IComposerClient.setBootDisplayConfig
|
||||
* @see IComposerClient.clearBootDisplayConfig
|
||||
* @see IComposerClient.getPreferredBootDisplayConfig
|
||||
*/
|
||||
BOOT_DISPLAY_CONFIG = 5,
|
||||
}
|
||||
|
||||
@@ -590,6 +590,7 @@ interface IComposerClient {
|
||||
*
|
||||
* @exception EX_BAD_DISPLAY when an invalid display handle was passed in.
|
||||
* @exception EX_BAD_CONFIG when an invalid config id was passed in.
|
||||
* @exception EX_UNSUPPORTED when not supported by the underlying HAL
|
||||
*
|
||||
* @see getDisplayConfigs
|
||||
* @see clearBootDisplayConfig
|
||||
@@ -605,6 +606,7 @@ interface IComposerClient {
|
||||
* @param display is the display for which the cached boot config is cleared.
|
||||
*
|
||||
* @exception EX_BAD_DISPLAY when an invalid display handle was passed in.
|
||||
* @exception EX_UNSUPPORTED when not supported by the underlying HAL
|
||||
*
|
||||
* @see getDisplayConfigs
|
||||
* @see setBootDisplayConfig
|
||||
@@ -622,6 +624,7 @@ interface IComposerClient {
|
||||
* @return the implementation's preferred display config.
|
||||
*
|
||||
* @exception EX_BAD_DISPLAY when an invalid display handle was passed in.
|
||||
* @exception EX_UNSUPPORTED when not supported by the underlying HAL
|
||||
*
|
||||
* @see getDisplayConfigs
|
||||
* @see setBootDisplayConfig
|
||||
|
||||
@@ -495,6 +495,10 @@ TEST_P(GraphicsComposerAidlTest, SetActiveConfigWithConstraints_BadConfig) {
|
||||
}
|
||||
|
||||
TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadDisplay) {
|
||||
if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) {
|
||||
GTEST_SUCCEED() << "Boot Display Config not supported";
|
||||
return;
|
||||
}
|
||||
const auto& status = mComposerClient->setBootDisplayConfig(getInvalidDisplayId(), /*config*/ 0);
|
||||
|
||||
EXPECT_FALSE(status.isOk());
|
||||
@@ -502,6 +506,10 @@ TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadDisplay) {
|
||||
}
|
||||
|
||||
TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadConfig) {
|
||||
if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) {
|
||||
GTEST_SUCCEED() << "Boot Display Config not supported";
|
||||
return;
|
||||
}
|
||||
for (VtsDisplay& display : mDisplays) {
|
||||
int32_t constexpr kInvalidConfigId = IComposerClient::INVALID_CONFIGURATION;
|
||||
const auto& status =
|
||||
@@ -513,6 +521,10 @@ TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadConfig) {
|
||||
}
|
||||
|
||||
TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig) {
|
||||
if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) {
|
||||
GTEST_SUCCEED() << "Boot Display Config not supported";
|
||||
return;
|
||||
}
|
||||
const auto& [status, configs] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId());
|
||||
EXPECT_TRUE(status.isOk());
|
||||
for (const auto& config : configs) {
|
||||
@@ -521,6 +533,10 @@ TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig) {
|
||||
}
|
||||
|
||||
TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig_BadDisplay) {
|
||||
if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) {
|
||||
GTEST_SUCCEED() << "Boot Display Config not supported";
|
||||
return;
|
||||
}
|
||||
const auto& status = mComposerClient->clearBootDisplayConfig(getInvalidDisplayId());
|
||||
|
||||
EXPECT_FALSE(status.isOk());
|
||||
@@ -528,10 +544,18 @@ TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig_BadDisplay) {
|
||||
}
|
||||
|
||||
TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig) {
|
||||
if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) {
|
||||
GTEST_SUCCEED() << "Boot Display Config not supported";
|
||||
return;
|
||||
}
|
||||
EXPECT_TRUE(mComposerClient->clearBootDisplayConfig(getPrimaryDisplayId()).isOk());
|
||||
}
|
||||
|
||||
TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig_BadDisplay) {
|
||||
if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) {
|
||||
GTEST_SUCCEED() << "Boot Display Config not supported";
|
||||
return;
|
||||
}
|
||||
const auto& [status, _] = mComposerClient->getPreferredBootDisplayConfig(getInvalidDisplayId());
|
||||
|
||||
EXPECT_FALSE(status.isOk());
|
||||
@@ -539,6 +563,10 @@ TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig_BadDisplay) {
|
||||
}
|
||||
|
||||
TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig) {
|
||||
if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) {
|
||||
GTEST_SUCCEED() << "Boot Display Config not supported";
|
||||
return;
|
||||
}
|
||||
const auto& [status, preferredDisplayConfig] =
|
||||
mComposerClient->getPreferredBootDisplayConfig(getPrimaryDisplayId());
|
||||
EXPECT_TRUE(status.isOk());
|
||||
@@ -549,6 +577,26 @@ TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig) {
|
||||
EXPECT_NE(configs.end(), std::find(configs.begin(), configs.end(), preferredDisplayConfig));
|
||||
}
|
||||
|
||||
TEST_P(GraphicsComposerAidlTest, BootDisplayConfig_Unsupported) {
|
||||
if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) {
|
||||
const auto& [configStatus, config] =
|
||||
mComposerClient->getActiveConfig(getPrimaryDisplayId());
|
||||
EXPECT_TRUE(configStatus.isOk());
|
||||
|
||||
auto status = mComposerClient->setBootDisplayConfig(getPrimaryDisplayId(), config);
|
||||
EXPECT_FALSE(status.isOk());
|
||||
EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError());
|
||||
|
||||
status = mComposerClient->getPreferredBootDisplayConfig(getPrimaryDisplayId()).first;
|
||||
EXPECT_FALSE(status.isOk());
|
||||
EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError());
|
||||
|
||||
status = mComposerClient->clearBootDisplayConfig(getPrimaryDisplayId());
|
||||
EXPECT_FALSE(status.isOk());
|
||||
EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError());
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(GraphicsComposerAidlTest, SetAutoLowLatencyMode_BadDisplay) {
|
||||
auto status = mComposerClient->setAutoLowLatencyMode(getInvalidDisplayId(), /*isEnabled*/ true);
|
||||
EXPECT_FALSE(status.isOk());
|
||||
|
||||
Reference in New Issue
Block a user