diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/1138-drm-amdkfd-Call-destroy_mqd-when-queue-is-disabled.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.14.71/1138-drm-amdkfd-Call-destroy_mqd-when-queue-is-disabled.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/1138-drm-amdkfd-Call-destroy_mqd-when-queue-is-disabled.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/1138-drm-amdkfd-Call-destroy_mqd-when-queue-is-disabled.patch new file mode 100644 index 00000000..faefe40b --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/1138-drm-amdkfd-Call-destroy_mqd-when-queue-is-disabled.patch @@ -0,0 +1,55 @@ +From 5aa3afc0e46832b1942766bb2515e2d45b0f5dc9 Mon Sep 17 00:00:00 2001 +From: Felix Kuehling <Felix.Kuehling@amd.com> +Date: Thu, 19 May 2016 14:28:28 -0400 +Subject: [PATCH 1138/4131] drm/amdkfd: Call destroy_mqd when queue is disabled + +When a queue is disabled in update_queue, call destroy_mqd instead +of load_mqd. This will result in a proper dequeue request that +drains the currently running waves. When a new queue is created in +disabled state, don't load the MQD. + +Change-Id: Ibf65125454df33c19b1078cc4b60cf16cd62d581 +Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> +--- + drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 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 c8fd16c..e04832f 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +@@ -299,6 +299,9 @@ static int create_compute_queue_nocpsch(struct device_queue_manager *dqm, + dqm->dev->kfd2kgd->alloc_memory_of_scratch( + dqm->dev->kgd, qpd->sh_hidden_private_base, qpd->vmid); + ++ if (!q->properties.is_active) ++ return 0; ++ + retval = mqd->load_mqd(mqd, q->mqd, q->pipe, + q->queue, (uint32_t __user *) q->properties.write_ptr, + qpd->page_table_base); +@@ -416,10 +419,17 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q) + + retval = mqd->update_mqd(mqd, q->mqd, &q->properties); + if (dqm->sched_policy == KFD_SCHED_POLICY_NO_HWS && +- q->properties.type == KFD_QUEUE_TYPE_COMPUTE) +- retval = mqd->load_mqd(mqd, q->mqd, q->pipe, +- q->queue, +- (uint32_t __user *)q->properties.write_ptr, 0); ++ q->properties.type == KFD_QUEUE_TYPE_COMPUTE) { ++ /* FIXME: Handle SDMA queues as well */ ++ if (q->properties.is_active) ++ retval = mqd->load_mqd(mqd, q->mqd, q->pipe, ++ q->queue, ++ (uint32_t __user *)q->properties.write_ptr, 0); ++ else if (prev_active) ++ retval = mqd->destroy_mqd(mqd, q->mqd, ++ KFD_PREEMPT_TYPE_WAVEFRONT_DRAIN, ++ KFD_UNMAP_LATENCY_MS, q->pipe, q->queue); ++ } + /* + * check active state vs. the previous state + * and modify counter accordingly +-- +2.7.4 + |