Skip to content

Commit 8b7f352

Browse files
Boyz-Radeonalexdeucher
authored andcommitted
drm/amd/pm: add inst to dpm_set_vcn_enable
Add an instance parameter to the existing function dpm_set_vcn_enable() for future implementation. Re-write all pptable functions accordingly. v2: Remove duplicated dpm_set_vcn_enable() functions in v1. Instead, adding instance parameter to existing functions. Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com> Suggested-by: Christian König <christian.koenig@amd.com> Suggested-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent bc06819 commit 8b7f352

13 files changed

Lines changed: 31 additions & 13 deletions

File tree

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static int smu_dpm_set_vcn_enable(struct smu_context *smu,
252252
if (atomic_read(&power_gate->vcn_gated) ^ enable)
253253
return 0;
254254

255-
ret = smu->ppt_funcs->dpm_set_vcn_enable(smu, enable);
255+
ret = smu->ppt_funcs->dpm_set_vcn_enable(smu, enable, 0xff);
256256
if (!ret)
257257
atomic_set(&power_gate->vcn_gated, !enable);
258258

drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ struct pptable_funcs {
739739
* @dpm_set_vcn_enable: Enable/disable VCN engine dynamic power
740740
* management.
741741
*/
742-
int (*dpm_set_vcn_enable)(struct smu_context *smu, bool enable);
742+
int (*dpm_set_vcn_enable)(struct smu_context *smu, bool enable, int inst);
743743

744744
/**
745745
* @dpm_set_jpeg_enable: Enable/disable JPEG engine dynamic power

drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ int smu_v13_0_wait_for_event(struct smu_context *smu, enum smu_event_type event,
255255
uint64_t event_arg);
256256

257257
int smu_v13_0_set_vcn_enable(struct smu_context *smu,
258-
bool enable);
258+
bool enable,
259+
int inst);
259260

260261
int smu_v13_0_set_jpeg_enable(struct smu_context *smu,
261262
bool enable);

drivers/gpu/drm/amd/pm/swsmu/inc/smu_v14_0.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ int smu_v14_0_wait_for_event(struct smu_context *smu, enum smu_event_type event,
210210
uint64_t event_arg);
211211

212212
int smu_v14_0_set_vcn_enable(struct smu_context *smu,
213-
bool enable);
213+
bool enable,
214+
int inst);
214215

215216
int smu_v14_0_set_jpeg_enable(struct smu_context *smu,
216217
bool enable);

drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,9 @@ static bool arcturus_is_dpm_running(struct smu_context *smu)
15711571
return !!(feature_enabled & SMC_DPM_FEATURE);
15721572
}
15731573

1574-
static int arcturus_dpm_set_vcn_enable(struct smu_context *smu, bool enable)
1574+
static int arcturus_dpm_set_vcn_enable(struct smu_context *smu,
1575+
bool enable,
1576+
int inst)
15751577
{
15761578
int ret = 0;
15771579

drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,9 @@ static int navi10_set_default_dpm_table(struct smu_context *smu)
11351135
return 0;
11361136
}
11371137

1138-
static int navi10_dpm_set_vcn_enable(struct smu_context *smu, bool enable)
1138+
static int navi10_dpm_set_vcn_enable(struct smu_context *smu,
1139+
bool enable,
1140+
int inst)
11391141
{
11401142
int ret = 0;
11411143

drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,9 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu)
11521152
return 0;
11531153
}
11541154

1155-
static int sienna_cichlid_dpm_set_vcn_enable(struct smu_context *smu, bool enable)
1155+
static int sienna_cichlid_dpm_set_vcn_enable(struct smu_context *smu,
1156+
bool enable,
1157+
int inst)
11561158
{
11571159
struct amdgpu_device *adev = smu->adev;
11581160
int i, ret = 0;

drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ static int vangogh_init_smc_tables(struct smu_context *smu)
461461
return smu_v11_0_init_smc_tables(smu);
462462
}
463463

464-
static int vangogh_dpm_set_vcn_enable(struct smu_context *smu, bool enable)
464+
static int vangogh_dpm_set_vcn_enable(struct smu_context *smu,
465+
bool enable,
466+
int inst)
465467
{
466468
int ret = 0;
467469

drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,9 @@ static enum amd_pm_state_type renoir_get_current_power_state(struct smu_context
645645
return pm_type;
646646
}
647647

648-
static int renoir_dpm_set_vcn_enable(struct smu_context *smu, bool enable)
648+
static int renoir_dpm_set_vcn_enable(struct smu_context *smu,
649+
bool enable,
650+
int inst)
649651
{
650652
int ret = 0;
651653

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2104,7 +2104,8 @@ int smu_v13_0_get_current_pcie_link_speed(struct smu_context *smu)
21042104
}
21052105

21062106
int smu_v13_0_set_vcn_enable(struct smu_context *smu,
2107-
bool enable)
2107+
bool enable,
2108+
int inst)
21082109
{
21092110
struct amdgpu_device *adev = smu->adev;
21102111
int i, ret = 0;

0 commit comments

Comments
 (0)