diff options
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 1 | ||||
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 12 | ||||
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h | 1 |
4 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 856e8abc2d9..478f626b299 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -848,6 +848,7 @@ static const struct debug_named_value common_debug_options[] = { { "dpbb", DBG(DPBB), "Enable DPBB." }, { "dfsm", DBG(DFSM), "Enable DFSM." }, { "nooutoforder", DBG(NO_OUT_OF_ORDER), "Disable out-of-order rasterization" }, + { "reserve_vmid", DBG(RESERVE_VMID), "Force VMID reservation per context." }, DEBUG_NAMED_VALUE_END /* must be last */ }; diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 711594164ca..a45921e72b6 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -104,6 +104,7 @@ enum { DBG_NO_DISCARD_RANGE, DBG_NO_WC, DBG_CHECK_VM, + DBG_RESERVE_VMID, /* 3D engine options: */ DBG_SWITCH_ON_EOP, diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c index a4c06cfa7ea..5f7654bef8c 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c @@ -69,6 +69,7 @@ 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; return true; @@ -88,6 +89,9 @@ static void amdgpu_winsys_destroy(struct radeon_winsys *rws) { struct amdgpu_winsys *ws = (struct amdgpu_winsys*)rws; + if (ws->reserve_vmid) + amdgpu_vm_unreserve_vmid(ws->dev, 0); + if (util_queue_is_initialized(&ws->cs_queue)) util_queue_destroy(&ws->cs_queue); @@ -338,6 +342,14 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config, util_hash_table_set(dev_tab, dev, ws); + if (ws->reserve_vmid) { + r = amdgpu_vm_reserve_vmid(dev, 0); + if (r) { + fprintf(stderr, "amdgpu: amdgpu_vm_reserve_vmid failed. (%i)\n", r); + goto fail_cache; + } + } + /* We must unlock the mutex once the winsys is fully initialized, so that * other threads attempting to create the winsys from the same fd will * get a fully initialized winsys and not just half-way initialized. */ diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h index 7a9b02db901..59a5ecaeccb 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h @@ -77,6 +77,7 @@ struct amdgpu_winsys { bool check_vm; bool debug_all_bos; + bool reserve_vmid; /* List of all allocated buffers */ mtx_t global_bo_list_lock; |