drm/amdkfd: correct pipe offset calculation
authorJiansong Chen <Jiansong.Chen@amd.com>
Wed, 9 Dec 2020 11:43:44 +0000 (19:43 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 10 Dec 2020 21:41:49 +0000 (16:41 -0500)
Correct pipe offset calculation in is_pipe_enabled function,
it should be done in queues.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

index f0a6f66..e686ce2 100644 (file)
@@ -72,8 +72,8 @@ enum KFD_MQD_TYPE get_mqd_type_from_queue_type(enum kfd_queue_type type)
 static bool is_pipe_enabled(struct device_queue_manager *dqm, int mec, int pipe)
 {
        int i;
-       int pipe_offset = mec * dqm->dev->shared_resources.num_pipe_per_mec
-               + pipe * dqm->dev->shared_resources.num_queue_per_pipe;
+       int pipe_offset = (mec * dqm->dev->shared_resources.num_pipe_per_mec
+               + pipe) * dqm->dev->shared_resources.num_queue_per_pipe;
 
        /* queue is available for KFD usage if bit is 1 */
        for (i = 0; i <  dqm->dev->shared_resources.num_queue_per_pipe; ++i)