Skip to content

Commit

Permalink
drm/amd/pm: Skip reporting pcie width/speed on vfs
Browse files Browse the repository at this point in the history
Skip reporting pcie link width/speed on vfs for
smu_v13_0_6 & smu_v13_0_2

Signed-off-by: Asad Kamal <[email protected]>
Reviewed-by: Yang Wang <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
  • Loading branch information
Asad Kamal authored and alexdeucher committed Feb 28, 2024
1 parent 98a936c commit a3c4581
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
10 changes: 6 additions & 4 deletions drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1747,10 +1747,12 @@ static ssize_t aldebaran_get_gpu_metrics(struct smu_context *smu,

gpu_metrics->current_fan_speed = 0;

gpu_metrics->pcie_link_width =
smu_v13_0_get_current_pcie_link_width(smu);
gpu_metrics->pcie_link_speed =
aldebaran_get_current_pcie_link_speed(smu);
if (!amdgpu_sriov_vf(smu->adev)) {
gpu_metrics->pcie_link_width =
smu_v13_0_get_current_pcie_link_width(smu);
gpu_metrics->pcie_link_speed =
aldebaran_get_current_pcie_link_speed(smu);
}

gpu_metrics->system_clock_counter = ktime_get_boottime_ns();

Expand Down
18 changes: 10 additions & 8 deletions drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2229,14 +2229,16 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
gpu_metrics->gfxclk_lock_status = GET_METRIC_FIELD(GfxLockXCDMak) >> GET_INST(GC, 0);

if (!(adev->flags & AMD_IS_APU)) {
link_width_level = smu_v13_0_6_get_current_pcie_link_width_level(smu);
if (link_width_level > MAX_LINK_WIDTH)
link_width_level = 0;

gpu_metrics->pcie_link_width =
DECODE_LANE_WIDTH(link_width_level);
gpu_metrics->pcie_link_speed =
smu_v13_0_6_get_current_pcie_link_speed(smu);
if (!amdgpu_sriov_vf(adev)) {
link_width_level = smu_v13_0_6_get_current_pcie_link_width_level(smu);
if (link_width_level > MAX_LINK_WIDTH)
link_width_level = 0;

gpu_metrics->pcie_link_width =
DECODE_LANE_WIDTH(link_width_level);
gpu_metrics->pcie_link_speed =
smu_v13_0_6_get_current_pcie_link_speed(smu);
}
gpu_metrics->pcie_bandwidth_acc =
SMUQ10_ROUND(metrics_x->PcieBandwidthAcc[0]);
gpu_metrics->pcie_bandwidth_inst =
Expand Down

0 comments on commit a3c4581

Please sign in to comment.