[PATCH] composite: Wrap GetSpans

Adam Jackson ajax at redhat.com
Thu Oct 23 10:41:49 PDT 2014


On Wed, 2014-10-22 at 13:37 -0700, Keith Packard wrote:
> Adam Jackson <ajax at redhat.com> writes:
> 
> > GetSpans should flush composition from children to parent, just like
> > GetImage and SourceValidate.  Fortunately no one is likely to have
> > noticed, since to hit this you're already deep into failure town.
> 
> In the core server code, GetSpans is only used for miCopyArea,
> miCopyPlane, miGetImage and miPushPixels. miPushPixels isn't relevant as
> it is only ever used to read from pixmaps. The others are already
> covered by the existing SourceValidate and GetImage wrappers.

I'm not sure this is true?  ProcCopyArea doesn't call SourceValidate.
fbCopyArea does (by way of miDoCopy), but miCopyArea does not, in fact
there's no calls to SourceValidate in mibitblt at all.  So if you found
yourself on the span routines and wanted to take a screenshot, GetImage
would work (because composite wraps it) but CopyArea to a shm pixmap
would not, the child-to-parent paint wouldn't get triggered and you'd
get stale contents.

If we fixed mibitblt (and fbGetImage) to call SourceValidate, then I
think we could remove misprite's GetImage and GetSpans wrappers, since
SourceValidate would be sufficient.  And I think we could remove
compGetImage too for the same reason.  I guess we could argue about
whether to do the SourceValidate at the top in dix or at the bottom in
mi/fb/etc.

Obviously this wouldn't address the other direction of rendering with
IncludeInferiors to a redirected child, but it'd still be bugfix by
deletion.

- ajax



More information about the xorg-devel mailing list