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

Commit 5f975058 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I842e39c2,I5d92eae2 into main

* changes:
  SF: Generalize immediate mode set to multi-display
  SF: Clean up DisplayModeSwitchingTest
parents 4344b4d6 92900f81
Loading
Loading
Loading
Loading
+7 −16
Original line number Diff line number Diff line
@@ -1482,8 +1482,6 @@ void SurfaceFlinger::applyActiveMode(PhysicalDisplayId displayId) {
void SurfaceFlinger::initiateDisplayModeChanges() {
    SFTRACE_CALL();

    std::optional<PhysicalDisplayId> displayToUpdateImmediately;

    for (const auto& [displayId, physical] : FTL_FAKE_GUARD(mStateLock, mPhysicalDisplays)) {
        auto desiredModeOpt = mDisplayModeController.getDesiredMode(displayId);
        if (!desiredModeOpt) {
@@ -1537,15 +1535,7 @@ void SurfaceFlinger::initiateDisplayModeChanges() {
        if (outTimeline.refreshRequired) {
            scheduleComposite(FrameHint::kNone);
        } else {
            // TODO(b/255635711): Remove `displayToUpdateImmediately` to `finalizeDisplayModeChange`
            // for all displays. This was only needed when the loop iterated over `mDisplays` rather
            // than `mPhysicalDisplays`.
            displayToUpdateImmediately = displayId;
        }
    }

    if (displayToUpdateImmediately) {
        const auto displayId = *displayToUpdateImmediately;
            // HWC has requested to apply the mode change immediately rather than on the next frame.
            finalizeDisplayModeChange(displayId);

            const auto desiredModeOpt = mDisplayModeController.getDesiredMode(displayId);
@@ -1555,6 +1545,7 @@ void SurfaceFlinger::initiateDisplayModeChanges() {
            }
        }
    }
}

void SurfaceFlinger::disableExpensiveRendering() {
    const char* const whence = __func__;
+132 −143

File changed.

Preview size limit exceeded, changes collapsed.

+4 −5
Original line number Diff line number Diff line
@@ -22,14 +22,13 @@

namespace android::mock {

inline gui::DisplayModeSpecs createDisplayModeSpecs(DisplayModeId defaultMode,
                                                    bool allowGroupSwitching, float minFps,
                                                    float maxFps) {
inline gui::DisplayModeSpecs createDisplayModeSpecs(DisplayModeId defaultMode, Fps maxFps,
                                                    bool allowGroupSwitching = false) {
    gui::DisplayModeSpecs specs;
    specs.defaultMode = ftl::to_underlying(defaultMode);
    specs.allowGroupSwitching = allowGroupSwitching;
    specs.primaryRanges.physical.min = minFps;
    specs.primaryRanges.physical.max = maxFps;
    specs.primaryRanges.physical.min = 0.f;
    specs.primaryRanges.physical.max = maxFps.getValue();
    specs.primaryRanges.render = specs.primaryRanges.physical;
    specs.appRequestRanges = specs.primaryRanges;
    return specs;