[Mesa-dev] [PATCH] fix regression caused by b4bb6680200b5a898583392f4c831c02f41e63f7

Xiang, Haihao haihao.xiang at intel.com
Tue Nov 9 16:25:19 PST 2010


Any comment? If no problem, I will check in this fix.

Thanks
Haihao

> Oleksiy Krivoshey <oleksiyk at gmail.com> reported commit
> b4bb6680200b5a898583392f4c831c02f41e63f7(dri: Unset current context and
> dispatch table when unbinding) causes a regression when he used vaapi
> with OpenGL render output on Ironlake. 
> 
> See: http://lists.freedesktop.org/archive...er/000380.html 
> 
> The root cause is that all pending commands to the previous context aren't
> flushed when switching contexts after applying this commit.
> 
> The following patch can fix this issue, I am not sure whether
> nouveau/radeon/swrast need a similar fix.
> 
> diff --git a/src/mesa/drivers/dri/intel/intel_context.c
> b/src/mesa/drivers/dri/intel/intel_context.c
> index de4bcde..9835540 100644
> --- a/src/mesa/drivers/dri/intel/intel_context.c
> +++ b/src/mesa/drivers/dri/intel/intel_context.c
> @@ -891,6 +891,18 @@ intelDestroyContext(__DRIcontext * driContextPriv)
>  GLboolean
>  intelUnbindContext(__DRIcontext * driContextPriv)
>  {
> +   struct intel_context *intel;
> +   GET_CURRENT_CONTEXT(curCtx);
> +
> +   if (driContextPriv)
> +      intel = (struct intel_context *) driContextPriv->driverPrivate;
> +   else
> +      intel = NULL;
> +
> +   if (intel_context(curCtx) && intel_context(curCtx) == intel) {
> +      _mesa_flush(curCtx);
> +   }
> +
>     /* Unset current context and dispath table */
>     _mesa_make_current(NULL, NULL, NULL);
>  
> 
> 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev




More information about the mesa-dev mailing list