aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/0139-drm-amdgpu-Remove-VM-based-compute-profile-switching.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0139-drm-amdgpu-Remove-VM-based-compute-profile-switching.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/0139-drm-amdgpu-Remove-VM-based-compute-profile-switching.patch154
1 files changed, 154 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0139-drm-amdgpu-Remove-VM-based-compute-profile-switching.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0139-drm-amdgpu-Remove-VM-based-compute-profile-switching.patch
new file mode 100644
index 00000000..56fb1fbf
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0139-drm-amdgpu-Remove-VM-based-compute-profile-switching.patch
@@ -0,0 +1,154 @@
+From eaea45df8acc16b7f74453ece681798bf21328dc Mon Sep 17 00:00:00 2001
+From: Felix Kuehling <Felix.Kuehling@amd.com>
+Date: Sun, 15 Jul 2018 00:57:02 -0400
+Subject: [PATCH 0139/2940] drm/amdgpu: Remove VM-based compute profile
+ switching
+
+VM-based compute profile switching was rejected upstream. It was
+replaced with queue-based switching and a dedicated kfd2kgd interface.
+
+Change-Id: I7c319bfe2533b29d8e5199dc2fc8fb001bbffdfd
+Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
+Signed-off-by: Kalyan Alle <kalyan.alle@amd.com>
+
+Conflicts:
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 52 +-------------------------
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 5 ---
+ 2 files changed, 1 insertion(+), 56 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+index 7630e1fab9bd..11e5cc51fa34 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+@@ -2584,24 +2584,6 @@ void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t min_vm_size,
+ adev->vm_manager.fragment_size);
+ }
+
+-static void amdgpu_inc_compute_vms(struct amdgpu_device *adev)
+-{
+- /* Temporary use only the first VM manager */
+- unsigned int vmhub = 0; /*ring->funcs->vmhub;*/
+- struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub];
+-
+- mutex_lock(&id_mgr->lock);
+- if ((adev->vm_manager.n_compute_vms++ == 0) &&
+- (!amdgpu_sriov_vf(adev))) {
+- /* First Compute VM: enable compute power profile */
+- if (adev->powerplay.pp_funcs &&
+- adev->powerplay.pp_funcs->switch_power_profile)
+- amdgpu_dpm_switch_power_profile(adev,
+- PP_SMC_POWER_PROFILE_COMPUTE, true);
+- }
+- mutex_unlock(&id_mgr->lock);
+-}
+-
+ /**
+ * amdgpu_vm_init - initialize a vm instance
+ *
+@@ -2707,10 +2689,6 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
+ INIT_KFIFO(vm->faults);
+ vm->fault_credit = 16;
+
+- vm->vm_context = vm_context;
+- if (vm_context == AMDGPU_VM_CONTEXT_COMPUTE)
+- amdgpu_inc_compute_vms(adev);
+-
+ return 0;
+
+ error_unreserve:
+@@ -2756,13 +2734,7 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm)
+ r = amdgpu_bo_reserve(vm->root.base.bo, true);
+ if (r)
+ return r;
+- if (vm->vm_context == AMDGPU_VM_CONTEXT_COMPUTE) {
+- /* Can happen if ioctl is interrupted by a signal after
+- * this function already completed. Just return success.
+- */
+- r = 0;
+- goto error;
+- }
++
+ /* Sanity checks */
+ if (!RB_EMPTY_ROOT(&vm->va.rb_root) || vm->root.entries) {
+ r = -EINVAL;
+@@ -2781,7 +2753,6 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm)
+ }
+
+ /* Update VM state */
+- vm->vm_context = AMDGPU_VM_CONTEXT_COMPUTE;
+ vm->use_cpu_for_update = !!(adev->vm_manager.vm_update_mode &
+ AMDGPU_VM_USE_CPU_FOR_COMPUTE);
+ vm->pte_support_ats = pte_support_ats;
+@@ -2800,11 +2771,8 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm)
+ vm->pasid = 0;
+ }
+
+-
+ /* Free the shadow bo for compute VM */
+ amdgpu_bo_unref(&vm->root.base.bo->shadow);
+- /* Count the new compute VM */
+- amdgpu_inc_compute_vms(adev);
+ error:
+ amdgpu_bo_unreserve(vm->root.base.bo);
+ return r;
+@@ -2870,23 +2838,6 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
+ idr_remove(&adev->vm_manager.pasid_idr, vm->pasid);
+ spin_unlock_irqrestore(&adev->vm_manager.pasid_lock, flags);
+ }
+- if (vm->vm_context == AMDGPU_VM_CONTEXT_COMPUTE) {
+- struct amdgpu_vmid_mgr *id_mgr =
+- &adev->vm_manager.id_mgr[AMDGPU_GFXHUB];
+- mutex_lock(&id_mgr->lock);
+-
+- WARN(adev->vm_manager.n_compute_vms == 0, "Unbalanced number of Compute VMs");
+-
+- if ((--adev->vm_manager.n_compute_vms == 0) &&
+- (!amdgpu_sriov_vf(adev))) {
+- /* Last KFD VM: enable graphics power profile */
+- if (adev->powerplay.pp_funcs &&
+- adev->powerplay.pp_funcs->switch_power_profile)
+- amdgpu_dpm_switch_power_profile(adev,
+- PP_SMC_POWER_PROFILE_COMPUTE, true);
+- }
+- mutex_unlock(&id_mgr->lock);
+- }
+ drm_sched_entity_destroy(&vm->entity);
+
+ if (!RB_EMPTY_ROOT(&vm->va.rb_root)) {
+@@ -2998,7 +2949,6 @@ void amdgpu_vm_manager_init(struct amdgpu_device *adev)
+
+ idr_init(&adev->vm_manager.pasid_idr);
+ spin_lock_init(&adev->vm_manager.pasid_lock);
+- adev->vm_manager.n_compute_vms = 0;
+ }
+
+ /**
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
+index a46e84186ba0..ab1d23e4b8ad 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
+@@ -247,8 +247,6 @@ struct amdgpu_vm {
+
+ /* Some basic info about the task */
+ struct amdgpu_task_info task_info;
+- /* Whether this is a Compute or GFX Context */
+- int vm_context;
+ };
+
+ struct amdgpu_vm_manager {
+@@ -286,9 +284,6 @@ struct amdgpu_vm_manager {
+ */
+ struct idr pasid_idr;
+ spinlock_t pasid_lock;
+-
+- /* Number of Compute VMs, used for detecting Compute activity */
+- unsigned n_compute_vms;
+ };
+
+ #define amdgpu_vm_copy_pte(adev, ib, pe, src, count) ((adev)->vm_manager.vm_pte_funcs->copy_pte((ib), (pe), (src), (count)))
+--
+2.17.1
+