drm/amdkfd: Initialize only amdkfd's assigned pipelines
Subsystems (3)
PATCH v2 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).
v2: Don't set get_first_pipe() as inline because it calls BUG_ON()
Signed-off-by Oded Gabbay <[email protected]>
Tested-by Michel Dänzer <[email protected]>
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 4 ++-- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 1 + drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +2 -2
@@ -62,9 +62,9 @@ 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) +unsigned int get_first_pipe (struct device_queue_manager *dqm) { -BUG_ON (!dqm); +BUG_ON (!dqm || !dqm->dev);return dqm->dev->shared_resources.first_compute_pipe; }
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h +1 -0
@@ -163,6 +163,7 @@ void program_sh_mem_settings(struct device_queue_manager *dqm, struct qcm_process_device *qpd);int init_pipelines (struct device_queue_manager *dqm,unsigned int pipes_num,unsigned int first_pipe); +unsigned int get_first_pipe (struct device_queue_manager *dqm);extern inline unsigned int get_sh_mem_bases_32 (struct kfd_process_device *pdd) {
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c +1 -1
@@ -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