diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c index 14955ab880a..8404cf80528 100644 --- a/src/gallium/drivers/radeonsi/si_debug.c +++ b/src/gallium/drivers/radeonsi/si_debug.c @@ -352,7 +352,7 @@ static void si_parse_current_ib(FILE *f, struct radeon_cmdbuf *cs, unsigned begi fprintf(f, "------------------ %s begin (dw = %u) ------------------\n", ip_name, begin); for (unsigned prev_idx = 0; prev_idx < cs->num_prev; ++prev_idx) { - struct radeon_cmdbuf_chunk *chunk = &cs->prev[prev_idx]; + struct ac_cmdbuf *chunk = &cs->prev[prev_idx]; if (begin < chunk->cdw) { struct ac_ib_parser ib_parser = { @@ -1125,7 +1125,7 @@ void si_gather_context_rolls(struct si_context *sctx) uint32_t *ib_dw_sizes = alloca(sizeof(ib_dw_sizes[0]) * (cs->num_prev + 1)); for (unsigned i = 0; i < cs->num_prev; i++) { - struct radeon_cmdbuf_chunk *chunk = &cs->prev[i]; + struct ac_cmdbuf *chunk = &cs->prev[i]; ibs[i] = chunk->buf; ib_dw_sizes[i] = chunk->cdw; diff --git a/src/gallium/include/winsys/radeon_winsys.h b/src/gallium/include/winsys/radeon_winsys.h index 781a993df9f..2ec0b544b69 100644 --- a/src/gallium/include/winsys/radeon_winsys.h +++ b/src/gallium/include/winsys/radeon_winsys.h @@ -24,6 +24,7 @@ #define RADEON_FLUSH_ASYNC_START_NEXT_GFX_IB_NOW \ (PIPE_FLUSH_ASYNC | RADEON_FLUSH_START_NEXT_GFX_IB_NOW) +#include "amd/common/ac_cmdbuf.h" #include "amd/common/ac_gpu_info.h" #include "amd/common/ac_surface.h" #include "amd/common/ac_pm4.h" @@ -208,15 +209,9 @@ enum radeon_ctx_pstate struct winsys_handle; struct radeon_winsys_ctx; -struct radeon_cmdbuf_chunk { - unsigned cdw; /* Number of used dwords. */ - unsigned max_dw; /* Maximum number of dwords. */ - uint32_t *buf; /* The base pointer of the chunk. */ -}; - struct radeon_cmdbuf { - struct radeon_cmdbuf_chunk current; - struct radeon_cmdbuf_chunk *prev; + struct ac_cmdbuf current; + struct ac_cmdbuf *prev; uint16_t num_prev; /* Number of previous chunks. */ uint16_t max_prev; /* Space in array pointed to by prev. */ unsigned prev_dw; /* Total number of dwords in previous chunks. */ diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp index 9ed2b41e300..922b5896bba 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp @@ -1087,9 +1087,9 @@ static bool amdgpu_cs_check_space(struct radeon_cmdbuf *rcs, unsigned dw) /* Allocate a new chunk */ if (rcs->num_prev >= rcs->max_prev) { unsigned new_max_prev = MAX2(1, 2 * rcs->max_prev); - struct radeon_cmdbuf_chunk *new_prev; + struct ac_cmdbuf *new_prev; - new_prev = (struct radeon_cmdbuf_chunk*) + new_prev = (struct ac_cmdbuf*) REALLOC(rcs->prev, sizeof(*new_prev) * rcs->max_prev, sizeof(*new_prev) * new_max_prev); if (!new_prev)