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

Commit 308d3907 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 3b50bd92 f579ea47
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;