[PATCH 4/4] xf86/xv: Only register PostValidateTree hook when there is work to do

Pauli Nieminen ext-pauli.nieminen at nokia.com
Mon Jan 17 03:31:10 PST 2011


On 16/01/11 23:34 -0500, ext Adam Jackson wrote:
> On Jan 14, 2011, at 8:44 AM, Pauli wrote:
> 
> > @@ -1151,8 +1149,7 @@ xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind)
> >     if (ScreenPriv->PostValidateTree) {
> > 	pScreen->PostValidateTree = ScreenPriv->PostValidateTree;
> > 	(*pScreen->PostValidateTree)(pWin, pLayerWin, kind);
> > -	ScreenPriv->PostValidateTree = pScreen->PostValidateTree;
> > -	pScreen->PostValidateTree = xf86XVPostValidateTree;
> > +	ScreenPriv->PostValidateTree = NULL;
> >     }
> > }
> > 
> > @@ -1178,6 +1175,11 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
> > 
> >      pPriv->clipChanged = TRUE;
> > 
> > +     if (!ScreenPriv->PostValidateTree) {
> > +        ScreenPriv->PostValidateTree = pScreen->PostValidateTree;
> > +        pScreen->PostValidateTree = xf86XVPostValidateTree;
> > +     }
> > +
> >      WinPriv = WinPriv->next;
> >   }
> > 
> 
> I see what you're going for here but I'm a little nervous about this.  If some
> other layer wanted to rewrite the window tree without Xv knowing about it, they
> would have to know to unwrap/rewrap PostValidateTree around the calldown to
> ClipNotify.  That seems wrong, I can't think of any other examples where we
> break layering like that.
>
> - ajax
> 

I don't think these patches change anything how others layers can't prevent
Xv from knowing window tree changes. These patches only delay reput to
PostValidateTree from ClipNotify.

If some layer wraps ClipNotify hook and prevents Xv from getting ClipNotifies
then PostValidateTree won't do anything. pPriv->clipChanged is checked in
PostValidateTree if there is any work to do.

Pauli


More information about the xorg-devel mailing list