]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit7135c909c704d4a58d29229af37e092c50803708
tree1811827715386353452ef6ab73460a77250aedca
parentc6ec6f54431c9381605f4e718ba4e4cc51c5736e
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