Details

QtQuick windows created by KWin currently use the default swap interval of 1,
meaning buffer swaps will block until vblank. However, this results in a problematic
interaction on hybrid graphics systems running the proprietary NVIDIA driver.
VSync on such setups relies on a system called "PRIME synchronization", where
the xf86-video-modesetting driver controlling the display will signal the NVIDIA
driver when vblank has occurred. The issue is that it will only do so if there has been
damage to the screen.

So, when KWin creates a QtQuick window, compositing will stop waiting on the
window to render, therefore no damage to the screen will occur. But this means
that no vblank notifications will be delivered to the NVIDIA driver, so the glXSwapBuffers
call by the QtQuick window will block perpetually. The end result is a freeze of the
desktop.

To get around this, we can simply disable vsync for QtQuick windows by setting the
swap interval for the default QSurfaceFormat to 0. Since they are redirected, this
shouldn't cause any tearing.

There was mention of switching QtQuick to use SW rendering on PRIME systems, would that be preferable to reverting the tearing fix?
I just learned that RandR will report a property named "PRIME Synchronization" for any affected outputs, so it should actually be easier than I originally thought to detect. Just need to call XRRListOutputProperies (or whatever the xcb equivalent is).
I can try to get a quick patch up for review if so.