mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 23:40:10 +01:00
winsys/amdgpu: don't use debug_get_option_noop in a hot path
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7721>
This commit is contained in:
parent
7cabd8e333
commit
2c61411f25
4 changed files with 6 additions and 4 deletions
|
|
@ -33,8 +33,6 @@
|
|||
|
||||
#include "amd/common/sid.h"
|
||||
|
||||
DEBUG_GET_ONCE_BOOL_OPTION(noop, "RADEON_NOOP", false)
|
||||
|
||||
/* FENCES */
|
||||
|
||||
static struct pipe_fence_handle *
|
||||
|
|
@ -259,7 +257,7 @@ amdgpu_cs_get_next_fence(struct radeon_cmdbuf *rcs)
|
|||
struct amdgpu_cs *cs = amdgpu_cs(rcs);
|
||||
struct pipe_fence_handle *fence = NULL;
|
||||
|
||||
if (debug_get_option_noop())
|
||||
if (cs->noop)
|
||||
return NULL;
|
||||
|
||||
if (cs->next_fence) {
|
||||
|
|
@ -969,6 +967,7 @@ amdgpu_cs_create(struct radeon_winsys_ctx *rwctx,
|
|||
cs->flush_data = flush_ctx;
|
||||
cs->ring_type = ring_type;
|
||||
cs->stop_exec_on_failure = stop_exec_on_failure;
|
||||
cs->noop = ctx->ws->noop_cs;
|
||||
|
||||
struct amdgpu_cs_fence_info fence_info;
|
||||
fence_info.handle = cs->ctx->user_fence_bo;
|
||||
|
|
@ -1797,7 +1796,7 @@ static int amdgpu_cs_flush(struct radeon_cmdbuf *rcs,
|
|||
/* If the CS is not empty or overflowed.... */
|
||||
if (likely(radeon_emitted(&cs->main.base, 0) &&
|
||||
cs->main.base.current.cdw <= cs->main.base.current.max_dw &&
|
||||
!debug_get_option_noop() &&
|
||||
!cs->noop &&
|
||||
!(flags & RADEON_FLUSH_NOOP))) {
|
||||
struct amdgpu_cs_context *cur = cs->csc;
|
||||
|
||||
|
|
|
|||
|
|
@ -149,6 +149,7 @@ struct amdgpu_cs {
|
|||
void (*flush_cs)(void *ctx, unsigned flags, struct pipe_fence_handle **fence);
|
||||
void *flush_data;
|
||||
bool stop_exec_on_failure;
|
||||
bool noop;
|
||||
|
||||
struct util_queue_fence flush_completed;
|
||||
struct pipe_fence_handle *next_fence;
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ static bool do_winsys_init(struct amdgpu_winsys *ws,
|
|||
|
||||
ws->check_vm = strstr(debug_get_option("R600_DEBUG", ""), "check_vm") != NULL ||
|
||||
strstr(debug_get_option("AMD_DEBUG", ""), "check_vm") != NULL;
|
||||
ws->noop_cs = debug_get_bool_option("RADEON_NOOP", false);
|
||||
#if DEBUG
|
||||
ws->debug_all_bos = debug_get_option_all_bos();
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ struct amdgpu_winsys {
|
|||
struct ac_addrlib *addrlib;
|
||||
|
||||
bool check_vm;
|
||||
bool noop_cs;
|
||||
bool reserve_vmid;
|
||||
bool zero_all_vram_allocs;
|
||||
#if DEBUG
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue