drm/amdgpu: Use GEM obj reference for KFD BOs
authorFelix Kuehling <Felix.Kuehling@amd.com>
Tue, 5 May 2020 18:02:43 +0000 (14:02 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 8 May 2020 18:44:12 +0000 (14:44 -0400)
commit39b3128d7ffd44e400e581e6f49e88cb42bef9a1
tree5675d9ed079fdaa340bcdad8b1efd69ef97d58b2
parenta6aacb2b26e85aa619cf0c6f98d0ca77314cd2a1
drm/amdgpu: Use GEM obj reference for KFD BOs

Releasing the AMDGPU BO ref directly leads to problems when BOs were
exported as DMA bufs. Releasing the GEM reference makes sure that the
AMDGPU/TTM BO is not freed too early.

Also take a GEM reference when importing BOs from DMABufs to keep
references to imported BOs balances properly.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Tested-by: Alex Sierra <alex.sierra@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c