[Mesa-dev] [PATCH 07/12] winsys/amdgpu: remove initial buffer list allocation

Nicolai Hähnle nhaehnle at gmail.com
Fri Sep 9 17:34:09 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

It's really not necessary.
---
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index 638c2d5..10a4416 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -568,40 +568,20 @@ static bool amdgpu_init_cs_context(struct amdgpu_cs_context *cs,
    case RING_COMPUTE:
       cs->request.ip_type = AMDGPU_HW_IP_COMPUTE;
       break;
 
    default:
    case RING_GFX:
       cs->request.ip_type = AMDGPU_HW_IP_GFX;
       break;
    }
 
-   cs->max_num_buffers = 512;
-   cs->buffers = (struct amdgpu_cs_buffer*)
-                  CALLOC(1, cs->max_num_buffers * sizeof(struct amdgpu_cs_buffer));
-   if (!cs->buffers) {
-      return false;
-   }
-
-   cs->handles = CALLOC(1, cs->max_num_buffers * sizeof(amdgpu_bo_handle));
-   if (!cs->handles) {
-      FREE(cs->buffers);
-      return false;
-   }
-
-   cs->flags = CALLOC(1, cs->max_num_buffers);
-   if (!cs->flags) {
-      FREE(cs->handles);
-      FREE(cs->buffers);
-      return false;
-   }
-
    for (i = 0; i < ARRAY_SIZE(cs->buffer_indices_hashlist); i++) {
       cs->buffer_indices_hashlist[i] = -1;
    }
 
    cs->request.number_of_ibs = 1;
    cs->request.ibs = &cs->ib[IB_MAIN];
 
    cs->ib[IB_CONST].flags = AMDGPU_IB_FLAG_CE;
    cs->ib[IB_CONST_PREAMBLE].flags = AMDGPU_IB_FLAG_CE |
                                      AMDGPU_IB_FLAG_PREAMBLE;
-- 
2.7.4



More information about the mesa-dev mailing list