]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: add VCN sensor value for yellow carp
authorXiaojian Du <Xiaojian.Du@amd.com>
Fri, 8 Mar 2024 08:31:53 +0000 (16:31 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 20 Mar 2024 17:38:15 +0000 (13:38 -0400)
This will add VCN sensor value for yellow carp.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c

index 2d1736234b4a9227e1dd3f1b15ce7adc3f23496f..d8bcf765a80385e3ff504c1cf796d146e5ae96ae 100644 (file)
@@ -363,7 +363,7 @@ static int yellow_carp_get_smu_metrics_data(struct smu_context *smu,
                *value = metrics->GfxActivity / 100;
                break;
        case METRICS_AVERAGE_VCNACTIVITY:
-               *value = metrics->UvdActivity;
+               *value = metrics->UvdActivity / 100;
                break;
        case METRICS_CURR_SOCKETPOWER:
                *value = (metrics->CurrentSocketPower << 8) / 1000;
@@ -423,6 +423,12 @@ static int yellow_carp_read_sensor(struct smu_context *smu,
                                                                (uint32_t *)data);
                *size = 4;
                break;
+       case AMDGPU_PP_SENSOR_VCN_LOAD:
+               ret = yellow_carp_get_smu_metrics_data(smu,
+                                                       METRICS_AVERAGE_VCNACTIVITY,
+                                                       (uint32_t *)data);
+               *size = 4;
+               break;
        case AMDGPU_PP_SENSOR_GPU_INPUT_POWER:
                ret = yellow_carp_get_smu_metrics_data(smu,
                                                                METRICS_CURR_SOCKETPOWER,