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

Commit 1be9461f authored by huans's avatar huans Committed by android-build-merger
Browse files

Merge "SetColorMode is not available for vendor hwc less than 1.4" into pi-dev am: 308d3907

am: 715a9092

Change-Id: I24dd9cf4e36dc305fb3572e1f9abf353df67c5a4
parents 06b48a7c 715a9092
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;