summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
diff options
context:
space:
mode:
authorJack Xiao <Jack.Xiao@amd.com>2023-08-07 15:55:25 +0800
committerAlex Deucher <alexander.deucher@amd.com>2024-05-02 16:18:11 -0400
commit36b2ce477528964dd0fd7b8ae735d4dc185a1bb2 (patch)
tree8b4e9934d1eddf69bfb43f101993de7c64dea51e /drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
parent29d36a9cfdb648fb15017e6f104fd1b4a1296b90 (diff)
drm/amdgpu/gfx12: recalculate available compute rings to use
Recalculate the number of compute rings to use based on the gfx hardware configuration. As needed reserve half of compute rings for mes, kgd can't use up all compute rings. Signed-off-by: Jack Xiao <Jack.Xiao@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
index f3f8601d6e18..06244d97c283 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
@@ -1103,6 +1103,7 @@ static int gfx_v12_0_rlc_backdoor_autoload_enable(struct amdgpu_device *adev)
static int gfx_v12_0_sw_init(void *handle)
{
int i, j, k, r, ring_id = 0;
+ unsigned num_compute_rings;
int xcc_id = 0;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -1126,6 +1127,12 @@ static int gfx_v12_0_sw_init(void *handle)
break;
}
+ /* recalculate compute rings to use based on hardware configuration */
+ num_compute_rings = (adev->gfx.mec.num_pipe_per_mec *
+ adev->gfx.mec.num_queue_per_pipe) / 2;
+ adev->gfx.num_compute_rings = min(adev->gfx.num_compute_rings,
+ num_compute_rings);
+
/* EOP Event */
r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GRBM_CP,
GFX_11_0_0__SRCID__CP_EOP_INTERRUPT,