drm/amdkfd: copy memory through gart table
authorPhilip Yang <Philip.Yang@amd.com>
Fri, 7 Feb 2020 22:08:04 +0000 (17:08 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Apr 2021 01:48:23 +0000 (21:48 -0400)
commit50ea50cf6f6d31d3235ad1853c5dbea766a3ed11
treed8db08b809619b235b7d7c54079924694fd0d656
parentb53fa124acdcec6d05bcdb36b55bf0f84471b1b7
drm/amdkfd: copy memory through gart table

Use sdma linear copy to migrate data between ram and vram. The sdma
linear copy command uses kernel buffer function queue to access system
memory through gart table.

Use reserved gart table window 0 to map system page address, and vram
page address is direct mapping. Use the same kernel buffer function to
fill in gart table mapping, so this is serialized with memory copy by
sdma job submit. We only need wait for the last memory copy sdma fence
for larger buffer migration.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
drivers/gpu/drm/amd/amdkfd/kfd_migrate.h