[RFC][PATCH] dix/composite: Update windows with automatically redirected children on demand

Ville Syrjälä ville.syrjala at nokia.com
Mon Dec 27 10:45:39 PST 2010


On Mon, Dec 27, 2010 at 10:25:17AM -0800, ext Keith Packard wrote:
> On Mon, 27 Dec 2010 15:27:10 +0200, ville.syrjala at nokia.com wrote:
> 
> > So every time that the parent window's contents are expected to be
> > up to date, the contents of the children should be copied immediately
> > to the parent.
> 
> When using the parent as a source operand, this looks like a useful
> change. However, when using it as a rendering target, any drawing will
> be immediately overwritten with the next drawing by the application
> unless the parent contents were copied back to the child.

Could be overwritten fully, partially, or not at all, depending on
the operation and GC clipping, I suppose? If any part of it gets
overwritten it still seems better to copy from the child first,
otherwise the last rendering results can get overwritten by the
composite block handler.

BTW isn't the current backing store implementation simply broken if
someone renders with IncludeInferiors to the parent? There's no copy
from the parent to the child's backing store.

> So, I'd say we should look only at cases where we use the window
> contents as a rendering source and ignore any rendering target
> operations.
> 
> > Instead of trying to identify all parts of the code that have that
> > requirement, add a simple hook into NotClippedByChildren(), which can
> > perform the update process. Hopefully that should cover most of the
> > cases, if not all of them.
> 
> It would be nice if this could work, but it's almost entirely
> inaccurate:
> 
>  1) GetImage doesn't use NCBC

How odd. My test app uses GetImage and it got fixed by this. I'll have
to check what's going on there.

>  2) CopyArea doesn't use NCBC when copying from the Root
>  3) CopyArea doesn't use NCBC when copying from self
>  4) ValidateGC/ValidatePicture use NCBC only when the clip may have changed
> 
> This seems like a job for the existing SourceValidate hook, which gets
> called for CopyArea when src != dst (and also when src == dst when
> damage is running), and also is called for Composite (all of the time).
> 
> (There aren't any out-of-tree callers to SourceValidate today, so we can
> actually just fix the existing bug where damage calls SourceValidate
> sometimes to patch-up the missing calls from CopyArea.)
> 
> I'd say a combination of SourceValidate and GetImage wrappers would do
> the trick nicely here.
> 
> -- 
> keith.packard at intel.com

-- 
Ville Syrjälä


More information about the xorg-devel mailing list