Skip to content

Commit 2393c1a

Browse files
committed
drm/amdgpu/pm: add VCN activity for SMU 13.0.0/7
Wire up the query. Reviewed-by: Lijo Lazar <[email protected]> Reviewed-by: Kenneth Feng <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 6a87982 commit 2393c1a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,10 @@ static int smu_v13_0_0_get_smu_metrics_data(struct smu_context *smu,
836836
case METRICS_AVERAGE_MEMACTIVITY:
837837
*value = metrics->AverageUclkActivity;
838838
break;
839+
case METRICS_AVERAGE_VCNACTIVITY:
840+
*value = max(metrics->Vcn0ActivityPercentage,
841+
metrics->Vcn1ActivityPercentage);
842+
break;
839843
case METRICS_AVERAGE_SOCKETPOWER:
840844
*value = metrics->AverageSocketPower << 8;
841845
break;
@@ -962,6 +966,12 @@ static int smu_v13_0_0_read_sensor(struct smu_context *smu,
962966
(uint32_t *)data);
963967
*size = 4;
964968
break;
969+
case AMDGPU_PP_SENSOR_VCN_LOAD:
970+
ret = smu_v13_0_0_get_smu_metrics_data(smu,
971+
METRICS_AVERAGE_VCNACTIVITY,
972+
(uint32_t *)data);
973+
*size = 4;
974+
break;
965975
case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
966976
ret = smu_v13_0_0_get_smu_metrics_data(smu,
967977
METRICS_AVERAGE_SOCKETPOWER,

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,10 @@ static int smu_v13_0_7_get_smu_metrics_data(struct smu_context *smu,
807807
else
808808
*value = metrics->AverageMemclkFrequencyPreDs;
809809
break;
810+
case METRICS_AVERAGE_VCNACTIVITY:
811+
*value = max(metrics->Vcn0ActivityPercentage,
812+
metrics->Vcn1ActivityPercentage);
813+
break;
810814
case METRICS_AVERAGE_VCLK:
811815
*value = metrics->AverageVclk0Frequency;
812816
break;
@@ -951,6 +955,12 @@ static int smu_v13_0_7_read_sensor(struct smu_context *smu,
951955
(uint32_t *)data);
952956
*size = 4;
953957
break;
958+
case AMDGPU_PP_SENSOR_VCN_LOAD:
959+
ret = smu_v13_0_7_get_smu_metrics_data(smu,
960+
METRICS_AVERAGE_VCNACTIVITY,
961+
(uint32_t *)data);
962+
*size = 4;
963+
break;
954964
case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
955965
ret = smu_v13_0_7_get_smu_metrics_data(smu,
956966
METRICS_AVERAGE_SOCKETPOWER,

0 commit comments

Comments
 (0)