drm/amdgpu: map new capped and uncapped mode power profiles for Vangogh
[linux-2.6-microblaze.git] / drivers / gpu / drm / amd / pm / swsmu / smu11 / vangogh_ppt.c
index 24046af..4590374 100644 (file)
@@ -203,6 +203,8 @@ static struct cmn2asic_mapping vangogh_workload_map[PP_SMC_POWER_PROFILE_COUNT]
        WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VR,                   WORKLOAD_PPLIB_VR_BIT),
        WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE,              WORKLOAD_PPLIB_COMPUTE_BIT),
        WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CUSTOM,               WORKLOAD_PPLIB_CUSTOM_BIT),
+       WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CAPPED,               WORKLOAD_PPLIB_CAPPED_BIT),
+       WORKLOAD_MAP(PP_SMC_POWER_PROFILE_UNCAPPED,             WORKLOAD_PPLIB_UNCAPPED_BIT),
 };
 
 static const uint8_t vangogh_throttler_map[] = {
@@ -1046,7 +1048,7 @@ static int vangogh_get_power_profile_mode(struct smu_context *smu,
        if (!buf)
                return -EINVAL;
 
-       for (i = 0; i <= PP_SMC_POWER_PROFILE_CUSTOM; i++) {
+       for (i = 0; i < PP_SMC_POWER_PROFILE_COUNT; i++) {
                /*
                 * Conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT
                 * Not all profile modes are supported on vangogh.
@@ -1070,7 +1072,7 @@ static int vangogh_set_power_profile_mode(struct smu_context *smu, long *input,
        int workload_type, ret;
        uint32_t profile_mode = input[size];
 
-       if (profile_mode > PP_SMC_POWER_PROFILE_CUSTOM) {
+       if (profile_mode >= PP_SMC_POWER_PROFILE_COUNT) {
                dev_err(smu->adev->dev, "Invalid power profile mode %d\n", profile_mode);
                return -EINVAL;
        }