From: Marek Olšák Date: Fri, 8 Jul 2016 16:03:56 +0000 (+0200) Subject: radeonsi: just save buffer sizes instead of buffers while recording IBs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ed3912d0daae717d70af9c595f1c36d817d9ceec;p=mesa.git radeonsi: just save buffer sizes instead of buffers while recording IBs whole buffer objects are not needed Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index f75fa6c7d8c..cd4908fd3b9 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -367,12 +367,7 @@ oom: void radeon_clear_saved_cs(struct radeon_saved_cs *saved) { - unsigned i; - FREE(saved->ib); - - for (i = 0; i < saved->bo_count; i++) - pb_reference(&saved->bo_list[i].buf, NULL); FREE(saved->bo_list); memset(saved, 0, sizeof(*saved)); diff --git a/src/gallium/drivers/radeon/radeon_winsys.h b/src/gallium/drivers/radeon/radeon_winsys.h index de25e19aa5b..090cafc7ff6 100644 --- a/src/gallium/drivers/radeon/radeon_winsys.h +++ b/src/gallium/drivers/radeon/radeon_winsys.h @@ -414,7 +414,7 @@ struct radeon_surf { }; struct radeon_bo_list_item { - struct pb_buffer *buf; + uint64_t bo_size; uint64_t vm_address; uint64_t priority_usage; /* mask of (1 << RADEON_PRIO_*) */ }; diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c index 220ce13dab3..57a930f4fe1 100644 --- a/src/gallium/drivers/radeonsi/si_debug.c +++ b/src/gallium/drivers/radeonsi/si_debug.c @@ -609,13 +609,13 @@ static void si_dump_bo_list(struct si_context *sctx, /* Note: Buffer sizes are expected to be aligned to 4k by the winsys. */ const unsigned page_size = sctx->b.screen->info.gart_page_size; uint64_t va = saved->bo_list[i].vm_address; - uint64_t size = saved->bo_list[i].buf->size; + uint64_t size = saved->bo_list[i].bo_size; bool hit = false; /* If there's unused virtual memory between 2 buffers, print it. */ if (i) { uint64_t previous_va_end = saved->bo_list[i-1].vm_address + - saved->bo_list[i-1].buf->size; + saved->bo_list[i-1].bo_size; if (va > previous_va_end) { fprintf(f, " %10"PRIu64" -- hole --\n", diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index 740bfd1494f..1302f293c26 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -816,7 +816,7 @@ static unsigned amdgpu_cs_get_buffer_list(struct radeon_winsys_cs *rcs, if (list) { for (i = 0; i < cs->num_buffers; i++) { - pb_reference(&list[i].buf, &cs->buffers[i].bo->base); + list[i].bo_size = cs->buffers[i].bo->base.size; list[i].vm_address = cs->buffers[i].bo->va; list[i].priority_usage = cs->buffers[i].priority_usage; } diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c index aab6a7844eb..ed34a2cb552 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c @@ -419,7 +419,7 @@ static unsigned radeon_drm_cs_get_buffer_list(struct radeon_winsys_cs *rcs, if (list) { for (i = 0; i < cs->csc->crelocs; i++) { - pb_reference(&list[i].buf, &cs->csc->relocs_bo[i].bo->base); + list[i].bo_size = cs->csc->relocs_bo[i].bo->base.size; list[i].vm_address = cs->csc->relocs_bo[i].bo->va; list[i].priority_usage = cs->csc->relocs_bo[i].priority_usage; }