[PATCH 4/4] xf86/xv: Only register PostValidateTree hook when there is work to do
Adam Jackson
ajax at nwnk.net
Sun Jan 16 20:34:34 PST 2011
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
More information about the xorg-devel
mailing list