radv: make the TMA/TBA BOs resident buffers
They are always used if the trap handler is enabled. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9076>
This commit is contained in:
committed by
Marge Bot
parent
918838cd24
commit
2c6104d3d1
@@ -840,6 +840,7 @@ bool
|
||||
radv_trap_handler_init(struct radv_device *device)
|
||||
{
|
||||
struct radeon_winsys *ws = device->ws;
|
||||
VkResult result;
|
||||
|
||||
/* Create the trap handler shader and upload it like other shaders. */
|
||||
device->trap_handler_shader = radv_create_trap_handler_shader(device);
|
||||
@@ -848,6 +849,10 @@ radv_trap_handler_init(struct radv_device *device)
|
||||
return false;
|
||||
}
|
||||
|
||||
result = ws->buffer_make_resident(ws, device->trap_handler_shader->bo, true);
|
||||
if (result != VK_SUCCESS)
|
||||
return false;
|
||||
|
||||
device->tma_bo = ws->buffer_create(ws, TMA_BO_SIZE, 256,
|
||||
RADEON_DOMAIN_VRAM,
|
||||
RADEON_FLAG_CPU_ACCESS |
|
||||
@@ -858,6 +863,10 @@ radv_trap_handler_init(struct radv_device *device)
|
||||
if (!device->tma_bo)
|
||||
return false;
|
||||
|
||||
result = ws->buffer_make_resident(ws, device->tma_bo, true);
|
||||
if (result != VK_SUCCESS)
|
||||
return false;
|
||||
|
||||
device->tma_ptr = ws->buffer_map(device->tma_bo);
|
||||
if (!device->tma_ptr)
|
||||
return false;
|
||||
@@ -885,11 +894,15 @@ radv_trap_handler_finish(struct radv_device *device)
|
||||
{
|
||||
struct radeon_winsys *ws = device->ws;
|
||||
|
||||
if (unlikely(device->trap_handler_shader))
|
||||
if (unlikely(device->trap_handler_shader)) {
|
||||
ws->buffer_make_resident(ws, device->trap_handler_shader->bo, false);
|
||||
radv_shader_variant_destroy(device, device->trap_handler_shader);
|
||||
}
|
||||
|
||||
if (unlikely(device->tma_bo))
|
||||
if (unlikely(device->tma_bo)) {
|
||||
ws->buffer_make_resident(ws, device->tma_bo, false);
|
||||
ws->buffer_destroy(ws, device->tma_bo);
|
||||
}
|
||||
}
|
||||
|
||||
static struct radv_shader_variant *
|
||||
|
||||
@@ -3646,9 +3646,6 @@ radv_emit_trap_handler(struct radv_queue *queue,
|
||||
tba_va = radv_buffer_get_va(tba_bo) + device->trap_handler_shader->bo_offset;
|
||||
tma_va = radv_buffer_get_va(tma_bo);
|
||||
|
||||
radv_cs_add_buffer(queue->device->ws, cs, tba_bo);
|
||||
radv_cs_add_buffer(queue->device->ws, cs, tma_bo);
|
||||
|
||||
if (queue->queue_family_index == RADV_QUEUE_GENERAL) {
|
||||
uint32_t regs[] = {R_00B000_SPI_SHADER_TBA_LO_PS,
|
||||
R_00B100_SPI_SHADER_TBA_LO_VS,
|
||||
|
||||
Reference in New Issue
Block a user