r600g: reduce memory usage from range/block hash table.
authorDave Airlie <airlied@redhat.com>
Thu, 12 May 2011 03:20:02 +0000 (13:20 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 12 May 2011 23:22:40 +0000 (09:22 +1000)
commitd015d2f3912463e694d1e3c1b8cb6891f553f1f1
tree21229625226c061e9e1d1ff4f8c1352c30beffc5
parent5e15497452cf3e4d2fc76fdc6ed8113d0891b467
r600g: reduce memory usage from range/block hash table.

This table covered a large range unnecessarily, reduce the address
range covered, use the fact that the bottom two bits aren't significant,
and remove unused fields from the range struct. It also drops the hash_size/shift in context in favour of a define, which should make doing the math
a bit less CPU intensive.

valgrind glxinfo
Before:
==320==     in use at exit: 419,754 bytes in 706 blocks
==320==   total heap usage: 3,691 allocs, 2,985 frees, 7,272,467 bytes allocated

After:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600.h
src/gallium/winsys/r600/drm/evergreen_hw_context.c
src/gallium/winsys/r600/drm/r600_hw_context.c
src/gallium/winsys/r600/drm/r600_priv.h