Xv Xdbe combination

Michel Dänzer michel at daenzer.net
Wed Apr 14 03:12:09 PDT 2010


On Wed, 2010-04-14 at 10:27 +0200, Matthew Fincham wrote: 
> On 13-04-10 10:44, Michel Dänzer wrote:
> > On Mon, 2010-04-12 at 07:54 +0200, Matthew Fincham wrote:
> >    
> >> I am trying to display scaled video with text and pixmaps (amongst other
> >> things) "overlayed". I have Xv working, but when the overlay (to be
> >> clear, this is not an Xv overlay) is drawn the overlay flickers. So I
> >> need use Xv, but with double buffering.
> >>
> >> My first attempt was to use Xv to draw to a pixmap instead of a window,
> >> only to find out that Xv does not support this (at least it looks like
> >> the Intel driver doesn't support this).
> >>      
> > See https://bugs.freedesktop.org/show_bug.cgi?id=21143 . It shouldn't be
> > too hard to finish up the patches floating around for this, someone just
> > needs to do it
> 
> Hi Michel
> 
> Thank you for the reply - I appreciate the response. I have actually 
> already seen this patch and applied it, but this is what I found:
> 
>   - After applying the patch the request to display the XvImage results 
> in a BadMatch error. This error is generated by the modification to 
> xvmain.c that checks the drawable and adaptor type match.
>   - Leaving this check out results in X freezing.
>   - After checking the Intel driver I see that it is responsible for 
> setting the Xv adaptor type. Forcing it to be a pixmap also results in X 
> freezing (not surprisingly!)
> 
> Looking at xf86XVPutImage in xf86xv.c it looks like it relies on the 
> drawable being a Window, and simply removing the check that the drawable 
> is a Window (which is what the patch does) is not sufficient.
> 
> So I can see two issues:
>   - the Intel driver needs to export the adaptor type with XvPixmapMask 
> flag (or both XvPixmapMask and XvWindowMask flags, although I am not 
> sure if these are exclusive)

Setting XvPixmapMask as well as XvWindowMask should be fine for textured
(as opposed to overlay) adaptors.

> - Xorg needs to deal with the drawable not being a Window (in xf86xv.c)
> 
> Does anyone know if firstly, this is even possible,

I don't know of any reason why it wouldn't be.

> and secondly, how to go about doing this if it is possible.

Generally speaking, find all the relevant places which assume the
drawable is a window, and fix them up to handle pixmaps as well. Note
that there may be some in the drivers as well.

> I am happy to do it and test it, but I am going to need some guidance (!).

I'll do what I can, but please keep it on the list so others can
benefit / chime in.


Note that apparently clients won't be able to query if an adaptor
supports pixmaps, the only way will be to try it and handle the protocol
error if it fails. But I think this could still be a useful feature.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the xorg-devel mailing list