[PATCH 6/6] glamor: Use Present to delay Xv painting to vblank interval

Keith Packard keithp at keithp.com
Thu Aug 7 09:57:43 PDT 2014


Michel Dänzer <michel at daenzer.net> writes:

> On 07.08.2014 14:21, Keith Packard wrote:

> The keyword being 'reduce'. This won't reliably prevent tearing in
> general, so I'm not sure I see the point of jumping through all those hoops.

If the GPU is idle at vblank time, then you'll reliably be able to queue
the Yuv to RGB conversion within the vblank interval and tearing won't
happen. In practice, this technique works quite well.

For non full-screen windows in non-composited environments, you want
this code anyways; page flipping that would be a bit of work.

> If glamor Xv used (something like) present_pixmap(), that would reliably
> prevent tearing at least in the fullscreen case, wouldn't it?

Yeah, converting Yuv to RGB and then using page flipping instead of
doing the conversion directly to the frame buffer would avoid needing
the GPU to be idle at vblank time. Might be worth an experiment.

In fact, a video player could easily do this itself with Xv and
Present. I should try hacking up a couple to see how hard it is.

> If you don't want any tearing ever, use a Wayland compositor? :)

Or any compositor -- note that if your X compositing manager doesn't
"unredirect" your video window, the Yuv to RGB conversion will be done
to the window buffer and the compositor will do it's usual tear-free
presentation.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140807/cf3b4aba/attachment-0001.sig>


More information about the xorg-devel mailing list