diff options
author | Marek Olšák <[email protected]> | 2019-02-04 16:23:39 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-02-11 12:35:48 -0500 |
commit | 766e920cdb5863e84eb1499b456e24377dd847e5 (patch) | |
tree | 0d194aa12de9eec98ec2a6686e0de0da565aa3e8 /src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | |
parent | 8c1cb393fc959f70e87db17adee73f31d5b82e1a (diff) |
winsys/amdgpu: clean up IB buffer size computation
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/winsys/amdgpu/drm/amdgpu_cs.c')
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index 0d2dab88317..b3dedef3d73 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -682,15 +682,11 @@ static bool amdgpu_ib_new_buffer(struct amdgpu_winsys *ws, struct amdgpu_ib *ib, else buffer_size = 4 *util_next_power_of_two(4 * ib->max_ib_size); - buffer_size = MIN2(buffer_size, 4 * 512 * 1024); + const unsigned min_size = 8 * 1024 * 4; + const unsigned max_size = 512 * 1024 * 4; - switch (ib->ib_type) { - case IB_MAIN: - buffer_size = MAX2(buffer_size, 8 * 1024 * 4); - break; - default: - unreachable("unhandled IB type"); - } + buffer_size = MIN2(buffer_size, max_size); + buffer_size = MAX2(buffer_size, min_size); /* min_size is more important */ pb = ws->base.buffer_create(&ws->base, buffer_size, ws->info.gart_page_size, |