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

Commit 784a8e79 authored by Ying Wei's avatar Ying Wei
Browse files

SF should use display fps and not vsync rate as refresh rate

Test: `adb shell dumpsys SurfaceFlinger | grep -E "VSYNC period|refresh-rate"`
BUG: 334740737
Change-Id: I77354db6351125f96cbb37e6e75877f533879952
parent ad2db94d
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -6876,24 +6876,23 @@ void SurfaceFlinger::dumpAll(const DumpArgs& args, const std::string& compositio
    StringAppendF(&result, "  transaction-flags         : %08x\n", mTransactionFlags.load());

    if (const auto display = getDefaultDisplayDeviceLocked()) {
        std::string fps, xDpi, yDpi;
        if (const auto activeModePtr =
                    display->refreshRateSelector().getActiveMode().modePtr.get()) {
            fps = to_string(activeModePtr->getVsyncRate());

        std::string peakFps, xDpi, yDpi;
        const auto activeMode = display->refreshRateSelector().getActiveMode();
        if (const auto activeModePtr = activeMode.modePtr.get()) {
            peakFps = to_string(activeMode.modePtr->getPeakFps());
            const auto dpi = activeModePtr->getDpi();
            xDpi = base::StringPrintf("%.2f", dpi.x);
            yDpi = base::StringPrintf("%.2f", dpi.y);
        } else {
            fps = "unknown";
            peakFps = "unknown";
            xDpi = "unknown";
            yDpi = "unknown";
        }
        StringAppendF(&result,
                      "  refresh-rate              : %s\n"
                      "  peak-refresh-rate         : %s\n"
                      "  x-dpi                     : %s\n"
                      "  y-dpi                     : %s\n",
                      fps.c_str(), xDpi.c_str(), yDpi.c_str());
                      peakFps.c_str(), xDpi.c_str(), yDpi.c_str());
    }

    StringAppendF(&result, "  transaction time: %f us\n", inTransactionDuration / 1000.0);