diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3440-drm-amdkfd-Clean-up-kfd_process_alloc_gpuvm.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3440-drm-amdkfd-Clean-up-kfd_process_alloc_gpuvm.patch | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3440-drm-amdkfd-Clean-up-kfd_process_alloc_gpuvm.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3440-drm-amdkfd-Clean-up-kfd_process_alloc_gpuvm.patch new file mode 100644 index 00000000..14247034 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3440-drm-amdkfd-Clean-up-kfd_process_alloc_gpuvm.patch @@ -0,0 +1,86 @@ +From 62b6b1f7addf96d26d5fdfada0854fed2b8178ce Mon Sep 17 00:00:00 2001 +From: Felix Kuehling <Felix.Kuehling@amd.com> +Date: Fri, 23 Feb 2018 18:14:45 -0500 +Subject: [PATCH 3440/4131] drm/amdkfd: Clean up kfd_process_alloc_gpuvm + +Remove process and device parameters from kfd_process_alloc_gpuvm. +Process was never used. Device is easy to get from the PDD. Also +changed the order of parameters to be more logical, with PDD first +and the output parameter kaddr last. + +Declared mem as struct kgd_mem * and removed corresponding casts. + +Change-Id: I51ba79c4d90cefb7b1f1cf6ecd1ca2274b1c2fa1 +Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> +--- + drivers/gpu/drm/amd/amdkfd/kfd_process.c | 30 +++++++++++++----------------- + 1 file changed, 13 insertions(+), 17 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c +index 91aac82..32f78fd 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c +@@ -110,27 +110,25 @@ static void kfd_process_free_gpuvm(struct kgd_mem *mem, + * to avoid concurrency. Because of that exclusiveness, we do + * not need to take p->mutex. + */ +-static int kfd_process_alloc_gpuvm(struct kfd_process *p, +- struct kfd_dev *kdev, uint64_t gpu_va, uint32_t size, +- void **kptr, struct kfd_process_device *pdd, uint32_t flags) ++static int kfd_process_alloc_gpuvm(struct kfd_process_device *pdd, ++ uint64_t gpu_va, uint32_t size, ++ uint32_t flags, void **kptr) + { +- int err; +- void *mem = NULL; ++ struct kfd_dev *kdev = pdd->dev; ++ struct kgd_mem *mem = NULL; + int handle; ++ int err; + + err = kdev->kfd2kgd->alloc_memory_of_gpu(kdev->kgd, gpu_va, size, +- pdd->vm, +- (struct kgd_mem **)&mem, NULL, flags); ++ pdd->vm, &mem, NULL, flags); + if (err) + goto err_alloc_mem; + +- err = kdev->kfd2kgd->map_memory_to_gpu( +- kdev->kgd, (struct kgd_mem *)mem, pdd->vm); ++ err = kdev->kfd2kgd->map_memory_to_gpu(kdev->kgd, mem, pdd->vm); + if (err) + goto err_map_mem; + +- err = kdev->kfd2kgd->sync_memory(kdev->kgd, (struct kgd_mem *) mem, +- true); ++ err = kdev->kfd2kgd->sync_memory(kdev->kgd, mem, true); + if (err) { + pr_debug("Sync memory failed, wait interrupted by user signal\n"); + goto sync_memory_failed; +@@ -192,9 +190,8 @@ static int kfd_process_device_reserve_ib_mem(struct kfd_process_device *pdd) + return 0; + + /* ib_base is only set for dGPU */ +- ret = kfd_process_alloc_gpuvm(pdd->process, pdd->dev, +- qpd->ib_base, PAGE_SIZE, +- &kaddr, pdd, flags); ++ ret = kfd_process_alloc_gpuvm(pdd, qpd->ib_base, PAGE_SIZE, flags, ++ &kaddr); + if (ret) + return ret; + +@@ -513,9 +510,8 @@ static int kfd_process_device_init_cwsr_dgpu(struct kfd_process_device *pdd) + return 0; + + /* cwsr_base is only set for dGPU */ +- ret = kfd_process_alloc_gpuvm(pdd->process, dev, qpd->cwsr_base, +- KFD_CWSR_TBA_TMA_SIZE, &kaddr, pdd, +- flags); ++ ret = kfd_process_alloc_gpuvm(pdd, qpd->cwsr_base, ++ KFD_CWSR_TBA_TMA_SIZE, flags, &kaddr); + if (ret) + return ret; + +-- +2.7.4 + |