Mesa (master): svga: check svga_have_vgpu10() in svga_delete_blend_state()

Brian Paul brianp at kemper.freedesktop.org
Fri Mar 2 19:31:58 UTC 2018


Module: Mesa
Branch: master
Commit: b871a77316f301ae0262fb38036e3583c2a464c8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b871a77316f301ae0262fb38036e3583c2a464c8

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Feb 22 13:22:11 2018 -0700

svga: check svga_have_vgpu10() in svga_delete_blend_state()

We were calling SVGA3D_vgpu10_DestroyBlendState() when vgpu10 was not
enabled (bs->id==0 by default), resulting in lots of device errors.

Reviewed-by: Neha Bhende<bhenden at vmware.com>

---

 src/gallium/drivers/svga/svga_pipe_blend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_blend.c b/src/gallium/drivers/svga/svga_pipe_blend.c
index a29fbd3ac2..04855fa7c9 100644
--- a/src/gallium/drivers/svga/svga_pipe_blend.c
+++ b/src/gallium/drivers/svga/svga_pipe_blend.c
@@ -361,7 +361,7 @@ static void svga_delete_blend_state(struct pipe_context *pipe,
    struct svga_blend_state *bs =
       (struct svga_blend_state *) blend;
 
-   if (bs->id != SVGA3D_INVALID_ID) {
+   if (svga_have_vgpu10(svga) && bs->id != SVGA3D_INVALID_ID) {
       enum pipe_error ret;
 
       ret = SVGA3D_vgpu10_DestroyBlendState(svga->swc, bs->id);




More information about the mesa-commit mailing list