]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: conditionally compile amdgpu's amdkfd files
authorOded Gabbay <oded.gabbay@gmail.com>
Fri, 18 May 2018 19:18:16 +0000 (22:18 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Fri, 18 May 2018 19:18:16 +0000 (22:18 +0300)
commitfe3ddb763b7025498d3745ae9d21280357096a06
treef9e121e67fca8a7ac1289b6cf8669e91892f1760
parent185950461fbf0a5a826abbcdd1e1aa5ce20c2f19
drm/amdgpu: conditionally compile amdgpu's amdkfd files

In case CONFIG_HSA_AMD is not chosen, there is no need to compile amdkfd
files that reside inside amdgpu dirver. In addition, because amdkfd
depends on x86_64 architecture and amdgpu is not, compiling amdkfd files
under i386 architecture can cause compiler errors and warnings.

This patch modifies amdgpu's makefile to build amdkfd files only if
CONFIG_HSA_AMD is chosen. The only file to be compiled unconditionally
is amdgpu_amdkfd.c

There are stub functions that are compiled only if amdkfd is not
compiled. In that case, calls from amdgpu driver proper will go to those
functions instead of the real functions.

v2: instead of using function pointers, use stub functions

v3: initialize kgd2kfd to NULL in case amdkfd is not compiled

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdgpu/Makefile
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h