aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorOak Zeng <Oak.Zeng@amd.com>2019-02-08 16:44:35 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-05-24 13:21:02 -0400
commit065e4bdfa1f3ab2884c110394d8b7e7ebe3b988c (patch)
tree394fb2b07be9c284e2e2b14be07329b4927355b3 /drivers/gpu/drm
parente78579aab7c3e112b85bf92d76432b917c841b5b (diff)
drm/amdkfd: Fix sdma queue map issue
Previous codes assumes there are two sdma engines. This is not true e.g., Raven only has 1 SDMA engine. Fix the issue by using sdma engine number info in device_info. Signed-off-by: Oak Zeng <Oak.Zeng@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c21
1 files changed, 12 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 bac1f36d38a2..d41045d3fc3a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -1212,12 +1212,17 @@ int amdkfd_fence_wait_timeout(unsigned int *fence_addr,
1212 return 0; 1212 return 0;
1213} 1213}
1214 1214
1215static int unmap_sdma_queues(struct device_queue_manager *dqm, 1215static int unmap_sdma_queues(struct device_queue_manager *dqm)
1216 unsigned int sdma_engine)
1217{ 1216{
1218 return pm_send_unmap_queue(&dqm->packets, KFD_QUEUE_TYPE_SDMA, 1217 int i, retval = 0;
1219 KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0, false, 1218
1220 sdma_engine); 1219 for (i = 0; i < dqm->dev->device_info->num_sdma_engines; i++) {
1220 retval = pm_send_unmap_queue(&dqm->packets, KFD_QUEUE_TYPE_SDMA,
1221 KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0, false, i);
1222 if (retval)
1223 return retval;
1224 }
1225 return retval;
1221} 1226}
1222 1227
1223/* dqm->lock mutex has to be locked before calling this function */ 1228/* dqm->lock mutex has to be locked before calling this function */
@@ -1256,10 +1261,8 @@ static int unmap_queues_cpsch(struct device_queue_manager *dqm,
1256 pr_debug("Before destroying queues, sdma queue count is : %u\n", 1261 pr_debug("Before destroying queues, sdma queue count is : %u\n",
1257 dqm->sdma_queue_count); 1262 dqm->sdma_queue_count);
1258 1263
1259 if (dqm->sdma_queue_count > 0) { 1264 if (dqm->sdma_queue_count > 0)
1260 unmap_sdma_queues(dqm, 0); 1265 unmap_sdma_queues(dqm);
1261 unmap_sdma_queues(dqm, 1);
1262 }
1263 1266
1264 retval = pm_send_unmap_queue(&dqm->packets, KFD_QUEUE_TYPE_COMPUTE, 1267 retval = pm_send_unmap_queue(&dqm->packets, KFD_QUEUE_TYPE_COMPUTE,
1265 filter, filter_param, false, 0); 1268 filter, filter_param, false, 0);