[PATCH] drm/amdkfd: correct pipe offset calculation

Zhang, Hawking Hawking.Zhang at amd.com
Wed Dec 9 13:40:07 UTC 2020


[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.Zhang at amd.com>

Regards,
Hawking

-----Original Message-----
From: Jiansong Chen <Jiansong.Chen at amd.com> 
Sent: Wednesday, December 9, 2020 19:59
To: amd-gfx at lists.freedesktop.org
Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Kuehling, Felix <Felix.Kuehling at amd.com>; Chen, Jiansong (Simon) <Jiansong.Chen at 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.Chen at 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


More information about the amd-gfx mailing list