dix: Call SourceValidate before GetImage

Graphics / X.Org / X.Org Server - Adam Jackson [redhat.com] - 30 October 2019 16:26 EDT

This ensures that any prep work for the drawable we're about to read from is already done before we call down to GetImage. This should be no functional change as most of the callers with a non-trivial SourceValidate are already wrapping GetImage and doing the equivalent thing, but we'll be simplifying that shortly.

More importantly this ensures that if any of that prep work would generate events - like automatic compositing flushing rendering to a parent pixmap which then triggers damage - then it happens entirely before we start writing the GetImage reply header.

Note that we do not do the same for GetSpans, but that's okay. The only way to get to GetSpans is through miCopyArea or miCopyPlane - where the callers must already call SourceValidate - or miGetImage - which this commit now protects with SourceValidate.

Fixes: xorg/xserver#902

516e75dbb dix: Call SourceValidate before GetImage
Xext/panoramiXprocs.c | 10 ++++++++++
Xext/shm.c | 9 +++++++++
dix/dispatch.c | 5 ++++-
glx/glxdriswrast.c | 1 +
render/render.c | 5 +++++
5 files changed, 29 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share