aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1705-drm-amdgpu-Support-importation-of-DGMA-dma-buffer.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1705-drm-amdgpu-Support-importation-of-DGMA-dma-buffer.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1705-drm-amdgpu-Support-importation-of-DGMA-dma-buffer.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1705-drm-amdgpu-Support-importation-of-DGMA-dma-buffer.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1705-drm-amdgpu-Support-importation-of-DGMA-dma-buffer.patch
new file mode 100644
index 00000000..c4808a6d
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1705-drm-amdgpu-Support-importation-of-DGMA-dma-buffer.patch
@@ -0,0 +1,47 @@
+From 6f321c19067a90d54596b638262f113110c88646 Mon Sep 17 00:00:00 2001
+From: ozeng <oak.zeng@amd.com>
+Date: Thu, 4 May 2017 15:55:52 -0500
+Subject: [PATCH 1705/4131] drm/amdgpu: Support importation of DGMA dma buffer
+
+Currently only VRAM and GTT domain buffer importation are supported.
+This adds support of DGMA domain buffer importation.
+
+Change-Id: I02712dcd9bda171681f84c0a31b60c755601eb58
+Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
+Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+index 2e03bef..ef97cd6 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+@@ -1802,7 +1802,8 @@ int amdgpu_amdkfd_gpuvm_import_dmabuf(struct kgd_dev *kgd,
+
+ bo = gem_to_amdgpu_bo(obj);
+ if (!(bo->prefered_domains & (AMDGPU_GEM_DOMAIN_VRAM |
+- AMDGPU_GEM_DOMAIN_GTT)))
++ AMDGPU_GEM_DOMAIN_GTT |
++ AMDGPU_GEM_DOMAIN_DGMA)))
+ /* Only VRAM and GTT BOs are supported */
+ return -EINVAL;
+
+@@ -1824,8 +1825,12 @@ int amdgpu_amdkfd_gpuvm_import_dmabuf(struct kgd_dev *kgd,
+
+ (*mem)->bo = amdgpu_bo_ref(bo);
+ (*mem)->va = va;
+- (*mem)->domain = (bo->prefered_domains & AMDGPU_GEM_DOMAIN_VRAM) ?
+- AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT;
++ if (bo->prefered_domains & AMDGPU_GEM_DOMAIN_VRAM)
++ (*mem)->domain = AMDGPU_GEM_DOMAIN_VRAM;
++ else if (bo->prefered_domains & AMDGPU_GEM_DOMAIN_GTT)
++ (*mem)->domain = AMDGPU_GEM_DOMAIN_GTT;
++ else
++ (*mem)->domain = AMDGPU_GEM_DOMAIN_DGMA;
+ (*mem)->mapped_to_gpu_memory = 0;
+ (*mem)->process_info = kfd_vm->process_info;
+ add_kgd_mem_to_kfd_bo_list(*mem, kfd_vm->process_info, false);
+--
+2.7.4
+