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.
wilder/Plasma/6.2
Vlad Zahorodnii 2 years ago
parent 5276801d5e
commit 1e7cfc1d19
  1. 1
      src/compositor_wayland.cpp

@ -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();

Loading…
Cancel
Save