aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Kuehling <Felix.Kuehling@amd.com>2017-11-01 19:21:57 -0400
committerOded Gabbay <oded.gabbay@gmail.com>2017-11-26 04:31:32 -0500
commit8c946b8988acec785bcf67088b6bd0747f36d2d3 (patch)
treee52c0035df203f5c2aec012e369301ab964820a5
parentd12fb13f23199faa7e536acec1db49068e5a067d (diff)
drm/amdkfd: Fix SDMA oversubsription handling
SDMA only supports a fixed number of queues. HWS cannot handle oversubscription. Signed-off-by: shaoyun liu <shaoyun.liu@amd.com> 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>
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
index 2bec902fc939..a3f1e62c60ba 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -191,6 +191,24 @@ int pqm_create_queue(struct process_queue_manager *pqm,
191 191
192 switch (type) { 192 switch (type) {
193 case KFD_QUEUE_TYPE_SDMA: 193 case KFD_QUEUE_TYPE_SDMA:
194 if (dev->dqm->queue_count >=
195 CIK_SDMA_QUEUES_PER_ENGINE * CIK_SDMA_ENGINE_NUM) {
196 pr_err("Over-subscription is not allowed for SDMA.\n");
197 retval = -EPERM;
198 goto err_create_queue;
199 }
200
201 retval = create_cp_queue(pqm, dev, &q, properties, f, *qid);
202 if (retval != 0)
203 goto err_create_queue;
204 pqn->q = q;
205 pqn->kq = NULL;
206 retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd,
207 &q->properties.vmid);
208 pr_debug("DQM returned %d for create_queue\n", retval);
209 print_queue(q);
210 break;
211
194 case KFD_QUEUE_TYPE_COMPUTE: 212 case KFD_QUEUE_TYPE_COMPUTE:
195 /* check if there is over subscription */ 213 /* check if there is over subscription */
196 if ((sched_policy == KFD_SCHED_POLICY_HWS_NO_OVERSUBSCRIPTION) && 214 if ((sched_policy == KFD_SCHED_POLICY_HWS_NO_OVERSUBSCRIPTION) &&