winsys/radeon: remove use_reusable_pool parameter from buffer_create
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sat, 23 Apr 2016 03:58:38 +0000 (22:58 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 27 Apr 2016 16:16:41 +0000 (11:16 -0500)
All callers set this parameter to true.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/r300/r300_query.c
src/gallium/drivers/r300/r300_render.c
src/gallium/drivers/r300/r300_screen_buffer.c
src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/radeon/r600_buffer_common.c
src/gallium/drivers/radeon/radeon_video.c
src/gallium/drivers/radeon/radeon_winsys.h
src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
src/gallium/winsys/radeon/drm/radeon_drm_bo.c
src/gallium/winsys/radeon/drm/radeon_drm_cs.c

index 8557eb72141bc4ee634f959d8bbcbe41da96929d..f788f583d65c3cce3b3c3732b9ce43d5a1fe2998 100644 (file)
@@ -58,7 +58,7 @@ static struct pipe_query *r300_create_query(struct pipe_context *pipe,
     else
         q->num_pipes = r300screen->info.r300_num_gb_pipes;
 
-    q->buf = r300->rws->buffer_create(r300->rws, 4096, 4096, TRUE,
+    q->buf = r300->rws->buffer_create(r300->rws, 4096, 4096,
                                       RADEON_DOMAIN_GTT, 0);
     if (!q->buf) {
         FREE(q);
index 7eda6753d0dc94bf50424072d1c1f38f1dad9108..43860f3035c77ecc42b707d73022d0b65eaff6cc 100644 (file)
@@ -904,7 +904,7 @@ static boolean r300_render_allocate_vertices(struct vbuf_render* render,
 
         r300->vbo = rws->buffer_create(rws,
                                        MAX2(R300_MAX_DRAW_VBO_SIZE, size),
-                                       R300_BUFFER_ALIGNMENT, TRUE,
+                                       R300_BUFFER_ALIGNMENT,
                                        RADEON_DOMAIN_GTT, 0);
         if (!r300->vbo) {
             return FALSE;
index 42c8e3a0fc5393e4640dae1841660318b677bb14..5b69b24f59b25a64bfa99fc67f3fea9ba5653966 100644 (file)
@@ -102,7 +102,7 @@ r300_buffer_transfer_map( struct pipe_context *context,
 
             /* Create a new one in the same pipe_resource. */
             new_buf = r300->rws->buffer_create(r300->rws, rbuf->b.b.width0,
-                                               R300_BUFFER_ALIGNMENT, TRUE,
+                                               R300_BUFFER_ALIGNMENT,
                                                rbuf->domain, 0);
             if (new_buf) {
                 /* Discard the old buffer. */
@@ -183,7 +183,7 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
 
     rbuf->buf =
         r300screen->rws->buffer_create(r300screen->rws, rbuf->b.b.width0,
-                                       R300_BUFFER_ALIGNMENT, TRUE,
+                                       R300_BUFFER_ALIGNMENT,
                                        rbuf->domain, 0);
     if (!rbuf->buf) {
         FREE(rbuf);
index da51661d5cd92935734db8141415116f6aeb3251..df016734d35323777c60cedea77595295c02ac97 100644 (file)
@@ -1047,7 +1047,7 @@ r300_texture_create_object(struct r300_screen *rscreen,
 
     /* Create the backing buffer if needed. */
     if (!tex->buf) {
-        tex->buf = rws->buffer_create(rws, tex->tex.size_in_bytes, 2048, TRUE,
+        tex->buf = rws->buffer_create(rws, tex->tex.size_in_bytes, 2048,
                                       tex->domain, 0);
 
         if (!tex->buf) {
index 1d40b7686dc2947b09b382ad077cb683beab0cf2..c6429bff37b269878899b9aa91a24fbadbfa66d2 100644 (file)
@@ -176,7 +176,6 @@ bool r600_init_resource(struct r600_common_screen *rscreen,
 
        /* Allocate a new resource. */
        new_buf = rscreen->ws->buffer_create(rscreen->ws, size, alignment,
-                                            true,
                                             res->domains, flags);
        if (!new_buf) {
                return false;
index 8dd32ea05ac45c3d61bd2b3c6c95b5959aa416c9..e2ff037fbb32ee807ecd2674d7a69d0e90753c98 100644 (file)
@@ -185,7 +185,7 @@ void rvid_join_surfaces(struct radeon_winsys* ws,
        /* TODO: 2D tiling workaround */
        alignment *= 2;
 
-       pb = ws->buffer_create(ws, size, alignment, TRUE, RADEON_DOMAIN_VRAM, 0);
+       pb = ws->buffer_create(ws, size, alignment, RADEON_DOMAIN_VRAM, 0);
        if (!pb)
                return;
 
index 451d8a4ec0c33926af5e8d53978c96eae36bea86..0df673457ea9d8398033add6787cac7f670ba7a7 100644 (file)
@@ -451,7 +451,6 @@ struct radeon_winsys {
     struct pb_buffer *(*buffer_create)(struct radeon_winsys *ws,
                                        uint64_t size,
                                        unsigned alignment,
-                                       boolean use_reusable_pool,
                                        enum radeon_bo_domain domain,
                                        enum radeon_bo_flag flags);
 
index 036301ef089de5bae793b8219289ba28282d7014..691d9c2f53bfe6121f33d58781f9cd199e85983d 100644 (file)
@@ -456,7 +456,6 @@ static struct pb_buffer *
 amdgpu_bo_create(struct radeon_winsys *rws,
                  uint64_t size,
                  unsigned alignment,
-                 boolean use_reusable_pool,
                  enum radeon_bo_domain domain,
                  enum radeon_bo_flag flags)
 {
@@ -481,13 +480,10 @@ amdgpu_bo_create(struct radeon_winsys *rws,
    usage |= 1 << (flags + 3);
 
    /* Get a buffer from the cache. */
-   if (use_reusable_pool) {
-       bo = (struct amdgpu_winsys_bo*)
-            pb_cache_reclaim_buffer(&ws->bo_cache, size, alignment,
-                                    usage);
-       if (bo)
-          return &bo->base;
-   }
+   bo = (struct amdgpu_winsys_bo*)
+        pb_cache_reclaim_buffer(&ws->bo_cache, size, alignment, usage);
+   if (bo)
+      return &bo->base;
 
    /* Create a new one. */
    bo = amdgpu_create_bo(ws, size, alignment, usage, domain, flags);
@@ -499,7 +495,7 @@ amdgpu_bo_create(struct radeon_winsys *rws,
          return NULL;
    }
 
-   bo->use_reusable_pool = use_reusable_pool;
+   bo->use_reusable_pool = true;
    return &bo->base;
 }
 
index 69fb9bb4f9d7d70bc16fcaa14ad37e58eb852c3f..8f50f3587510a5741d27ca5bc98eb57e95837b16 100644 (file)
@@ -236,7 +236,7 @@ static bool amdgpu_get_new_ib(struct radeon_winsys *ws, struct amdgpu_ib *ib,
       ib->used_ib_space = 0;
 
       ib->big_ib_buffer = ws->buffer_create(ws, buffer_size,
-                                            4096, true,
+                                            4096,
                                             RADEON_DOMAIN_GTT,
                                             RADEON_FLAG_CPU_ACCESS);
       if (!ib->big_ib_buffer)
index dd6555c9502d3c3d31c3ca3eb26653d0197e728a..2c3098e469550e50c95baf58838fd0dc6fdb1371 100644 (file)
@@ -720,7 +720,6 @@ static struct pb_buffer *
 radeon_winsys_bo_create(struct radeon_winsys *rws,
                         uint64_t size,
                         unsigned alignment,
-                        boolean use_reusable_pool,
                         enum radeon_bo_domain domain,
                         enum radeon_bo_flag flags)
 {
@@ -748,11 +747,9 @@ radeon_winsys_bo_create(struct radeon_winsys *rws,
     assert(flags < sizeof(usage) * 8 - 3);
     usage |= 1 << (flags + 3);
 
-    if (use_reusable_pool) {
-        bo = radeon_bo(pb_cache_reclaim_buffer(&ws->bo_cache, size, alignment, usage));
-        if (bo)
-            return &bo->base;
-    }
+    bo = radeon_bo(pb_cache_reclaim_buffer(&ws->bo_cache, size, alignment, usage));
+    if (bo)
+        return &bo->base;
 
     bo = radeon_create_bo(ws, size, alignment, usage, domain, flags);
     if (!bo) {
@@ -763,7 +760,7 @@ radeon_winsys_bo_create(struct radeon_winsys *rws,
             return NULL;
     }
 
-    bo->use_reusable_pool = use_reusable_pool;
+    bo->use_reusable_pool = true;
 
     pipe_mutex_lock(ws->bo_handles_mutex);
     util_hash_table_set(ws->bo_handles, (void*)(uintptr_t)bo->handle, bo);
index 6b2694c693809f5c4905fd8899f5b8eb009519ac..11ea9bbe80b476208e182a2dfb8b3a5e419760b9 100644 (file)
@@ -638,7 +638,7 @@ radeon_cs_create_fence(struct radeon_winsys_cs *rcs)
     struct pb_buffer *fence;
 
     /* Create a fence, which is a dummy BO. */
-    fence = cs->ws->base.buffer_create(&cs->ws->base, 1, 1, TRUE,
+    fence = cs->ws->base.buffer_create(&cs->ws->base, 1, 1,
                                        RADEON_DOMAIN_GTT, 0);
     /* Add the fence as a dummy relocation. */
     cs->ws->base.cs_add_buffer(rcs, fence,