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

Commit 90a75721 authored by Huihong Luo's avatar Huihong Luo Committed by Android (Google) Code Review
Browse files

Merge "SF: Remove the vsync method of communicating hotplug errors and enable...

Merge "SF: Remove the vsync method of communicating hotplug errors and enable the hal api path" into main
parents a4190b70 4ec5b29d
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -532,9 +532,6 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI
    mIgnoreHdrCameraLayers = ignore_hdr_camera_layers(false);

    // These are set by the HWC implementation to indicate that they will use the workarounds.
    mIsHotplugErrViaNegVsync =
            base::GetBoolProperty("debug.sf.hwc_hotplug_error_via_neg_vsync"s, false);

    mIsHdcpViaNegVsync = base::GetBoolProperty("debug.sf.hwc_hdcp_via_neg_vsync"s, false);
}

@@ -2172,15 +2169,6 @@ void SurfaceFlinger::onComposerHalVsync(hal::HWDisplayId hwcDisplayId, int64_t t
                                        std::optional<hal::VsyncPeriodNanos> vsyncPeriod) {
    if (FlagManager::getInstance().connected_display() && timestamp < 0 &&
        vsyncPeriod.has_value()) {
        // use ~0 instead of -1 as AidlComposerHal.cpp passes the param as unsigned int32
        if (mIsHotplugErrViaNegVsync && vsyncPeriod.value() == ~0) {
            const auto errorCode = static_cast<int32_t>(-timestamp);
            ALOGD("%s: Hotplug error %d for hwcDisplayId %" PRIu64, __func__, errorCode,
                  hwcDisplayId);
            mScheduler->dispatchHotplugError(errorCode);
            return;
        }

        if (mIsHdcpViaNegVsync && vsyncPeriod.value() == ~1) {
            const int32_t value = static_cast<int32_t>(-timestamp);
            // one byte is good enough to encode android.hardware.drm.HdcpLevel
+0 −1
Original line number Diff line number Diff line
@@ -1261,7 +1261,6 @@ private:
    };

    bool mIsHdcpViaNegVsync = false;
    bool mIsHotplugErrViaNegVsync = false;

    std::mutex mHotplugMutex;
    std::vector<HotplugEvent> mPendingHotplugEvents GUARDED_BY(mHotplugMutex);