[platforms/x11] Remove triple buffering detection

Authored by romangg on Aug 27 2019, 7:43 PM.



It is not clear what the advantage of triple buffering is for KWin. An X11
compositor is meant to swap buffers once every monitor cycle. For that triple
buffering is not necessary.

The functionality is not maintained, does not reliably work as displayed by
the existence of an environment variable to force some behavior, pollutes
our code and every compositing-related problem that might be mitigated with
triple buffering should find a simpler and more fitting solution with other

There is one caveat which is if we shall block for retrace. We set it
currently according to the result of the swap profiler and in the most common
case with double buffering it is set to true. But on Nvidia systems this might
be actual the wrong behavior. Instead of trying to work around this ignore
the issue for now and move the overall architecture to something less complex
by presenting after paint how we do it in the Wayland DRM backend and with
double buffering on GLX (although this is at the moment also borken because
we actually present then twice).

Test Plan

kwin_x11 tested on i915.

Diff Detail

R108 KWin
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
romangg created this revision.Aug 27 2019, 7:43 PM
Restricted Application added a project: KWin. · View Herald TranscriptAug 27 2019, 7:43 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Aug 27 2019, 7:43 PM
romangg edited the summary of this revision. (Show Details)Aug 27 2019, 8:16 PM

This code doesn't actually have anything to do with triple-buffering. Its sole function is to detect whether glXSwapBuffers() blocks; the (incorrect) assumption being that if it doesn't, then the driver uses triple-buffering.
But this information is only used to decide whether to call glXSwapBuffers() in prepareRenderingFrame() or endRenderingFrame(). KWin doesn't try to render more than one frame per swap interval regardless.

zzag accepted this revision.Aug 28 2019, 5:04 PM
zzag added a subscriber: zzag.
zzag added inline comments.

The most sensible thing here is just remove "triple buffering" part and keep only waitVideoSync, which is waitSync I guess.

This revision is now accepted and ready to land.Aug 28 2019, 5:04 PM
zzag added a comment.Aug 28 2019, 5:05 PM

Land this revision together with others.

romangg updated this revision to Diff 66532.Sep 20 2019, 10:40 AM

Rebase on master.

romangg updated this revision to Diff 68576.Oct 22 2019, 11:04 PM

Rebase on master.

This revision was automatically updated to reflect the committed changes.