drm/vmwgfx: Use a validation context allocator for relocations and validations
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 26 Sep 2018 13:36:52 +0000 (15:36 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Thu, 27 Sep 2018 13:21:36 +0000 (15:21 +0200)
commitfc18afcf5fb2d8776414076d81d907d8be82b362
tree1811827715386353452ef6ab73460a77250aedca
parent2724b2d54cdad7de12e53e7ff2666822bafeae2a
drm/vmwgfx: Use a validation context allocator for relocations and validations

A common trait of these objects are that they are allocated during the
command validation phase and freed after command submission. Furthermore
they are accessed by a single thread only. So provide a simple unprotected
stack-like allocator from which these objects can be allocated. Their
memory is freed with the validation context when the command submission
is done.

Note that the mm subsystem maintains a per-cpu cache of single pages to
make single page allocation and freeing efficient.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_validation.c
drivers/gpu/drm/vmwgfx/vmwgfx_validation.h