]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdkfd: Add kfd gtt sub-allocator functions
authorOded Gabbay <oded.gabbay@amd.com>
Mon, 27 Oct 2014 12:36:07 +0000 (14:36 +0200)
committerOded Gabbay <oded.gabbay@amd.com>
Fri, 9 Jan 2015 20:26:08 +0000 (22:26 +0200)
commita941ac74d1437a2884a7b8a4831acb2f8e8cd6cd
treee2d5e6ea301d49ac4a12badda4c3d69226ee5e82
parentf93bf946f87ca61d8599f025ae4b56b2573a9ceb
drm/amdkfd: Add kfd gtt sub-allocator functions

This patch adds new kfd gtt sub-allocator functions that service the amdkfd
driver when it wants to use gtt memory.

The sub-allocator uses a bitmap to handle the memory area that was transferred
to it during init. It divides the memory area into chunks, according to chunk
size parameter.

The allocation function will allocate contiguous chunks from that memory area,
according to the requested size. If the requested size is smaller than the
chunk size, a single chunk will be allocated.

v2: Do some more verifications on parameters that are passed into
kfd_gtt_sa_init()

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Reviewed-by: Alexey Skidanov <Alexey.skidanov@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h