Skip to content

Commit 61251b2

Browse files
Likun Gaoalexdeucher
authored andcommitted
drm/amdgpu: add MGCG perfmon setting for gfx11
Enable GFX11 MGCG perfmon setting. V2: set rlc to saft mode before setting. Signed-off-by: Likun Gao <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent ee8086d commit 61251b2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ static void gfx_v11_0_ring_invalidate_tlbs(struct amdgpu_ring *ring,
131131
bool all_hub, uint8_t dst_sel);
132132
static void gfx_v11_0_set_safe_mode(struct amdgpu_device *adev);
133133
static void gfx_v11_0_unset_safe_mode(struct amdgpu_device *adev);
134+
static void gfx_v11_0_update_perf_clk(struct amdgpu_device *adev,
135+
bool enable);
134136

135137
static void gfx11_kiq_set_resources(struct amdgpu_ring *kiq_ring, uint64_t queue_mask)
136138
{
@@ -1139,6 +1141,7 @@ static const struct amdgpu_gfx_funcs gfx_v11_0_gfx_funcs = {
11391141
.read_wave_vgprs = &gfx_v11_0_read_wave_vgprs,
11401142
.select_me_pipe_q = &gfx_v11_0_select_me_pipe_q,
11411143
.init_spm_golden = &gfx_v11_0_init_spm_golden_registers,
1144+
.update_perfmon_mgcg = &gfx_v11_0_update_perf_clk,
11421145
};
11431146

11441147
static int gfx_v11_0_gpu_early_init(struct amdgpu_device *adev)

drivers/gpu/drm/amd/amdgpu/soc21.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,20 @@ static void soc21_pre_asic_init(struct amdgpu_device *adev)
494494
{
495495
}
496496

497+
static int soc21_update_umd_stable_pstate(struct amdgpu_device *adev,
498+
bool enter)
499+
{
500+
if (enter)
501+
amdgpu_gfx_rlc_enter_safe_mode(adev);
502+
else
503+
amdgpu_gfx_rlc_exit_safe_mode(adev);
504+
505+
if (adev->gfx.funcs->update_perfmon_mgcg)
506+
adev->gfx.funcs->update_perfmon_mgcg(adev, !enter);
507+
508+
return 0;
509+
}
510+
497511
static const struct amdgpu_asic_funcs soc21_asic_funcs =
498512
{
499513
.read_disabled_bios = &soc21_read_disabled_bios,
@@ -513,6 +527,7 @@ static const struct amdgpu_asic_funcs soc21_asic_funcs =
513527
.supports_baco = &amdgpu_dpm_is_baco_supported,
514528
.pre_asic_init = &soc21_pre_asic_init,
515529
.query_video_codecs = &soc21_query_video_codecs,
530+
.update_umd_stable_pstate = &soc21_update_umd_stable_pstate,
516531
};
517532

518533
static int soc21_common_early_init(void *handle)

0 commit comments

Comments
 (0)