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

Commit ac2bf48e authored by Ady Abraham's avatar Ady Abraham
Browse files

SF: update scheduler's RefreshRateConfigs on hotplugs

We may receive hotplug event on the primary display (mostly on
Android TVs), and we should update the Scheduler with the new dipslay
information.

Test: com.android.devicehealthchecks.SystemCheck
Bug: 194157853
Change-Id: I82e64ee002475cdba70e9cb369c388290e667bdf
parent 5be37afd
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -3124,9 +3124,11 @@ void SurfaceFlinger::triggerOnFrameRateOverridesChanged() {

void SurfaceFlinger::initScheduler(const sp<DisplayDevice>& display) {
    if (mScheduler) {
        // In practice it's not allowed to hotplug in/out the primary display once it's been
        // connected during startup, but some tests do it, so just warn and return.
        ALOGW("Can't re-init scheduler");
        // If the scheduler is already initialized, this means that we received
        // a hotplug(connected) on the primary display. In that case we should
        // update the scheduler with the most recent display information.
        ALOGW("Scheduler already initialized, updating instead");
        mScheduler->setRefreshRateConfigs(display->holdRefreshRateConfigs());
        return;
    }
    const auto currRefreshRate = display->getActiveMode()->getFps();