[Mesa-stable] [Mesa-dev] [PATCH] dri3/GLX: Fix drawable invalidation
Michel Dänzer
michel at daenzer.net
Tue Jun 6 08:56:57 UTC 2017
On 01/06/17 07:13 PM, Thomas Hellstrom wrote:
> A number of internal VMware apitrace traces image comparisons fail with
> dri3 because the viewport transformation becomes incorrect after an X
> drawable resize. The incorrect viewport transformation sometimes persist
> until the second draw-call after a swapBuffer.
>
> Comparing with the dri2 glx code there are a couple of places where dri2
> invalidates the drawable in the absence of server-triggered invalidation,
> where dri3 doesn't do that. When these invalidation points are added to
> dri3, the image comparisons become correct.
>
> Cc: <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
> ---
> src/glx/dri3_glx.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c
> index 4264fd8..7732279 100644
> --- a/src/glx/dri3_glx.c
> +++ b/src/glx/dri3_glx.c
> @@ -235,6 +235,11 @@ dri3_bind_context(struct glx_context *context, struct glx_context *old,
> if (!(*psc->core->bindContext) (pcp->driContext, dri_draw, dri_read))
> return GLXBadContext;
>
> + if (dri_draw)
> + (*psc->f->invalidate)(dri_draw);
> + if (dri_read)
Make this
if (dri_read && dri_read != dri_draw)
to match dri2_bind_context.
> + (*psc->f->invalidate)(dri_read);
> +
> return Success;
> }
>
> @@ -493,6 +498,7 @@ dri3_flush_front_buffer(__DRIdrawable *driDrawable, void *loaderPrivate)
>
> loader_dri3_flush(draw, __DRI2_FLUSH_DRAWABLE, __DRI2_THROTTLE_FLUSHFRONT);
>
> + (*psc->f->invalidate)(driDrawable);
> loader_dri3_wait_gl(draw);
> }
>
>
Looks like a good catch. With the above fixed,
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer at amd.com>
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the mesa-stable
mailing list