[AMD Public Use]

Good catch. I guess we are just lucky that we always need to specify the mec to 
0 in real use case.

The patch is 

Reviewed-by: Hawking Zhang <hawking.zh...@amd.com>

Regards,
Hawking

-----Original Message-----
From: Jiansong Chen <jiansong.c...@amd.com> 
Sent: Wednesday, December 9, 2020 19:59
To: amd-gfx@lists.freedesktop.org
Cc: Zhang, Hawking <hawking.zh...@amd.com>; Kuehling, Felix 
<felix.kuehl...@amd.com>; Chen, Jiansong (Simon) <jiansong.c...@amd.com>
Subject: [PATCH] drm/amdkfd: correct pipe offset calculation

Correct pipe offset calculation in is_pipe_enabled function, it should be done 
in queues.

Signed-off-by: Jiansong Chen <jiansong.c...@amd.com>
Change-Id: I826aa532ca1e5073e3329212a8096f8f5a0be057
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 4 ++--
 1 file changed, 2 insertions(+), 2 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 c579615451ba..c37e9c4b1fb4 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -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)
--
2.25.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to