Skip to contentSkip to conversation

drm/amdkfd: Initialize only amdkfd's assigned pipelines

PATCH Superseded Oded Gabbay 1 participant 1 message Feb 16, 2015

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: Initialize only amdkfd's assigned pipelines

This patch fixes a bug in the initialization of the pipelines. The init_pipelines() function was called with a constant value of 0 in the first_pipe argument. This is an error because amdkfd doesn't handle pipe 0.

The correct way is to pass the value that get_first_pipe() returns as the argument for first_pipe.

This bug appeared in 3.19 (first version with amdkfd) and it causes around 15% drop in CPU performance of Kaveri (A10-7850).

---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c     | 6 ------
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h     | 6 ++++++
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0 -6
index 36b95e1..38568b2 100644
@@ -62,12 +62,6 @@ enum KFD_MQD_TYPE get_mqd_type_from_queue_type(enum kfd_queue_type type)
 	return KFD_MQD_TYPE_CP;
 }
 
-static inline unsigned int get_first_pipe(struct device_queue_manager *dqm)
-{
-	BUG_ON(!dqm);
-	return dqm->dev->shared_resources.first_compute_pipe;
-}
-
 static inline unsigned int get_pipes_num_cpsch(void)
 {
 	return PIPE_PER_ME_CP_SCHEDULING;
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h +6 -0
index d64f86c..8e8e5985 100644
@@ -181,4 +181,10 @@ extern inline unsigned int get_pipes_num(struct device_queue_manager *dqm)
 	return dqm->dev->shared_resources.compute_pipe_count;
 }
 
+extern inline unsigned int get_first_pipe(struct device_queue_manager *dqm)
+{
+	BUG_ON(!dqm);
+	return dqm->dev->shared_resources.first_compute_pipe;
+}
+
 #endif /* KFD_DEVICE_QUEUE_MANAGER_H_ */
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c +1 -1
index 6b07246..5469efe 100644
@@ -131,5 +131,5 @@ static int register_process_cik(struct device_queue_manager *dqm,
 
 static int initialize_cpsch_cik(struct device_queue_manager *dqm)
 {
-	return init_pipelines(dqm, get_pipes_num(dqm), 0);
+	return init_pipelines(dqm, get_pipes_num(dqm), get_first_pipe(dqm));
 }
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel