mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 21:37:44 +00:00
Merge "SetColorMode is not available for vendor hwc less than 1.4" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
308d390720
@@ -858,18 +858,20 @@ Error HWC2On1Adapter::Display::setColorMode(android_color_mode_t mode) {
|
||||
return Error::Unsupported;
|
||||
}
|
||||
|
||||
uint32_t hwc1Config = 0;
|
||||
auto error = mActiveConfig->getHwc1IdForColorMode(mode, &hwc1Config);
|
||||
if (error != Error::None) {
|
||||
return error;
|
||||
}
|
||||
if (mDevice.mHwc1MinorVersion >= 4) {
|
||||
uint32_t hwc1Config = 0;
|
||||
auto error = mActiveConfig->getHwc1IdForColorMode(mode, &hwc1Config);
|
||||
if (error != Error::None) {
|
||||
return error;
|
||||
}
|
||||
|
||||
ALOGV("[%" PRIu64 "] Setting HWC1 config %u", mId, hwc1Config);
|
||||
int intError = mDevice.mHwc1Device->setActiveConfig(mDevice.mHwc1Device,
|
||||
mHwc1Id, hwc1Config);
|
||||
if (intError != 0) {
|
||||
ALOGE("[%" PRIu64 "] Failed to set HWC1 config (%d)", mId, intError);
|
||||
return Error::Unsupported;
|
||||
ALOGV("[%" PRIu64 "] Setting HWC1 config %u", mId, hwc1Config);
|
||||
int intError =
|
||||
mDevice.mHwc1Device->setActiveConfig(mDevice.mHwc1Device, mHwc1Id, hwc1Config);
|
||||
if (intError != 0) {
|
||||
ALOGE("[%" PRIu64 "] Failed to set HWC1 config (%d)", mId, intError);
|
||||
return Error::Unsupported;
|
||||
}
|
||||
}
|
||||
|
||||
mActiveColorMode = mode;
|
||||
|
||||
Reference in New Issue
Block a user