AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Felix Kuehling <Felix.Kuehling@amd.com>,
	Sean Keely <Sean.Keely@amd.com>,
	 Alex Deucher <alexander.deucher@amd.com>,
	Lang Yu <Lang.Yu@amd.com>, "Chen Gong" <Curry.Gong@amd.com>,
	Huang Rui <ray.huang@amd.com>
Subject: [PATCH 1/2] drm/amdgpu: fix to use real compute unit number for shader array mask
Date: Thu, 23 Sep 2021 13:42:00 +0800	[thread overview]
Message-ID: <20210923054201.1433036-1-ray.huang@amd.com> (raw)

We should use the real compute unit number for shader array mask. Some
asic doesn't have 16 compute units per shader array.

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c
index c021519af810..0891c937f4da 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c
@@ -159,12 +159,12 @@ void mqd_symmetrically_map_cu_mask(struct mqd_manager *mm,
 		se_mask[i] = 0;
 
 	i = 0;
-	for (cu = 0; cu < 16; cu++) {
+	for (cu = 0; cu < cu_info.num_cu_per_sh; cu++) {
 		for (sh = 0; sh < cu_info.num_shader_arrays_per_engine; sh++) {
 			for (se = 0; se < cu_info.num_shader_engines; se++) {
 				if (cu_per_sh[se][sh] > cu) {
 					if (cu_mask[i / 32] & (1 << (i % 32)))
-						se_mask[se] |= 1 << (cu + sh * 16);
+						se_mask[se] |= 1 << (cu + sh * cu_info.num_cu_per_sh);
 					i++;
 					if (i == cu_mask_count)
 						return;
-- 
2.25.1


             reply	other threads:[~2021-09-23  5:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  5:42 Huang Rui [this message]
2021-09-23  5:42 ` [PATCH 2/2] drm/amdgpu: update shader array golden setting for cyan_skillfish Huang Rui
2021-09-23  5:47 ` [PATCH 1/2] drm/amdgpu: fix to use real compute unit number for shader array mask Keely, Sean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210923054201.1433036-1-ray.huang@amd.com \
    --to=ray.huang@amd.com \
    --cc=Curry.Gong@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=Lang.Yu@amd.com \
    --cc=Sean.Keely@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox