OSDN Git Service

r600g: add cs memory usage accounting and limit it v3
authorJerome Glisse <jglisse@redhat.com>
Tue, 29 Jan 2013 17:52:17 +0000 (12:52 -0500)
committerJerome Glisse <jglisse@redhat.com>
Thu, 31 Jan 2013 19:23:52 +0000 (14:23 -0500)
commit5e0c956cb219e54dfc22e64ac3f00e22619c763f
tree90ed914596c27cb1d6fdf453b2fc4bcf91cea8de
parent5c86a728d4f688c0fe7fbf9f4b8f88060b65c4ee
r600g: add cs memory usage accounting and limit it v3

We are now seing cs that can go over the vram+gtt size to avoid
failing flush early cs that goes over 70% (gtt+vram) usage. 70%
is use to allow some fragmentation.

The idea is to compute a gross estimate of memory requirement of
each draw call. After each draw call, memory will be precisely
accounted. So the uncertainty is only on the current draw call.
In practice this gave very good estimate (+/- 10% of the target
memory limit).

v2: Remove left over from testing version, remove useless NULL
    checking. Improve commit message.
v3: Add comment to code on memory accounting precision

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_hw_context.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_state_common.c
src/gallium/winsys/radeon/drm/radeon_drm_cs.c
src/gallium/winsys/radeon/drm/radeon_winsys.h