From: Greg Kroah-Hartman Date: Thu, 14 Apr 2022 10:47:01 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.19.238~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a284bceb14ae12f2ac1654f6392d2d200709679;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: drm-amdkfd-use-drm_priv-to-pass-vm-from-kfd-to-amdgpu.patch --- diff --git a/queue-5.10/drm-amdkfd-use-drm_priv-to-pass-vm-from-kfd-to-amdgpu.patch b/queue-5.10/drm-amdkfd-use-drm_priv-to-pass-vm-from-kfd-to-amdgpu.patch new file mode 100644 index 00000000000..50f3ed1c2c1 --- /dev/null +++ b/queue-5.10/drm-amdkfd-use-drm_priv-to-pass-vm-from-kfd-to-amdgpu.patch @@ -0,0 +1,45 @@ +From b40a6ab2cf9213923bf8e821ce7fa7f6a0a26990 Mon Sep 17 00:00:00 2001 +From: Felix Kuehling +Date: Wed, 7 Apr 2021 18:19:58 -0400 +Subject: drm/amdkfd: Use drm_priv to pass VM from KFD to amdgpu + +From: Felix Kuehling + +commit b40a6ab2cf9213923bf8e821ce7fa7f6a0a26990 upstream. + +amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu needs the drm_priv to allow mmap +to access the BO through the corresponding file descriptor. The VM can +also be extracted from drm_priv, so drm_priv can replace the vm parameter +in the kfd2kgd interface. + +Signed-off-by: Felix Kuehling +Reviewed-by: Philip Yang +Signed-off-by: Alex Deucher +[This is a partial cherry-pick of the upstream commit.] +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +@@ -1024,11 +1024,15 @@ int amdgpu_amdkfd_gpuvm_acquire_process_ + struct dma_fence **ef) + { + struct amdgpu_device *adev = get_amdgpu_device(kgd); +- struct drm_file *drm_priv = filp->private_data; +- struct amdgpu_fpriv *drv_priv = drm_priv->driver_priv; +- struct amdgpu_vm *avm = &drv_priv->vm; ++ struct amdgpu_fpriv *drv_priv; ++ struct amdgpu_vm *avm; + int ret; + ++ ret = amdgpu_file_to_fpriv(filp, &drv_priv); ++ if (ret) ++ return ret; ++ avm = &drv_priv->vm; ++ + /* Already a compute VM? */ + if (avm->process_info) + return -EINVAL; diff --git a/queue-5.10/series b/queue-5.10/series new file mode 100644 index 00000000000..a66977f92f2 --- /dev/null +++ b/queue-5.10/series @@ -0,0 +1 @@ +drm-amdkfd-use-drm_priv-to-pass-vm-from-kfd-to-amdgpu.patch