Oleksiy Krivoshey <oleks...@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 pending commands to the previous context aren't
flushed when switching contexts after applying b4bb6680200.

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);
 



------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to