D23105: WIP: [platforms/x11] Cleanup GLX backend
Roman Gilg
noreply at phabricator.kde.org
Mon Aug 12 02:05:17 BST 2019
romangg created this revision.
romangg added a reviewer: KWin.
Herald added a project: KWin.
Herald added a subscriber: kwin.
romangg requested review of this revision.
REVISION SUMMARY
This is an early WIP of the GLX backend. I go through that with a chainsaw
at the moment and hope for some feedback by people knowing all the history
about it and stop me before accidentally cutting off the branch we are
sitting on. ;)
Overall goals:
- Make the code less convoluted.
- Sync paint with vblanks if extensions required for that are available
- Reduce delay by pushing paint to end of vblank cycle, see [1].
Currently doing:
- Remove triple buffering. A compositor does not need this when it doesn't screw up in some other way.
- Replace GLX_MESA_, GLX_EXT_. and GLX_SGI_swap_control with GLX_OML_sync_control only, since this is the standard nowadays and we don't need to optimize for every legacy X device in the world.
- Remove blocksForRetrace, instead use the Intel swap event or glFinish to sync with vblank. glFinish should block till vblank, see [2][3].
- In endRenderingFrame don't present a second time. Why was it there in the first place?
Open questions:
- Is glFinish really blocking till vblank? X Present extension provides events to get notified about vblank, but since we channel through GLX this is not available directly to my knowledge. So it's kind of weird that there is only the Intel swap event to wrap that behavior explicitly.
- Compositor has a compositing timer. It seems we always wait for it, but if we sync with vblank there is no reason to do it this way. Instead only use is as a fallback in case sync with vblank is not supported?
[1] https://ppaalanen.blogspot.com/2015/02/weston-repaint-scheduling.html
[2] https://www.khronos.org/opengl/wiki/Swap_Interval
[3] https://github.com/tildearrow/kwin-lowlatency#background
TEST PLAN
kwin_x11 --replace works with and without setting KWIN_USE_INTEL_SWAP_EVENT
to 1.
I haven't yet tested it on AMD and analyzed it with GPUvis what I want to do
next.
REPOSITORY
R108 KWin
BRANCH
glxCleanup
REVISION DETAIL
https://phabricator.kde.org/D23105
AFFECTED FILES
plugins/platforms/x11/standalone/glxbackend.cpp
plugins/platforms/x11/standalone/glxbackend.h
To: romangg, #kwin
Cc: kwin, LeGast00n, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20190812/a437af40/attachment-0001.html>
More information about the kwin
mailing list