drm/amdkfd: Allocate doorbells only when needed
authorFelix Kuehling <Felix.Kuehling@amd.com>
Wed, 3 Aug 2022 18:45:45 +0000 (14:45 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 25 Aug 2022 17:35:17 +0000 (13:35 -0400)
commit16f0013157bf8c95d10b9360491e3c920f85641e
tree2c5adc35d23e5b7a8fea8c9fffb139d008b058d6
parent8243df477845cdcf558226bbd24321ee85f82c73
drm/amdkfd: Allocate doorbells only when needed

Only allocate doorbells when the first queue is created on a GPU or the
doorbells need to be mapped into CPU or GPU virtual address space. This
avoids allocating doorbells unnecessarily and can allow more processes
to use KFD on multi-GPU systems.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Kent Russell <kent.Russell@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c
drivers/gpu/drm/amd/amdkfd/kfd_process.c