From de84e99e454adede4f95c1cfd59f24c9dcc4e73d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Tue, 27 Sep 2016 16:51:46 +0200 Subject: [PATCH] gallium/radeon/winsyses: add radeon_winsys::min_alloc_size MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- src/gallium/drivers/radeon/radeon_winsys.h | 1 + src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 2 ++ src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/src/gallium/drivers/radeon/radeon_winsys.h b/src/gallium/drivers/radeon/radeon_winsys.h index 55f0395bfba..d0705d66bcd 100644 --- a/src/gallium/drivers/radeon/radeon_winsys.h +++ b/src/gallium/drivers/radeon/radeon_winsys.h @@ -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; diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c index c83489d8820..c28e1ca373c 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c @@ -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); diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c index ae55746654b..16e4408a9a7 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c @@ -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) { -- 2.30.2