From: "Timur Kristóf" <timur.kristof@gmail.com>
To: amd-gfx@lists.freedesktop.org,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Tvrtko Ursulin" <tursulin@ursulin.net>,
"Natalie Vock" <nat@pixelcluster.dev>
Cc: "Timur Kristóf" <timur.kristof@gmail.com>
Subject: [PATCH 07/10] drm/amdgpu/gfx6: Adjust how harvested TCCs are set up
Date: Mon, 3 Aug 2026 15:23:06 +0200 [thread overview]
Message-ID: <20260803132309.36326-8-timur.kristof@gmail.com> (raw)
In-Reply-To: <20260803132309.36326-1-timur.kristof@gmail.com>
Adjust gfx_v6_0_setup_tcc() to keep it working after
a GFX IP block soft reset. On a soft reset, the
TCP_CHAN_STEER_LO/HI registers are not cleared so
the function needs a slight adjustment to how the
number of active TCCs are calculated.
Additionally, let's expose the disabled TCC mask
in the tcc_disabled_mask field, like on other GPUs.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
index b1dfcbe9640c..a51403caa342 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
@@ -1597,7 +1597,7 @@ static void gfx_v6_0_setup_spi(struct amdgpu_device *adev)
*/
static void gfx_v6_0_setup_tcc(struct amdgpu_device *adev)
{
- u32 i, tcc, tcp_addr_config, num_active_tcc = 0;
+ u32 i, tcc, tcp_addr_config, num_active_tcc = 0, num_max_active_tcc;
u64 chan_steer, patched_chan_steer = 0;
const u32 num_max_tcc = adev->gfx.config.max_texture_channel_caches;
const u32 dis_tcc_mask =
@@ -1611,6 +1611,8 @@ static void gfx_v6_0_setup_tcc(struct amdgpu_device *adev)
if (!dis_tcc_mask)
return;
+ num_max_active_tcc = num_max_tcc - hweight32(dis_tcc_mask);
+
/* Each 4-bit nibble contains the index of a TCC used by all TCPs */
chan_steer = RREG32(mmTCP_CHAN_STEER_LO) | ((u64)RREG32(mmTCP_CHAN_STEER_HI) << 32ull);
@@ -1623,9 +1625,12 @@ static void gfx_v6_0_setup_tcc(struct amdgpu_device *adev)
patched_chan_steer |= (u64)tcc << (u64)(4 * num_active_tcc);
++num_active_tcc;
}
+
+ if (num_active_tcc == num_max_active_tcc)
+ break;
}
- WARN_ON(num_active_tcc != num_max_tcc - hweight32(dis_tcc_mask));
+ WARN_ON(num_active_tcc != num_max_active_tcc);
/* Patch number of TCCs used by TCPs */
tcp_addr_config = REG_SET_FIELD(RREG32(mmTCP_ADDR_CONFIG),
@@ -1635,6 +1640,8 @@ static void gfx_v6_0_setup_tcc(struct amdgpu_device *adev)
WREG32(mmTCP_ADDR_CONFIG, tcp_addr_config);
WREG32(mmTCP_CHAN_STEER_HI, upper_32_bits(patched_chan_steer));
WREG32(mmTCP_CHAN_STEER_LO, lower_32_bits(patched_chan_steer));
+
+ adev->gfx.config.tcc_disabled_mask = dis_tcc_mask;
}
static void gfx_v6_0_config_init(struct amdgpu_device *adev)
--
2.55.0
next prev parent reply other threads:[~2026-08-03 13:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 13:22 [PATCH 00/10] drm/amdgpu/gfx6: Use GFX IP block soft reset on GFX6 (v2) Timur Kristóf
2026-08-03 13:23 ` [PATCH 01/10] drm/amdgpu/gfx6: Fixup emit_cntxcntl() Timur Kristóf
2026-08-04 15:11 ` Alex Deucher
2026-08-03 13:23 ` [PATCH 02/10] drm/amdgpu/gfx6: Fixup emitting SWITCH_BUFFER packets Timur Kristóf
2026-08-03 13:23 ` [PATCH 03/10] drm/amdgpu/gfx6: Use PFP on the compute queues too Timur Kristóf
2026-08-03 13:23 ` [PATCH 04/10] drm/amdgpu/gfx6: Initialize compute rings before CP start Timur Kristóf
2026-08-03 13:23 ` [PATCH 05/10] drm/amdgpu/gfx6: Clean up rings during reset Timur Kristóf
2026-08-03 13:23 ` [PATCH 06/10] drm/amdgpu/gfx6: Execute CLEAR_STATE when initializing compute rings Timur Kristóf
2026-08-03 13:23 ` Timur Kristóf [this message]
2026-08-03 13:23 ` [PATCH 08/10] drm/amdgpu/gfx6: Use COND_EXEC Timur Kristóf
2026-08-03 13:23 ` [PATCH 09/10] drm/amdgpu/gfx6: Add IP block soft reset implementation Timur Kristóf
2026-08-03 13:23 ` [PATCH 10/10] drm/amdgpu/gfx6: Enable IP block soft reset as a GPU recovery method Timur Kristóf
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=20260803132309.36326-8-timur.kristof@gmail.com \
--to=timur.kristof@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=nat@pixelcluster.dev \
--cc=tursulin@ursulin.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.