Fix directScanout getting shadowed

Amends 7ab825cba1.

This shadow "directScanout" variable breaks

    if (!directScanout) {
        if (!m_backend->present(output, frame)) {
            m_backend->repairPresentation(output);
        }
    }

which can result in present() function getting called twice with the
same `OutputFrame` object: first, at line 359, and the second time at
line 386. That, in its turn, would queue two drm commit objects with
the same OutputFrame and then the behavior is undefined.
This commit is contained in:
Vlad Zahorodnii 2024-08-25 15:41:00 +00:00
parent 5276801d5e
commit 1e7cfc1d19

View file

@ -336,7 +336,6 @@ void WaylandCompositor::composite(RenderLoop *renderLoop)
frame->setPresentationMode(tearing ? PresentationMode::Async : PresentationMode::VSync);
}
bool directScanout = false;
const uint32_t planeCount = 1;
if (const auto scanoutCandidates = superLayer->delegate()->scanoutCandidates(planeCount + 1); !scanoutCandidates.isEmpty()) {
const auto sublayers = superLayer->sublayers();