Commit 58cb4de1 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

platforms/drm: Present buffers even if nothing has been changed

We want to get notified when the next page flip occurs. The problem is
that kwin will avoid queueing a page flip if nothing has been changed on
the screen. From performance point of view, that is expected behavior,
but for frame scheduling and some wayland clients that create frame
callbacks to get notified about the next vblank, it's not suitable.
parent ef6fa25d
......@@ -667,25 +667,10 @@ void EglGbmBackend::endFrame(int screenId, const QRegion &renderedRegion,
Output &output = m_outputs[screenId];
renderFramebufferToSurface(output);
const QRegion dirty = damagedRegion.intersected(output.output->geometry());
if (dirty.isEmpty()) {
// If the damaged region of a window is fully occluded, the only
// rendering done, if any, will have been to repair a reused back
// buffer, making it identical to the front buffer.
//
// In this case we won't post the back buffer. Instead we'll just
// set the buffer age to 1, so the repaired regions won't be
// rendered again in the next frame.
if (!renderedRegion.intersected(output.output->geometry()).isEmpty())
glFlush();
output.bufferAge = 1;
return;
}
presentOnOutput(output, damagedRegion);
if (supportsBufferAge()) {
const QRegion dirty = damagedRegion.intersected(output.output->geometry());
if (output.damageHistory.count() > 10) {
output.damageHistory.removeLast();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment