winsys/amdgpu: start with smaller IBs, growing as necessary
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sat, 7 May 2016 15:58:13 +0000 (10:58 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 1 Jun 2016 20:52:19 +0000 (22:52 +0200)
commit83a01cb4983fd4b8ee8402a0679bead2bc0094af
treef8ced215b942f8beaa8a8b529948c50eaee1c1d1
parentf80c6abb9e591d788c7c8f5167dcd7cb744e8b4a
winsys/amdgpu: start with smaller IBs, growing as necessary

This avoids allocating giant IBs from the outset, especially for CE and DMA.

Since we now limit max_dw only by the size that the buffer happens to be
(which, due to the buffer cache, can be even larger than the rounded-up size
we request), the new function amdgpu_ib_max_submit_dwords controls when we
submit an IB.

With this change, we effectively never flush prematurely due to the CE IB,
after an initial warm-up phase.

v2:
- clean up buffer_size calculation

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
src/gallium/winsys/amdgpu/drm/amdgpu_cs.h