aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/amdgpu
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-08-24 21:06:18 +1000
committerTimothy Arceri <[email protected]>2018-08-30 07:57:38 +1000
commit5566dd8a617cd6f90ceabb6ab5f94aa2996f0fbd (patch)
tree7b08f9576ee1becb1421f68afc648218a728f6e4 /src/gallium/winsys/amdgpu
parent406c3d748dac294e5c453eed7618a22d5d2cc0df (diff)
radeonsi: add radeonsi_zerovram driconfig option
More and more games seem to require this so lets make it a config option. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/winsys/amdgpu')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index 882f500bc69..dcbc075e3c5 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -32,6 +32,7 @@
#include "util/u_hash_table.h"
#include "util/hash_table.h"
+#include "util/xmlconfig.h"
#include <amdgpu_drm.h>
#include <xf86drm.h>
#include <stdio.h>
@@ -49,7 +50,9 @@ static simple_mtx_t dev_tab_mutex = _SIMPLE_MTX_INITIALIZER_NP;
DEBUG_GET_ONCE_BOOL_OPTION(all_bos, "RADEON_ALL_BOS", false)
/* Helper function to do the ioctls needed for setup and init. */
-static bool do_winsys_init(struct amdgpu_winsys *ws, int fd)
+static bool do_winsys_init(struct amdgpu_winsys *ws,
+ const struct pipe_screen_config *config,
+ int fd)
{
if (!ac_query_gpu_info(fd, ws->dev, &ws->info, &ws->amdinfo))
goto fail;
@@ -63,7 +66,8 @@ static bool do_winsys_init(struct amdgpu_winsys *ws, int fd)
ws->check_vm = strstr(debug_get_option("R600_DEBUG", ""), "check_vm") != NULL;
ws->debug_all_bos = debug_get_option_all_bos();
ws->reserve_vmid = strstr(debug_get_option("R600_DEBUG", ""), "reserve_vmid") != NULL;
- ws->zero_all_vram_allocs = strstr(debug_get_option("R600_DEBUG", ""), "zerovram") != NULL;
+ ws->zero_all_vram_allocs = strstr(debug_get_option("R600_DEBUG", ""), "zerovram") != NULL ||
+ driQueryOptionb(config->options, "radeonsi_zerovram");
return true;
@@ -279,7 +283,7 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config,
ws->info.drm_major = drm_major;
ws->info.drm_minor = drm_minor;
- if (!do_winsys_init(ws, fd))
+ if (!do_winsys_init(ws, config, fd))
goto fail_alloc;
/* Create managers. */