gallium/radeon/winsyses: add radeon_winsys::min_alloc_size
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 27 Sep 2016 14:51:46 +0000 (16:51 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 29 Sep 2016 09:24:52 +0000 (11:24 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeon/radeon_winsys.h
src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c

index 55f0395bfba2ae8cd9c7a699772217d94ecfde73..d0705d66bcda23f65c90e910b9d497dd10f57eda 100644 (file)
@@ -183,6 +183,7 @@ struct radeon_info {
     uint64_t                    gart_size;
     uint64_t                    vram_size;
     uint64_t                    max_alloc_size;
+    uint32_t                    min_alloc_size;
     bool                        has_dedicated_vram;
     bool                        has_virtual_memory;
     bool                        gfx_ib_pad_with_type2;
index c83489d8820d6f9d41ebb739fdc4f68abee5e9c0..c28e1ca373c025e946a5d4aa284f07890e59d79c 100644 (file)
@@ -557,6 +557,8 @@ amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create)
                       amdgpu_bo_slab_free))
       goto fail_cache;
 
+   ws->info.min_alloc_size = 1 << AMDGPU_SLAB_MIN_SIZE_LOG2;
+
    /* init reference */
    pipe_reference_init(&ws->reference, 1);
 
index ae55746654bf3ab65dfbec6ab13e3cd119f92ef1..16e4408a9a7e05dfd1ea7d2dd03eb9a3f26376f0 100644 (file)
@@ -774,6 +774,10 @@ radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create)
                            radeon_bo_slab_alloc,
                            radeon_bo_slab_free))
             goto fail_cache;
+
+        ws->info.min_alloc_size = 1 << RADEON_SLAB_MIN_SIZE_LOG2;
+    } else {
+        ws->info.min_alloc_size = ws->info.gart_page_size;
     }
 
     if (ws->gen >= DRV_R600) {