summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdkfd/kfd_migrate.h
diff options
context:
space:
mode:
authorPhilip Yang <Philip.Yang@amd.com>2020-02-08 01:08:04 +0300
committerAlex Deucher <alexander.deucher@amd.com>2021-04-21 04:48:23 +0300
commit50ea50cf6f6d31d3235ad1853c5dbea766a3ed11 (patch)
treed8db08b809619b235b7d7c54079924694fd0d656 /drivers/gpu/drm/amd/amdkfd/kfd_migrate.h
parentb53fa124acdcec6d05bcdb36b55bf0f84471b1b7 (diff)
downloadlinux-50ea50cf6f6d31d3235ad1853c5dbea766a3ed11.tar.xz
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_migrate.h')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_migrate.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.h b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.h
index 89392548ec44..df84e4143e25 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.h
@@ -33,6 +33,11 @@
#include "kfd_priv.h"
#include "kfd_svm.h"
+enum MIGRATION_COPY_DIR {
+ FROM_RAM_TO_VRAM = 0,
+ FROM_VRAM_TO_RAM
+};
+
#if defined(CONFIG_DEVICE_PRIVATE)
int svm_migrate_init(struct amdgpu_device *adev);
void svm_migrate_fini(struct amdgpu_device *adev);