diff options
author | Neha Bhende <bhenden@vmware.com> | 2016-06-28 12:59:19 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2016-06-30 12:45:09 -0600 |
commit | 7988513ac3d86ba367fbe44e73fe483ff96aaa29 (patch) | |
tree | 11d834c70c72821dd33098b7fbb3152f3364bddc | |
parent | 52f297d144de69d494b5573920c33902063d3628 (diff) | |
download | external_mesa3d-7988513ac3d86ba367fbe44e73fe483ff96aaa29.zip external_mesa3d-7988513ac3d86ba367fbe44e73fe483ff96aaa29.tar.gz external_mesa3d-7988513ac3d86ba367fbe44e73fe483ff96aaa29.tar.bz2 |
svga: Fix failures caused in fedora 24
SVGA_3D_CMD_DX_GENRATE_MIPMAP & SVGA_3D_CMD_DX_SET_PREDICATION commands
are not presents in fedora 24 kernel module. Because of this
reason application like supertuxkart are not running.
v2: Add few comments and code modifications suggested by Brian P.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
-rw-r--r-- | src/gallium/drivers/svga/svga_pipe_query.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_screen.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_winsys.h | 3 | ||||
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_screen_ioctl.c | 11 |
4 files changed, 26 insertions, 6 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_query.c b/src/gallium/drivers/svga/svga_pipe_query.c index 4febf9b..65e58fe 100644 --- a/src/gallium/drivers/svga/svga_pipe_query.c +++ b/src/gallium/drivers/svga/svga_pipe_query.c @@ -1219,13 +1219,19 @@ svga_render_condition(struct pipe_context *pipe, struct pipe_query *q, sws->fence_finish(sws, sq->fence, SVGA_FENCE_FLAG_QUERY); } } - - ret = SVGA3D_vgpu10_SetPredication(svga->swc, queryId, - (uint32) condition); - if (ret != PIPE_OK) { - svga_context_flush(svga, NULL); + /* + * if the kernel module doesn't support the predication command, + * we'll just render unconditionally. + * This is probably acceptable for the typical case of occlusion culling. + */ + if (sws->have_set_predication_cmd) { ret = SVGA3D_vgpu10_SetPredication(svga->swc, queryId, (uint32) condition); + if (ret != PIPE_OK) { + svga_context_flush(svga, NULL); + ret = SVGA3D_vgpu10_SetPredication(svga->swc, queryId, + (uint32) condition); + } } } diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index 4c2774d..b2b3420 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -320,7 +320,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param) return 1; /* may be a sw fallback, depending on restart index */ case PIPE_CAP_GENERATE_MIPMAP: - return sws->have_vgpu10; + return sws->have_generate_mipmap_cmd; /* Unsupported features */ case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION: diff --git a/src/gallium/drivers/svga/svga_winsys.h b/src/gallium/drivers/svga/svga_winsys.h index 7da2c4e..b96a8e4 100644 --- a/src/gallium/drivers/svga/svga_winsys.h +++ b/src/gallium/drivers/svga/svga_winsys.h @@ -544,6 +544,9 @@ struct svga_winsys_screen /** To rebind resources at the beginnning of a new command buffer */ boolean need_to_rebind_resources; + + boolean have_generate_mipmap_cmd; + boolean have_set_predication_cmd; }; diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c index 7fc93e7..1740d1a 100644 --- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c +++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c @@ -1022,6 +1022,17 @@ vmw_ioctl_init(struct vmw_winsys_screen *vws) " (%i, %s).\n", ret, strerror(-ret)); goto out_no_caps; } + + if (((version->version_major == 2 && version->version_minor >= 10) + || version->version_major > 2) && vws->base.have_vgpu10) { + + /* support for these commands didn't make it into vmwgfx kernel + * modules before 2.10. + */ + vws->base.have_generate_mipmap_cmd = TRUE; + vws->base.have_set_predication_cmd = TRUE; + } + free(cap_buffer); drmFreeVersion(version); vmw_printf("%s OK\n", __FUNCTION__); |