drm/amdkfd: Clean up KFD_MMAP_ offset handling
authorHarish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Tue, 10 Apr 2018 21:33:04 +0000 (17:33 -0400)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 10 Apr 2018 21:33:04 +0000 (17:33 -0400)
commitdf03ef9342ce09985210679a734f88a269c19ff5
tree45b3f87b50f52d8183799877f26a728f26a07125
parentada2b29c4a79efbdc5bf5eed876bad6b00f43536
drm/amdkfd: Clean up KFD_MMAP_ offset handling

Use bit-rotate for better clarity and remove _MASK from the #defines as
these represent mmap types.

Centralize all the parsing of the mmap offset in kfd_mmap and add device
parameter to doorbell and reserved_mem map functions.

Encode gpu_id into upper bits of vm_pgoff. This frees up the lower bits
for encoding the the doorbell ID on Vega10.

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c
drivers/gpu/drm/amd/amdkfd/kfd_events.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h
drivers/gpu/drm/amd/amdkfd/kfd_process.c