OSDN Git Service

anv/allocator: Simplify anv_scratch_pool
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 1 Nov 2016 20:10:11 +0000 (13:10 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 9 Nov 2016 19:31:01 +0000 (11:31 -0800)
commitbd0f8d50706fce400ff0768c659acc90696aadb6
tree903ffb27a0dc7fff7599819d72c79bbc713b5909
parent6283b6d56a2bb731cfcb4c876566901075f9bd34
anv/allocator: Simplify anv_scratch_pool

The previous implementation was being overly clever and using the
anv_bo::size field as its mutex.  Scratch pool allocations don't happen
often, will happen at most a fixed number of times, and never happen in the
critical path (they only happen in shader compilation).  We can make this
much simpler by just using the device mutex.  This also means that we can
start using anv_bo_init_new directly on the bo and avoid setting fields
one-at-a-time.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
src/intel/vulkan/anv_allocator.c
src/intel/vulkan/anv_private.h