diff options
| author | Oded Gabbay <oded.gabbay@amd.com> | 2015-02-17 04:58:27 -0500 |
|---|---|---|
| committer | Oded Gabbay <oded.gabbay@amd.com> | 2015-02-23 03:47:56 -0500 |
| commit | 1365aa6266fad0669487240af3f098593796172c (patch) | |
| tree | 5aec9b1e27fb9f362b6aeded3aaaaee17e097f85 /drivers/gpu/drm/amd | |
| parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) | |
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 <oded.gabbay@amd.com>
Cc: stable@vger.kernel.org
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c | 2 |
3 files changed, 4 insertions, 3 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 b3589d0e39b9..1b58f331afee 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | |||
| @@ -62,9 +62,9 @@ enum KFD_MQD_TYPE get_mqd_type_from_queue_type(enum kfd_queue_type type) | |||
| 62 | return KFD_MQD_TYPE_CP; | 62 | return KFD_MQD_TYPE_CP; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | static inline unsigned int get_first_pipe(struct device_queue_manager *dqm) | 65 | unsigned int get_first_pipe(struct device_queue_manager *dqm) |
| 66 | { | 66 | { |
| 67 | BUG_ON(!dqm); | 67 | BUG_ON(!dqm || !dqm->dev); |
| 68 | return dqm->dev->shared_resources.first_compute_pipe; | 68 | return dqm->dev->shared_resources.first_compute_pipe; |
| 69 | } | 69 | } |
| 70 | 70 | ||
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h index d64f86cda34f..386bd7df7c30 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | |||
| @@ -163,6 +163,7 @@ void program_sh_mem_settings(struct device_queue_manager *dqm, | |||
| 163 | struct qcm_process_device *qpd); | 163 | struct qcm_process_device *qpd); |
| 164 | int init_pipelines(struct device_queue_manager *dqm, | 164 | int init_pipelines(struct device_queue_manager *dqm, |
| 165 | unsigned int pipes_num, unsigned int first_pipe); | 165 | unsigned int pipes_num, unsigned int first_pipe); |
| 166 | unsigned int get_first_pipe(struct device_queue_manager *dqm); | ||
| 166 | 167 | ||
| 167 | extern inline unsigned int get_sh_mem_bases_32(struct kfd_process_device *pdd) | 168 | extern inline unsigned int get_sh_mem_bases_32(struct kfd_process_device *pdd) |
| 168 | { | 169 | { |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c index 6b072466e2a6..5469efe0523e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c | |||
| @@ -131,5 +131,5 @@ static int register_process_cik(struct device_queue_manager *dqm, | |||
| 131 | 131 | ||
| 132 | static int initialize_cpsch_cik(struct device_queue_manager *dqm) | 132 | static int initialize_cpsch_cik(struct device_queue_manager *dqm) |
| 133 | { | 133 | { |
| 134 | return init_pipelines(dqm, get_pipes_num(dqm), 0); | 134 | return init_pipelines(dqm, get_pipes_num(dqm), get_first_pipe(dqm)); |
| 135 | } | 135 | } |
