aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3385-drm-amdkfd-Update-queue_count-before-mapping-queues.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3385-drm-amdkfd-Update-queue_count-before-mapping-queues.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3385-drm-amdkfd-Update-queue_count-before-mapping-queues.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3385-drm-amdkfd-Update-queue_count-before-mapping-queues.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3385-drm-amdkfd-Update-queue_count-before-mapping-queues.patch
new file mode 100644
index 00000000..b79bfb64
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3385-drm-amdkfd-Update-queue_count-before-mapping-queues.patch
@@ -0,0 +1,57 @@
+From d83291357d61d7144a941db098765af51f3ebbfb Mon Sep 17 00:00:00 2001
+From: Felix Kuehling <Felix.Kuehling@amd.com>
+Date: Wed, 1 Nov 2017 19:21:32 -0400
+Subject: [PATCH 3385/4131] drm/amdkfd: Update queue_count before mapping
+ queues
+
+map_queues_cpsch uses the queue_count to decide whether to upload
+a new runlist. So update the counter before calling it.
+
+Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
+Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
+Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
+---
+ .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 20 +++++++++++---------
+ 1 file changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+index 45b98dd..e2fc4c5 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+@@ -408,6 +408,17 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
+
+ retval = mqd->update_mqd(mqd, q->mqd, &q->properties);
+
++ /*
++ * check active state vs. the previous state and modify
++ * counter accordingly. map_queues_cpsch uses the
++ * dqm->queue_count to determine whether a new runlist must be
++ * uploaded.
++ */
++ if (q->properties.is_active && !prev_active)
++ dqm->queue_count++;
++ else if (!q->properties.is_active && prev_active)
++ dqm->queue_count--;
++
+ if (sched_policy != KFD_SCHED_POLICY_NO_HWS)
+ retval = map_queues_cpsch(dqm);
+ else if (sched_policy == KFD_SCHED_POLICY_NO_HWS &&
+@@ -417,15 +428,6 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
+ retval = mqd->load_mqd(mqd, q->mqd, q->pipe, q->queue,
+ &q->properties, q->process->mm);
+
+- /*
+- * check active state vs. the previous state
+- * and modify counter accordingly
+- */
+- if (q->properties.is_active && !prev_active)
+- dqm->queue_count++;
+- else if (!q->properties.is_active && prev_active)
+- dqm->queue_count--;
+-
+ out_unlock:
+ mutex_unlock(&dqm->lock);
+ return retval;
+--
+2.7.4
+