radeonsi: just save buffer sizes instead of buffers while recording IBs
authorMarek Olšák <marek.olsak@amd.com>
Fri, 8 Jul 2016 16:03:56 +0000 (18:03 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 13 Jul 2016 17:46:16 +0000 (19:46 +0200)
whole buffer objects are not needed

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/radeon_winsys.h
src/gallium/drivers/radeonsi/si_debug.c
src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
src/gallium/winsys/radeon/drm/radeon_drm_cs.c

index f75fa6c7d8c0d1e39fafeb50e3891c888cdfd71d..cd4908fd3b975da631f2ddb6092743bc63671a03 100644 (file)
@@ -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));
index de25e19aa5b4559d673dedca4e79de2aecefd319..090cafc7ff6c593c75b17750653d4526fe4b8843 100644 (file)
@@ -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_*) */
 };
index 220ce13dab33aa6631abbc66cc78dc7ce64e2e35..57a930f4fe1081260ae4a50700e8950e3fb6979a 100644 (file)
@@ -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",
index 740bfd1494f36b7ec08b90f56caeb331e2b7c348..1302f293c261e189743a9d171d3d8217bd31673c 100644 (file)
@@ -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;
         }
index aab6a7844eb1188040cc8d8fe2a13d90ef0812c5..ed34a2cb55266465f19023b2d3b37b7ba5e757b3 100644 (file)
@@ -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;
         }