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

Commit f579ea47 authored by huans's avatar huans
Browse files

SetColorMode is not available for vendor hwc less than 1.4

Bug: 90510785
Test: VTS VtsHalGraphicsComposerV2_1Target SetColorMode(default) pass
Change-Id: Ia295b3ef2f0f433a7e1b5179eb230b8f7c649400
parent 4f0635a2
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -858,6 +858,7 @@ Error HWC2On1Adapter::Display::setColorMode(android_color_mode_t mode) {
        return Error::Unsupported;
    }

    if (mDevice.mHwc1MinorVersion >= 4) {
        uint32_t hwc1Config = 0;
        auto error = mActiveConfig->getHwc1IdForColorMode(mode, &hwc1Config);
        if (error != Error::None) {
@@ -865,12 +866,13 @@ Error HWC2On1Adapter::Display::setColorMode(android_color_mode_t mode) {
        }

        ALOGV("[%" PRIu64 "] Setting HWC1 config %u", mId, hwc1Config);
    int intError = mDevice.mHwc1Device->setActiveConfig(mDevice.mHwc1Device,
            mHwc1Id, 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;
    return Error::None;