[Mesa-dev] [PATCH] svga: fix sid corruption in vmw_drm_surface_from_handle()

danielx.j.van.der.wath at intel.com danielx.j.van.der.wath at intel.com
Tue Feb 3 07:16:51 PST 2015

From: Daniel van der Wath <danielx.j.van.der.wath at intel.com>

The value stored in "handle" is trashed before being copied into the
surface's sid. Use the original value from "whandle->handle" instead.
This fixes a bug with Weston running on VMWare, where SVGA3D_SetRenderTarget()
would fail and prevent anything from being drawn on screen.

Reviewed-by: Satyeshwar Singh <satyeshwar.singh at intel.com>
 src/gallium/winsys/svga/drm/vmw_screen_dri.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/winsys/svga/drm/vmw_screen_dri.c b/src/gallium/winsys/svga/drm/vmw_screen_dri.c
index 79a1b3e..0f796c4 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_dri.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_dri.c
@@ -319,7 +319,7 @@ vmw_drm_surface_from_handle(struct svga_winsys_screen *sws,
     pipe_reference_init(&vsrf->refcnt, 1);
     p_atomic_set(&vsrf->validated, 0);
     vsrf->screen = vws;
-    vsrf->sid = handle;
+    vsrf->sid = whandle->handle;
     ssrf = svga_winsys_surface(vsrf);
     *format = rep->format;

More information about the mesa-dev mailing list