drm/amd/pm: wrapper for postponing some setup job after DAL initializatioa(V2)
authorEvan Quan <evan.quan@amd.com>
Tue, 1 Sep 2020 02:23:34 +0000 (10:23 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 17 Sep 2020 21:45:57 +0000 (17:45 -0400)
So that ASIC specific actions can be added.

V2: better namings

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
drivers/gpu/drm/amd/pm/swsmu/smu_internal.h

index d22a759..4acc3c4 100644 (file)
@@ -600,6 +600,7 @@ struct pptable_funcs {
        int (*gfx_ulv_control)(struct smu_context *smu, bool enablement);
        int (*deep_sleep_control)(struct smu_context *smu, bool enablement);
        int (*get_fan_parameters)(struct smu_context *smu);
+       int (*post_init)(struct smu_context *smu);
 };
 
 typedef enum {
index 7618f99..e8c2fa6 100644 (file)
@@ -473,6 +473,12 @@ static int smu_late_init(void *handle)
        if (!smu->pm_enabled)
                return 0;
 
+       ret = smu_post_init(smu);
+       if (ret) {
+               dev_err(adev->dev, "Failed to post smu init!\n");
+               return ret;
+       }
+
        ret = smu_set_default_od_settings(smu);
        if (ret) {
                dev_err(adev->dev, "Failed to setup default OD settings!\n");
index 38c1017..db90388 100644 (file)
@@ -95,6 +95,7 @@
 #define smu_gfx_ulv_control(smu, enablement)                           smu_ppt_funcs(gfx_ulv_control, 0, smu, enablement)
 #define smu_deep_sleep_control(smu, enablement)                                smu_ppt_funcs(deep_sleep_control, 0, smu, enablement)
 #define smu_get_fan_parameters(smu)                                    smu_ppt_funcs(get_fan_parameters, 0, smu)
+#define smu_post_init(smu)                                             smu_ppt_funcs(post_init, 0, smu)
 
 #endif
 #endif