nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   Why can't we have composite with overlay? (http://www.nvnews.net/vbulletin/showthread.php?t=149776)

davelaser 04-06-10 01:17 PM

Why can't we have composite with overlay?
 
Why isn't it allowed to have the X composite extension turned on and overlay support in the nvidia driver?

Doesn't the overlay hardware just read the framebuffer and put the video where it sees a certain keycolour? Admittedly with composite and transparency you might get some funny effects over the video sometimes but I can't see any technical reason why it wouldn't work. And it would allow perfect vsync in a composite environment (which isn't currently possible at all).

Am I missing something here?

Dragoran 04-06-10 03:35 PM

Re: Why can't we have composite with overlay?
 
Quote:

Originally Posted by davelaser (Post 2227642)
Why isn't it allowed to have the X composite extension turned on and overlay support in the nvidia driver?

Doesn't the overlay hardware just read the framebuffer and put the video where it sees a certain keycolour? Admittedly with composite and transparency you might get some funny effects over the video sometimes but I can't see any technical reason why it wouldn't work. And it would allow perfect vsync in a composite environment (which isn't currently possible at all).

Am I missing something here?

Well because the overlay can't be redirected and therefore bypasses the CM completely, which would just end up creating visual artifacts.

VSYNC should be possible using any opengl based CM like compiz or mutter "isn't currently possible at all" is just wrong ... it works just fine, if it doesn't it is likely a configuration issue.

davelaser 04-06-10 05:06 PM

Re: Why can't we have composite with overlay?
 
Quote:

Originally Posted by Dragoran (Post 2227789)
Well because the overlay can't be redirected and therefore bypasses the CM completely, which would just end up creating visual artifacts.

VSYNC should be possible using any opengl based CM like compiz or mutter "isn't currently possible at all" is just wrong ... it works just fine, if it doesn't it is likely a configuration issue.

Hmm. Even with proper configuration with compiz I still get the odd tear now and then. Admittedly it has got a lot better with recent driver/compiz releases.

You would get some visual glitches when moving/scaling windows but for a static window just sitting there it would work ok. It would also allow vsync on more than one monitor at a time.

Stephen Warren 04-06-10 06:02 PM

Re: Why can't we have composite with overlay?
 
I'm assuming you're talking about VDPAU.

What Dragoran says is true; overlay and redirected (i.e. composited) windows simply don't make logical sense together.

VDPAU currently prohibits overlay use whenever the X composite extension is enabled, irrespective of whether the VDPAU presentation window is actually redirected. This is because windows can be dynamically redirected/unredirected, and VDPAU can't dynamically switch between using the overlay and blitting. Having the X composite extension enabled is the default, I believe, in recent times. Consequently, one has to manually configure systems to disable the X composite extension to get the overlay presentation queue. We're putting some thought into removing this restriction, so that overlay can be used when the X composite extension is enabled, but the window is not currently redirected (i.e. compiz/desktop effects are not enabled). That said, I'm not sure exactly how useful that'll be, since I think full compiz is also the default in many cases, which would still prevent overlay use.

Also, the way X protocols are currently defined, there's no way for an application to say "I'm done rendering a frame", and synchronize with the composite manager before continuing to render. This means that sometimes the composite manager may only start reading the window's content after the application has started drawing the next frame, which will lead to tearing. Depending on your exact HW/SW configuration, I believe it's possible for NVIDIA GL's sync-to-vblank (i.e. compiz's rendering) to tear too.

davelaser 04-07-10 12:23 PM

Re: Why can't we have composite with overlay?
 
Quote:

Originally Posted by Stephen Warren (Post 2227937)
Also, the way X protocols are currently defined, there's no way for an application to say "I'm done rendering a frame", and synchronize with the composite manager before continuing to render. This means that sometimes the composite manager may only start reading the window's content after the application has started drawing the next frame, which will lead to tearing. Depending on your exact HW/SW configuration, I believe it's possible for NVIDIA GL's sync-to-vblank (i.e. compiz's rendering) to tear too.

Could this functionality be added to X via some sort of extension? I'm sure the open source driver guys must have the same problem.

AaronP 04-07-10 02:09 PM

Re: Why can't we have composite with overlay?
 
Yes, we proposed an extension to solve this problem at the last X Developers' Conference. However, it's a lot of work and so far it hasn't gained much traction.

Ahmad Samir 06-16-10 06:33 PM

Re: Why can't we have composite with overlay?
 
Quote:

Originally Posted by Stephen Warren (Post 2227937)
We're putting some thought into removing this restriction, so that overlay can be used when the X composite extension is enabled, but the window is not currently redirected (i.e. compiz/desktop effects are not enabled). That said, I'm not sure exactly how useful that'll be, since I think full compiz is also the default in many cases, which would still prevent overlay use.

Well, not exactly. For example with kde4.4 (didn't test with older versions), if I disable the X composite extension I sometimes get some artefacts on the panel due to plasma animations when closing/opening apps; I've not found a way to disable those animations.

Also it seems I only get "tearing" with .avi files, not with HD/h264 or .vob files.

ugtar 08-02-10 08:54 PM

Re: Why can't we have composite with overlay?
 
Quote:

Originally Posted by AaronP (Post 2228503)
Yes, we proposed an extension to solve this problem at the last X Developers' Conference. However, it's a lot of work and so far it hasn't gained much traction.

This seems like a pretty serious shortcoming that will only get worse as time goes on and more and more distros add compositing window managers as the default. Obviously, the Composite extension can simply be disabled, but there remains the issue that people want to have it on for the simple fact that they like what it provides.

Can you provide any further details about this mysterious extension? What does it do, or how does it work?

AaronP 08-03-10 12:41 AM

Re: Why can't we have composite with overlay?
 
James made some slides for XDevConf. See the presentation parts of this slide deck: http://people.freedesktop.org/~aplat...ronization.pdf

ugtar 08-03-10 12:27 PM

Re: Why can't we have composite with overlay?
 
Awesome, thanks for that. Is that James Jones?

hl_ 08-03-10 03:18 PM

Re: Why can't we have composite with overlay?
 
Quote:

Originally Posted by Dragoran (Post 2227789)
VSYNC should be possible using any opengl based CM like compiz or mutter "isn't currently possible at all" is just wrong ... it works just fine, if it doesn't it is likely a configuration issue.

It is possible to *mostly* avoid tearing by configuring the compositing manager correctly, but *completely* avoiding it is not possible. That is due to various X protocol limitations.

AaronP 08-03-10 08:09 PM

Re: Why can't we have composite with overlay?
 
Quote:

Originally Posted by ugtar (Post 2297108)
Awesome, thanks for that. Is that James Jones?

Yes.


All times are GMT -5. The time now is 12:22 PM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.