Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/pm: Limit to 8 jpeg rings per instance

JPEG 5.0.1 supports upto 10 rings, however PMFW support for SMU v13.0.6
variants is now limited to 8 per instance. Limit to 8 temporarily to
avoid out of bounds access.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lijo Lazar and committed by
Alex Deucher
568199a5 64dc2f00

+5 -3
+5 -3
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
··· 2507 2507 MetricsTableV2_t *metrics_v2; 2508 2508 struct amdgpu_xcp *xcp; 2509 2509 u16 link_width_level; 2510 + u8 num_jpeg_rings; 2510 2511 u32 inst_mask; 2511 2512 bool per_inst; 2512 2513 ··· 2644 2643 2645 2644 per_inst = smu_v13_0_6_cap_supported(smu, SMU_CAP(PER_INST_METRICS)); 2646 2645 2646 + num_jpeg_rings = max_t(u8, adev->jpeg.num_jpeg_rings, 8); 2647 2647 for_each_xcp(adev->xcp_mgr, xcp, i) { 2648 2648 amdgpu_xcp_get_inst_details(xcp, AMDGPU_XCP_VCN, &inst_mask); 2649 2649 idx = 0; ··· 2652 2650 /* Both JPEG and VCN has same instances */ 2653 2651 inst = GET_INST(VCN, k); 2654 2652 2655 - for (j = 0; j < adev->jpeg.num_jpeg_rings; ++j) { 2653 + for (j = 0; j < num_jpeg_rings; ++j) { 2656 2654 gpu_metrics->xcp_stats[i].jpeg_busy 2657 - [(idx * adev->jpeg.num_jpeg_rings) + j] = 2655 + [(idx * num_jpeg_rings) + j] = 2658 2656 SMUQ10_ROUND(GET_METRIC_FIELD(JpegBusy, version) 2659 - [(inst * adev->jpeg.num_jpeg_rings) + j]); 2657 + [(inst * num_jpeg_rings) + j]); 2660 2658 } 2661 2659 gpu_metrics->xcp_stats[i].vcn_busy[idx] = 2662 2660 SMUQ10_ROUND(GET_METRIC_FIELD(VcnBusy, version)[inst]);