Skip to contentSkip to conversation

drm/amd/pm: Limit jpeg rings as per max for jpeg_v_4_0_3

PATCH In review Asad Kamal 2 participants 2 messages Feb 14, 2025 – Feb 17, 2025

Subsystems (3)
lore
Share & tools
lore

Asad Kamal

author
#0 lore raw

PATCH 1/1 drm/amd/pm: Limit jpeg rings as per max for jpeg_v_4_0_3

Since pmfw supports for smuv13_0_6 is limited to 8 jpeg rings per instance, which is the max for jpeg_v_4_0_3. Limit it to same to avoid out of bound access.

Fixes c80feef27112 ("drm/amd/pm: Limit to 8 jpeg rings per instance")
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -1
index 3fa671f4981c..9f2de69f53b2 100644
@@ -2644,7 +2644,7 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
 
 	per_inst = smu_v13_0_6_cap_supported(smu, SMU_CAP(PER_INST_METRICS));
 
-	num_jpeg_rings = max_t(u8, adev->jpeg.num_jpeg_rings, 8);
+	num_jpeg_rings = AMDGPU_MAX_JPEG_RINGS_4_0_3;
 	for_each_xcp(adev->xcp_mgr, xcp, i) {
 		amdgpu_xcp_get_inst_details(xcp, AMDGPU_XCP_VCN, &inst_mask);
 		idx = 0;
Signature · 1 line
2.46.0
Reviewed-by Reviewed-by Lijo Lazar on v1 1/1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Regards,
Hawking
-----Original Message-----
From: Kamal, Asad <[email protected]>
Sent: Friday, February 14, 2025 15:28
To: [email protected]; Lazar, Lijo <[email protected]>
Cc: Zhang, Hawking <[email protected]>; Ma, Le <[email protected]>; Zhang, Morris <[email protected]>; Kamal, Asad <[email protected]>; Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amd/pm: Limit jpeg rings as per max for jpeg_v_4_0_3

Since pmfw supports for smuv13_0_6 is limited to 8 jpeg rings per instance, which is the max for jpeg_v_4_0_3. Limit it to same to avoid out of bound access.

Fixes c80feef27112 ("drm/amd/pm: Limit to 8 jpeg rings per instance")
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -1
index 3fa671f4981c..9f2de69f53b2 100644
@@ -2644,7 +2644,7 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
 
        per_inst = smu_v13_0_6_cap_supported(smu, SMU_CAP(PER_INST_METRICS));
 
-       num_jpeg_rings = max_t(u8, adev->jpeg.num_jpeg_rings, 8);
+       num_jpeg_rings = AMDGPU_MAX_JPEG_RINGS_4_0_3;
        for_each_xcp(adev->xcp_mgr, xcp, i) {
                amdgpu_xcp_get_inst_details(xcp, AMDGPU_XCP_VCN, &inst_mask);
                idx = 0;

--
2.46.0