gallium/radeon: inline radeon_winsys::query_memory_usage
authorMarek Olšák <marek.olsak@amd.com>
Fri, 29 Jul 2016 19:41:23 +0000 (21:41 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 6 Aug 2016 11:56:14 +0000 (13:56 +0200)
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/winsys/amdgpu/drm/amdgpu_cs.c
src/gallium/winsys/radeon/drm/radeon_drm_cs.c

index 8fae74d7add197cefab931bbb68ea03c6e712fc0..faa739051e5423e83af556994c0c07900b68266b 100644 (file)
@@ -203,7 +203,7 @@ void r600_dma_emit_wait_idle(struct r600_common_context *rctx)
         * It improves texture upload performance by keeping the DMA
         * engine busy while uploads are being submitted.
         */
-       if (rctx->ws->cs_query_memory_usage(rctx->dma.cs) > 64 * 1024 * 1024) {
+       if (cs->used_vram + cs->used_gart > 64 * 1024 * 1024) {
                rctx->dma.flush(rctx, RADEON_FLUSH_ASYNC, NULL);
                return;
        }
index e6f5a89c07d72c5d8ff5efdc68a3e809b5b4c784..2dd4a39bab4b8d965c15ffee248df7e13b738433 100644 (file)
@@ -718,8 +718,6 @@ struct radeon_winsys {
     bool (*cs_memory_below_limit)(struct radeon_winsys_cs *cs,
                                   uint64_t vram, uint64_t gtt);
 
-    uint64_t (*cs_query_memory_usage)(struct radeon_winsys_cs *cs);
-
     /**
      * Return the buffer list.
      *
index 1f2e9264d26eb26f0efa9a038a539639ee013194..b3c5d6e2645768ce8a170ae09fc10fae0703a039 100644 (file)
@@ -799,11 +799,6 @@ static bool amdgpu_cs_memory_below_limit(struct radeon_winsys_cs *rcs,
    return gtt < ws->info.gart_size * 0.7;
 }
 
-static uint64_t amdgpu_cs_query_memory_usage(struct radeon_winsys_cs *rcs)
-{
-   return rcs->used_vram + rcs->used_gart;
-}
-
 static unsigned amdgpu_cs_get_buffer_list(struct radeon_winsys_cs *rcs,
                                           struct radeon_bo_list_item *list)
 {
@@ -1118,7 +1113,6 @@ void amdgpu_cs_init_functions(struct amdgpu_winsys *ws)
    ws->base.cs_validate = amdgpu_cs_validate;
    ws->base.cs_check_space = amdgpu_cs_check_space;
    ws->base.cs_memory_below_limit = amdgpu_cs_memory_below_limit;
-   ws->base.cs_query_memory_usage = amdgpu_cs_query_memory_usage;
    ws->base.cs_get_buffer_list = amdgpu_cs_get_buffer_list;
    ws->base.cs_flush = amdgpu_cs_flush;
    ws->base.cs_is_buffer_referenced = amdgpu_bo_is_referenced;
index 26d5a229633dca99da309c1a01a70dcc44917b2e..15eeb40cb15c7de52775e68bd0ef009b6b4bc61b 100644 (file)
@@ -404,11 +404,6 @@ static bool radeon_drm_cs_memory_below_limit(struct radeon_winsys_cs *rcs, uint6
     return gtt < cs->ws->info.gart_size * 0.7;
 }
 
-static uint64_t radeon_drm_cs_query_memory_usage(struct radeon_winsys_cs *rcs)
-{
-   return rcs->used_vram + rcs->used_gart;
-}
-
 static unsigned radeon_drm_cs_get_buffer_list(struct radeon_winsys_cs *rcs,
                                               struct radeon_bo_list_item *list)
 {
@@ -682,7 +677,6 @@ void radeon_drm_cs_init_functions(struct radeon_drm_winsys *ws)
     ws->base.cs_validate = radeon_drm_cs_validate;
     ws->base.cs_check_space = radeon_drm_cs_check_space;
     ws->base.cs_memory_below_limit = radeon_drm_cs_memory_below_limit;
-    ws->base.cs_query_memory_usage = radeon_drm_cs_query_memory_usage;
     ws->base.cs_get_buffer_list = radeon_drm_cs_get_buffer_list;
     ws->base.cs_flush = radeon_drm_cs_flush;
     ws->base.cs_is_buffer_referenced = radeon_bo_is_referenced;