drm/amdgpu/si: Make SI DPM workable
Subsystems (2)
cover drm/amdgpu/si: Make SI DPM workable
Hi all,
These patchest resolve the DPM issues of SI.
SI DPM doesn't work since it implemented, the following patches fixes serival issues to make SI DPM workable now.
Patch 1 -> 3: Add firmware version for checking firmware loading via sysfs.
Patch 4 -> 5: Refine the codes for si dpm.
Patch 6 -> 13: Fix the issues which impact DPM functionality.
Patch 14: Enable SI DPM by default.
Thanks,
Rui
Huang Rui (14):
drm/amdgpu: add gfx v6 firmware versions for sysfs dump drm/amdgpu: add gmc v6 firmware versions for sysfs dump drm/amdgpu/si: add SI smc firmware versions for sysfs dump drm/amdgpu: remove useless functions of si dpm
drm/amdgpu: use DRM print instead of printk
drm/amdgpu: fix oland and hainan asic specific handle at
si_program_aspm
drm/amdgpu/si: fix the dce6 for si macro
drm/amdgpu: fix the tahiti specific value of DEEP_SLEEP_CLK_SEL field drm/amdgpu: fix to miss adding thermal controller drm/amdgpu: add rv770_get_memory_type to set the GDDR5 flag drm/amdgpu: fix incorrect index of CG_FFCT_0 register drm/amdgpu: introduce pcie port read/write entry drm/amdgpu: fix incorrect reading method at si_get_current_pcie_speed drm/amdgpu/si: enable SI DPM by default
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 14 ++++ drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 + drivers/gpu/drm/amd/amdgpu/si.c | 112 ++++++++++++++------------ drivers/gpu/drm/amd/amdgpu/si_dpm.c | 54 +++++++++---- drivers/gpu/drm/amd/amdgpu/si_smc.c | 1 + drivers/gpu/drm/amd/include/asic_reg/si/sid.h | 6 +- 8 files changed, 124 insertions(+), 71 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1472557811-8015-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org
PATCH 1/14 drm/amdgpu: add gfx v6 firmware versions for sysfs dump
--- drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +14 -0
@@ -298,6 +298,8 @@ static int gfx_v6_0_init_microcode(struct amdgpu_device *adev)const char *chip_name;char fw_name[30 ];int err; +const struct gfx_firmware_header_v1_0 *cp_hdr; +const struct rlc_firmware_header_v1_0 *rlc_hdr;DRM_DEBUG ("\n" );
@@ -327,6 +329,9 @@ static int gfx_v6_0_init_microcode(struct amdgpu_device *adev) err =amdgpu_ucode_validate (adev->gfx.pfp_fw);if (err) goto out; + cp_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.pfp_fw->data; + adev->gfx.pfp_fw_version =le32_to_cpu (cp_hdr->header.ucode_version); + adev->gfx.pfp_feature_version =le32_to_cpu (cp_hdr->ucode_feature_version);snprintf (fw_name,sizeof (fw_name),"radeon/%s_me.bin" , chip_name); err =request_firmware (&adev->gfx.me_fw, fw_name, adev->dev);
@@ -335,6 +340,9 @@ static int gfx_v6_0_init_microcode(struct amdgpu_device *adev) err =amdgpu_ucode_validate (adev->gfx.me_fw);if (err) goto out; + cp_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.me_fw->data; + adev->gfx.me_fw_version =le32_to_cpu (cp_hdr->header.ucode_version); + adev->gfx.me_feature_version =le32_to_cpu (cp_hdr->ucode_feature_version);snprintf (fw_name,sizeof (fw_name),"radeon/%s_ce.bin" , chip_name); err =request_firmware (&adev->gfx.ce_fw, fw_name, adev->dev);
@@ -343,12 +351,18 @@ static int gfx_v6_0_init_microcode(struct amdgpu_device *adev) err =amdgpu_ucode_validate (adev->gfx.ce_fw);if (err) goto out; + cp_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.ce_fw->data; + adev->gfx.ce_fw_version =le32_to_cpu (cp_hdr->header.ucode_version); + adev->gfx.ce_feature_version =le32_to_cpu (cp_hdr->ucode_feature_version);snprintf (fw_name,sizeof (fw_name),"radeon/%s_rlc.bin" , chip_name); err =request_firmware (&adev->gfx.rlc_fw, fw_name, adev->dev);if (err) goto out; err =amdgpu_ucode_validate (adev->gfx.rlc_fw); + rlc_hdr = (const struct rlc_firmware_header_v1_0 *)adev->gfx.rlc_fw->data; + adev->gfx.rlc_fw_version =le32_to_cpu (rlc_hdr->header.ucode_version); + adev->gfx.rlc_feature_version =le32_to_cpu (rlc_hdr->ucode_feature_version); out:if (err) {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/14 drm/amdgpu: add gmc v6 firmware versions for sysfs dump
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +2 -0
@@ -149,6 +149,8 @@ static int gmc_v6_0_mc_load_microcode(struct amdgpu_device *adev) hdr = (const struct mc_firmware_header_v1_0 *)adev->mc.fw->data;amdgpu_ucode_print_mc_hdr (&hdr->header); + + adev->mc.fw_version =le32_to_cpu (hdr->header.ucode_version); regs_size =le32_to_cpu (hdr->io_debug_size_bytes) / (4 *2 ); new_io_mc_regs = (const __le32 *) (adev->mc.fw->data +le32_to_cpu (hdr->io_debug_array_offset_bytes));
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/14 drm/amdgpu/si: add SI smc firmware versions for sysfs dump
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/si_smc.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/si_smc.c +1 -0
@@ -224,6 +224,7 @@ int si_load_smc_ucode(struct amdgpu_device *adev, u32 limit)amdgpu_ucode_print_smc_hdr (&hdr->header); + adev->pm.fw_version =le32_to_cpu (hdr->header.ucode_version); ucode_start_address =le32_to_cpu (hdr->ucode_start_addr); ucode_size =le32_to_cpu (hdr->header.ucode_size_bytes); src = (const u8 *)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/14 drm/amdgpu: remove useless functions of si dpm
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +0 -3
@@ -1828,9 +1828,6 @@ struct evergreen_power_info *evergreen_get_pi(struct amdgpu_device *adev);struct ni_power_info *ni_get_pi (struct amdgpu_device *adev);struct si_ps *si_get_ps (struct amdgpu_ps *rps); -extern int si_mc_load_microcode (struct amdgpu_device *adev); -extern void vce_v1_0_enable_mgcg (struct amdgpu_device *adev,bool enable); -static int si_populate_voltage_value (struct amdgpu_device *adev,const struct atom_voltage_table *table,u16 value,SISLANDS_SMC_VOLTAGE_VALUE *voltage);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/14 drm/amdgpu: use DRM print instead of printk
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +7 -8
@@ -7720,9 +7720,8 @@ static int si_dpm_init_microcode(struct amdgpu_device *adev) out:if (err) { -printk (KERN_ERR -"si_smc: Failed to load firmware. err = %d\"%s\"\n" , - err, fw_name); +DRM_ERROR ("si_smc: Failed to load firmware. err = %d\"%s\"\n" , + err, fw_name);release_firmware (adev->pm.fw); adev->pm.fw =NULL ; }
@@ -7941,15 +7940,15 @@ static void si_dpm_print_power_state(struct amdgpu_device *adev,amdgpu_dpm_print_class_info (rps->class, rps->class2);amdgpu_dpm_print_cap_info (rps->caps); -printk ("\tuvd vclk: %d dclk: %d\n" , rps->vclk, rps->dclk); +DRM_INFO ("\tuvd vclk: %d dclk: %d\n" , rps->vclk, rps->dclk);for (i =0 ; i < ps->performance_level_count; i++) { pl = &ps->performance_levels[i];if (adev->asic_type >=CHIP_TAHITI ) -printk ("\t\tpower level %d sclk: %u mclk: %u vddc: %u vddci: %u pcie gen: %u\n" , - i, pl->sclk, pl->mclk, pl->vddc, pl->vddci, pl->pcie_gen +1 ); +DRM_INFO ("\t\tpower level %d sclk: %u mclk: %u vddc: %u vddci: %u pcie gen: %u\n" , + i, pl->sclk, pl->mclk, pl->vddc, pl->vddci, pl->pcie_gen +1 );else -printk ("\t\tpower level %d sclk: %u mclk: %u vddc: %u vddci: %u\n" , - i, pl->sclk, pl->mclk, pl->vddc, pl->vddci); +DRM_INFO ("\t\tpower level %d sclk: %u mclk: %u vddc: %u vddci: %u\n" , + i, pl->sclk, pl->mclk, pl->vddc, pl->vddci); }amdgpu_dpm_print_ps_status (adev, rps); }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/14 drm/amdgpu: fix oland and hainan asic specific handle at si_program_aspm
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/si.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/si.c +5 -1
@@ -1602,7 +1602,7 @@ static void si_program_aspm(struct amdgpu_device *adev)if (orig != data)si_pif_phy1_wreg (adev,PB1_PIF_PWRDOWN_1 , data); - { +if ((adev->family !=CHIP_OLAND ) && (adev->family !=CHIP_HAINAN )) { orig = data =si_pif_phy0_rreg (adev,PB0_PIF_PWRDOWN_0 ); data &= ~PLL_RAMP_UP_TIME_0_MASK ;if (orig != data)
@@ -1651,11 +1651,15 @@ static void si_program_aspm(struct amdgpu_device *adev) orig = data =si_pif_phy0_rreg (adev,PB0_PIF_CNTL ); data &= ~LS2_EXIT_TIME_MASK ; +if ((adev->family ==CHIP_OLAND ) || (adev->family ==CHIP_HAINAN )) + data |=LS2_EXIT_TIME (5 );if (orig != data)si_pif_phy0_wreg (adev,PB0_PIF_CNTL , data); orig = data =si_pif_phy1_rreg (adev,PB1_PIF_CNTL ); data &= ~LS2_EXIT_TIME_MASK ; +if ((adev->family ==CHIP_OLAND ) || (adev->family ==CHIP_HAINAN )) + data |=LS2_EXIT_TIME (5 );if (orig != data)si_pif_phy1_wreg (adev,PB1_PIF_CNTL , data);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/14 drm/amdgpu/si: fix the dce6 for si macro
In reply to a message not in the archive--- drivers/gpu/drm/amd/include/asic_reg/si/sid.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/include/asic_reg/si/sid.h +5 -1
@@ -1968,7 +1968,11 @@#define AMDGPU_MM_INDEX 0x0000#define AMDGPU_MM_DATA 0x0001 -#define ASIC_IS_DCE6 (adev) ((adev->asic_type == CHIP_VERDE)) +#define ASIC_IS_DCE6 (adev) ((adev->asic_type == CHIP_VERDE) || \ + (adev->asic_type == CHIP_TAHITI) || \ + (adev->asic_type == CHIP_PITCAIRN) || \ + (adev->asic_type == CHIP_OLAND)) +#define VERDE_NUM_CRTC 6#define BLACKOUT_MODE_MASK 0x00000007#define VGA_RENDER_CONTROL 0xC0
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1472557811-8015-8-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org
RE: [PATCH 07/14] drm/amdgpu/si: fix the dce6 for si macro
Quoted 20 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Tuesday, August 30, 2016 7:50 AM
To: [email protected]; Deucher, Alexander
Cc: Wang, Ken; Yu, Hui; Huang, Ray; Huan, Alvin
Subject: [PATCH 07/14] drm/amdgpu/si: fix the dce6 for si macroChange-Id I3e5f42158c57d1ec722f713b129189bc5f802b11Signed-off-by Huang Rui <[email protected]>--- drivers/gpu/drm/amd/include/asic_reg/si/sid.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/include/asic_reg/si/sid.h +0
-0
drivers/gpu/drm/amd/include/asic_reg/si/sid.h line 1975
Quoted 9 lines
drivers/gpu/drm/amd/include/asic_reg/si/sid.h +5
-1@@ -1968,7 +1968,11 @@#define AMDGPU_MM_INDEX 0x0000#define AMDGPU_MM_DATA 0x0001 -#define ASIC_IS_DCE6 (adev) ((adev->asic_type == CHIP_VERDE)) +#define ASIC_IS_DCE6 (adev) ((adev->asic_type == CHIP_VERDE) || \ + (adev->asic_type == CHIP_TAHITI) || \ + (adev->asic_type == CHIP_PITCAIRN) || \ + (adev->asic_type == CHIP_OLAND)) +
Let's just drop this macro and check the asic types explicitly.
Alex
Quoted 10 lines
drivers/gpu/drm/amd/include/asic_reg/si/sid.h +0
-1#define VERDE_NUM_CRTC 6#define BLACKOUT_MODE_MASK 0x00000007#define VGA_RENDER_CONTROL 0xC0 --2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): MWHPR12MB169435C80C235E574E2D61FBF7E00-Gy0DoCVfaSW4WA4dJ5YXGAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH 07/14] drm/amdgpu/si: fix the dce6 for si macro
Quoted 23 lines · Alexander
Quoted 23 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Tuesday, August 30, 2016 7:50 AM
To: [email protected]; Deucher, Alexander
Cc: Wang, Ken; Yu, Hui; Huang, Ray; Huan, Alvin
Subject: [PATCH 07/14] drm/amdgpu/si: fix the dce6 for si macroChange-Id I3e5f42158c57d1ec722f713b129189bc5f802b11Signed-off-by Huang Rui <[email protected]>--- drivers/gpu/drm/amd/include/asic_reg/si/sid.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/include/asic_reg/si/sid.h +0
-0@@ -1968,7 +1968,11 @@#define AMDGPU_MM_INDEX 0x0000#define AMDGPU_MM_DATA 0x0001
Quoted 9 lines
drivers/gpu/drm/amd/include/asic_reg/si/sid.h line 1975
Quoted 6 lines
drivers/gpu/drm/amd/include/asic_reg/si/sid.h +5
-1-#define ASIC_IS_DCE6 (adev) ((adev->asic_type == CHIP_VERDE)) +#define ASIC_IS_DCE6 (adev) ((adev->asic_type == CHIP_VERDE) || \ + (adev->asic_type == CHIP_TAHITI) || \ + (adev->asic_type == CHIP_PITCAIRN) || \ + (adev->asic_type == CHIP_OLAND)) +Let's just drop this macro and check the asic types explicitly.
OK, will remove this macro in V2.
Thanks,
Rui
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/14 drm/amdgpu: fix the tahiti specific value of DEEP_SLEEP_CLK_SEL field
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +7 -1
@@ -4173,7 +4173,13 @@ static void si_program_response_times(struct amdgpu_device *adev)static void si_program_ds_registers (struct amdgpu_device *adev) {struct evergreen_power_info *eg_pi =evergreen_get_pi (adev); -u32 tmp =1 ;/* XXX: 0x10 on tahiti A0 */ +u32 tmp; + +/* DEEP_SLEEP_CLK_SEL field should be 0x10 on tahiti A0 */ +if (adev->asic_type ==CHIP_TAHITI && adev->rev_id ==0x0 ) + tmp =0x10 ; +else + tmp =0x1 ;if (eg_pi->sclk_deep_sleep) {WREG32_P (MISC_CLK_CNTL ,DEEP_SLEEP_CLK_SEL (tmp), ~DEEP_SLEEP_CLK_SEL_MASK );
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/14 drm/amdgpu: fix to miss adding thermal controller
In reply to a message not in the archiveThermal controller isn't inited during si dpm sw_init phase.
--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +2 -0
@@ -7281,6 +7281,8 @@ static int si_parse_power_table(struct amdgpu_device *adev)return -EINVAL ; power_info = (union power_info *)(mode_info->atom_context->bios + data_offset); +amdgpu_add_thermal_controller (adev); + state_array = (struct _StateArray *) (mode_info->atom_context->bios + data_offset +le16_to_cpu (power_info->pplib.usStateArrayOffset));
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/14 drm/amdgpu: add rv770_get_memory_type to set the GDDR5 flag
In reply to a message not in the archiveAdd rv770_get_memory_type to set mem_gddr5 flag, because it will be used on the whole si dpm part.
--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +16 -0
@@ -6433,8 +6433,24 @@ static void si_set_pcie_lane_width_in_smc(struct amdgpu_device *adev, } } +void rv770_get_memory_type (struct amdgpu_device *adev) +{ +struct rv7xx_power_info *pi =rv770_get_pi (adev); +u32 tmp; + + tmp =RREG32 (MC_SEQ_MISC0 ); + +if (((tmp &MC_SEQ_MISC0_GDDR5_MASK ) >>MC_SEQ_MISC0_GDDR5_SHIFT ) == +MC_SEQ_MISC0_GDDR5_VALUE ) + pi->mem_gddr5 = true; +else + pi->mem_gddr5 = false; + +} +static void si_dpm_setup_asic (struct amdgpu_device *adev) { +rv770_get_memory_type (adev);si_read_clock_registers (adev);si_enable_acpi_power_management (adev); }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1472557811-8015-11-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org
RE: [PATCH 10/14] drm/amdgpu: add rv770_get_memory_type to set the GDDR5 flag
Quoted 24 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Tuesday, August 30, 2016 7:50 AM
To: [email protected]; Deucher, Alexander
Cc: Wang, Ken; Yu, Hui; Huang, Ray; Huan, Alvin
Subject: [PATCH 10/14] drm/amdgpu: addrv770_get_memory_typeto set the GDDR5 flagAdd
rv770_get_memory_typeto setmem_gddr5flag, because it will be used on the whole si dpm part.Change-Id I60f7ef38775c3b27e475f38f939905483fbb56f5Signed-off-by Huang Rui <[email protected]>--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)drivers/gpu/drm/amd/amdgpu/si_dpm.c +0
-0
drivers/gpu/drm/amd/amdgpu/si_dpm.c static void si_set_pcie_lane_width_in_smc(struct · line 6437
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +1
-0@@ -6433,8 +6433,24 @@ static void si_set_pcie_lane_width_in_smc(struct amdgpu_device *adev, } } +void rv770_get_memory_type (struct amdgpu_device *adev)
adev->mc.vram_type should be set in the gmc module. Use that instead of pi->mem_gddr5. See ci_dpm.c for example.
Alex
Quoted 24 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +7
-0+{ +struct rv7xx_power_info *pi =rv770_get_pi (adev); +u32 tmp; + + tmp =RREG32 (MC_SEQ_MISC0 ); + + if (((tmp & MC_SEQ_MISC0_GDDR5_MASK) >>
MC_SEQ_MISC0_GDDR5_SHIFT) ==drivers/gpu/drm/amd/amdgpu/si_dpm.c +8
-1+ MC_SEQ_MISC0_GDDR5_VALUE) + pi->mem_gddr5 = true; + else + pi->mem_gddr5 = false; + +} +static void si_dpm_setup_asic (struct amdgpu_device *adev) { +rv770_get_memory_type (adev);si_read_clock_registers (adev);si_enable_acpi_power_management (adev); } --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): MWHPR12MB1694FA622ACA818EB655A084F7E00-Gy0DoCVfaSW4WA4dJ5YXGAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH 10/14] drm/amdgpu: add rv770_get_memory_type to set the GDDR5 flag
Quoted 28 lines · Alexander
Quoted 28 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Tuesday, August 30, 2016 7:50 AM
To: [email protected]; Deucher, Alexander
Cc: Wang, Ken; Yu, Hui; Huang, Ray; Huan, Alvin
Subject: [PATCH 10/14] drm/amdgpu: addrv770_get_memory_typeto set the GDDR5 flagAdd
rv770_get_memory_typeto setmem_gddr5flag, because it will be used on the whole si dpm part.Change-Id I60f7ef38775c3b27e475f38f939905483fbb56f5Signed-off-by Huang Rui <[email protected]>--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)drivers/gpu/drm/amd/amdgpu/si_dpm.c +0
-0@@ -6433,8 +6433,24 @@ static void si_set_pcie_lane_width_in_smc(struct amdgpu_device *adev, } }
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c static void si_set_pcie_lane_width_in_smc(struct amdgpu_device *adev, · line 6436
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/si_dpm.c +1
-0+void rv770_get_memory_type (struct amdgpu_device *adev)
adev->mc.vram_typeshould be set in the gmc module. Use that instead ofpi->mem_gddr5. Seeci_dpm.cfor example.
So should I use "adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5" check instead? I will update it in V2.
Thanks,
Rui
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 10/14] drm/amdgpu: add rv770_get_memory_type to set the GDDR5 flag
Quoted 43 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Tuesday, August 30, 2016 12:07 PM
To: Deucher, Alexander
Cc: Huan, Alvin; Wang, Ken; [email protected]; Yu, Hui
Subject: Re: [PATCH 10/14] drm/amdgpu: addrv770_get_memory_typeto set the GDDR5 flagQuoted 2 lines · Alexander
Quoted 2 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] OnBehalf
Quoted 5 lines
Quoted 5 lines
Of Huang Rui
Sent: Tuesday, August 30, 2016 7:50 AM
To: [email protected]; Deucher, Alexander
Cc: Wang, Ken; Yu, Hui; Huang, Ray; Huan, Alvin
Subject: [PATCH 10/14] drm/amdgpu: addrv770_get_memory_typetoset
Quoted 11 lines
Quoted 11 lines
the GDDR5 flag
Add
rv770_get_memory_typeto setmem_gddr5flag, because it will be used on the whole si dpm part.Change-Id I60f7ef38775c3b27e475f38f939905483fbb56f5Signed-off-by Huang Rui <[email protected]>--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c static void
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +0
-0@@ -6433,8 +6433,24 @@ static voidsi_set_pcie_lane_width_in_smc(struct
Quoted 6 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +1
-0amdgpu_device *adev, } } +void rv770_get_memory_type (struct amdgpu_device *adev)
Quoted 7 lines
Quoted 1 line
adev->mc.vram_typeshould be set in the gmc module. Use that instead of
pi->mem_gddr5. Seeci_dpm.cfor example.Quoted 1 line
So should I use "
adev->mc.vram_type==AMDGPU_VRAM_TYPE_GDDR5" check
instead? I will update it in V2.
Sure. Either that or set pi->mem_gddr5 = adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5;
Also, double check that the gmc6 module properly sets vram_type. See the gmc 7 module for reference.
Alex
Quoted 7 lines
Thanks,
Rui
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): MWHPR12MB1694B6182E10BB1F6D03897FF7E00-Gy0DoCVfaSW4WA4dJ5YXGAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH 10/14] drm/amdgpu: add rv770_get_memory_type to set the GDDR5 flag
Quoted 47 lines · Alexander
Quoted 47 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Tuesday, August 30, 2016 12:07 PM
To: Deucher, Alexander
Cc: Huan, Alvin; Wang, Ken; [email protected]; Yu, Hui
Subject: Re: [PATCH 10/14] drm/amdgpu: addrv770_get_memory_typeto set the GDDR5 flagQuoted 2 lines · Alexander
Quoted 2 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] OnBehalf
Quoted 5 lines
Quoted 5 lines
Of Huang Rui
Sent: Tuesday, August 30, 2016 7:50 AM
To: [email protected]; Deucher, Alexander
Cc: Wang, Ken; Yu, Hui; Huang, Ray; Huan, Alvin
Subject: [PATCH 10/14] drm/amdgpu: addrv770_get_memory_typetoset
Quoted 11 lines
Quoted 11 lines
the GDDR5 flag
Add
rv770_get_memory_typeto setmem_gddr5flag, because it will be used on the whole si dpm part.Change-Id I60f7ef38775c3b27e475f38f939905483fbb56f5Signed-off-by Huang Rui <[email protected]>--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c static void
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +0
-0@@ -6433,8 +6433,24 @@ static voidsi_set_pcie_lane_width_in_smc(struct
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c static void · line 6437
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/si_dpm.c +1
-0amdgpu_device *adev, } } +void rv770_get_memory_type (struct amdgpu_device *adev)
adev->mc.vram_typeshould be set in the gmc module. Use that instead of
pi->mem_gddr5. Seeci_dpm.cfor example.Quoted 1 line
Quoted 8 lines
Quoted 3 lines
So should I use "
adev->mc.vram_type==AMDGPU_VRAM_TYPE_GDDR5" check
instead? I will update it in V2.Sure. Either that or set
pi->mem_gddr5=adev->mc.vram_type==AMDGPU_VRAM_TYPE_GDDR5;Also, double check that the gmc6 module properly sets
vram_type. See the gmc 7 module for reference.
I see. vram_type is already inited as gmc_v6_0_convert_vram_type(tmp) in early_init of gmc 6. Good to know, thanks.
Rui
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/14 drm/amdgpu: fix incorrect index of CG_FFCT_0 register
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +1 -1
@@ -4281,7 +4281,7 @@ static void si_program_tp(struct amdgpu_device *adev)enum r600_td td =R600_TD_DFLT ;for (i =0 ; i <R600_PM_NUMBER_OF_TC ; i++) -WREG32 (CG_FFCT_0 + (i *10 ), (UTC_0 (r600_utc[i]) |DTC_0 (r600_dtc[i]))); +WREG32 (CG_FFCT_0 + i, (UTC_0 (r600_utc[i]) |DTC_0 (r600_dtc[i])));if (td ==R600_TD_AUTO )WREG32_P (SCLK_PWRMGT_CNTL ,0 , ~FIR_FORCE_TREND_SEL );
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/14 drm/amdgpu: introduce pcie port read/write entry
In reply to a message not in the archiveThis patch adds pcie port read/write entry, because it will be also used on si dpm part.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/si.c | 106 +++++++++++++++-------------- 3 files changed, 60 insertions(+), 52 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +4 -0
@@ -2043,6 +2043,8 @@ struct amdgpu_device {spinlock_t pcie_idx_lock;amdgpu_rreg_t pcie_rreg;amdgpu_wreg_t pcie_wreg; +amdgpu_rreg_t pciep_rreg; +amdgpu_wreg_t pciep_wreg;/* protects concurrent UVD register access */ spinlock_t uvd_ctx_idx_lock;amdgpu_rreg_t uvd_ctx_rreg;
@@ -2183,6 +2185,8 @@ bool amdgpu_device_has_dal_support(struct amdgpu_device *adev);#define REG_GET (FIELD , v) (((v) << FIELD##_SHIFT) & FIELD##_MASK)#define RREG32_PCIE (reg) adev->pcie_rreg(adev, (reg))#define WREG32_PCIE (reg, v) adev->pcie_wreg(adev, (reg), (v)) +#define RREG32_PCIE_PORT (reg) adev->pciep_rreg(adev, (reg)) +#define WREG32_PCIE_PORT (reg, v) adev->pciep_wreg(adev, (reg), (v))#define RREG32_SMC (reg) adev->smc_rreg(adev, (reg))#define WREG32_SMC (reg, v) adev->smc_wreg(adev, (reg), (v))#define RREG32_UVD_CTX (reg) adev->uvd_ctx_rreg(adev, (reg))
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
@@ -1544,6 +1544,8 @@ int amdgpu_device_init(struct amdgpu_device *adev, adev->smc_wreg = &amdgpu_invalid_wreg; adev->pcie_rreg = &amdgpu_invalid_rreg; adev->pcie_wreg = &amdgpu_invalid_wreg; + adev->pciep_rreg = &amdgpu_invalid_rreg; + adev->pciep_wreg = &amdgpu_invalid_wreg; adev->uvd_ctx_rreg = &amdgpu_invalid_rreg; adev->uvd_ctx_wreg = &amdgpu_invalid_wreg; adev->didt_rreg = &amdgpu_invalid_rreg;
drivers/gpu/drm/amd/amdgpu/si.c +54 -52
229 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/14 drm/amdgpu: fix incorrect reading method at si_get_current_pcie_speed
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +1 -1
@@ -6242,7 +6242,7 @@ static u16 si_get_current_pcie_speed(struct amdgpu_device *adev) {u32 speed_cntl; - speed_cntl =RREG32_PCIE (PCIE_LC_SPEED_CNTL ) &LC_CURRENT_DATA_RATE_MASK ; + speed_cntl =RREG32_PCIE_PORT (PCIE_LC_SPEED_CNTL ) &LC_CURRENT_DATA_RATE_MASK ; speed_cntl >>=LC_CURRENT_DATA_RATE_SHIFT ;return (u16 )speed_cntl;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/14 drm/amdgpu/si: enable SI DPM by default
In reply to a message not in the archiveSI DPM issue is fixed, so enable it by default.
--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +3 -3
@@ -7649,7 +7649,7 @@ static int si_dpm_late_init(void *handle)int ret;struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (amdgpu_dpm <=0 ) +if (!amdgpu_dpm)return 0 ;/* init the sysfs and debugfs files late */
@@ -7776,7 +7776,7 @@ static int si_dpm_sw_init(void *handle) adev->pm.current_mclk = adev->clock.default_mclk; adev->pm.int_thermal_type =THERMAL_TYPE_NONE ; -if (amdgpu_dpm <=0 ) +if (!amdgpu_dpm)return 0 ; ret =si_dpm_init_microcode (adev);
@@ -7821,7 +7821,7 @@ static int si_dpm_hw_init(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (amdgpu_dpm <=0 ) +if (!amdgpu_dpm)return 0 ;mutex_lock (&adev->pm.mutex);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
For patch #4:
Quoted 1 line
drm/amdgpu: remove useless functions of si dpm
Maybe call that "remove unused function forward define".
And in general patches should at least have a commit message and not just subject. A simple one liner like "The functions don't exists any more." should be sufficient in this case.
Patch #10:
Well we probably shouldn't call those functions rv770_* any more.
Apart from that the patches look good to me, but since I'm clearly not the DPM expert they are Acked-by: Christian König <[email protected]>.
Regards,
Christian.
Am 30.08.2016 um 13:49 schrieb Huang Rui:
Quoted 35 lines
Hi all,
These patchest resolve the DPM issues of SI.
SI DPM doesn't work since it implemented, the following patches fixes serival issues to make SI DPM workable now.Patch 1 -> 3: Add firmware version for checking firmware loading via sysfs.
Patch 4 -> 5: Refine the codes for si dpm.
Patch 6 -> 13: Fix the issues which impact DPM functionality.
Patch 14: Enable SI DPM by default.
Thanks,
RuiHuang Rui (14):
drm/amdgpu: add gfx v6 firmware versions for sysfs dump drm/amdgpu: add gmc v6 firmware versions for sysfs dump drm/amdgpu/si: add SI smc firmware versions for sysfs dump drm/amdgpu: remove useless functions of si dpm drm/amdgpu: use DRM print instead of printk
drm/amdgpu: fix oland and hainan asic specific handle at
si_program_aspm
drm/amdgpu/si: fix the dce6 for si macro
drm/amdgpu: fix the tahiti specific value ofDEEP_SLEEP_CLK_SELfield drm/amdgpu: fix to miss adding thermal controller drm/amdgpu: addrv770_get_memory_typeto set the GDDR5 flag drm/amdgpu: fix incorrect index ofCG_FFCT_0register drm/amdgpu: introduce pcie port read/write entry drm/amdgpu: fix incorrect reading method atsi_get_current_pcie_speeddrm/amdgpu/si: enable SI DPM by default
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 14 ++++ drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 + drivers/gpu/drm/amd/amdgpu/si.c | 112 ++++++++++++++------------ drivers/gpu/drm/amd/amdgpu/si_dpm.c | 54 +++++++++---- drivers/gpu/drm/amd/amdgpu/si_smc.c | 1 + drivers/gpu/drm/amd/include/asic_reg/si/sid.h | 6 +- 8 files changed, 124 insertions(+), 71 deletions(-)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 9298c36a-caef-3b43-285b-d118134a73e6-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Quoted 8 lines · Christian König
For patch #4:
Quoted 1 line
drm/amdgpu: remove useless functions of si dpm
Maybe call that "remove unused function forward define".
And in general patches should at least have a commit message and not just subject. A simple one liner like "The functions don't exists any more." should be sufficient in this case.
I see, you're right. "unused function" is better, I will update it at V2.
Quoted 4 lines
Patch #10:
Well we probably shouldn't call those functions rv770_* any more.
Yep, I would like to remove that function. Use "adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5" instead of mem_gddr5 flag.
Quoted 4 lines
Apart from that the patches look good to me, but since I'm clearly not the DPM expert they are Acked-by: Christian König <[email protected]>.
Thank you,
Rui
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
Reviewed-by Alex DeucherQuoted 14 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Huang Rui
Sent: Tuesday, August 30, 2016 7:50 AM
To: [email protected]; Deucher, Alexander
Cc: Wang, Ken; Yu, Hui; Huang, Ray; Huan, Alvin
Subject: [PATCH 00/14] drm/amdgpu/si: Make SI DPM workableHi all,
These patchest resolve the DPM issues of SI.
SI DPM doesn't work since it implemented, the following patches fixes serival issues to make SI DPM workable now.
Quoted 8 lines
Patch 1 -> 3: Add firmware version for checking firmware loading via sysfs.
Patch 4 -> 5: Refine the codes for si dpm.
Patch 6 -> 13: Fix the issues which impact DPM functionality.
Patch 14: Enable SI DPM by default.
A few comments on patches 7 and 10. The rest are:
Quoted 31 lines
Thanks,
RuiHuang Rui (14):
drm/amdgpu: add gfx v6 firmware versions for sysfs dump drm/amdgpu: add gmc v6 firmware versions for sysfs dump drm/amdgpu/si: add SI smc firmware versions for sysfs dump drm/amdgpu: remove useless functions of si dpm
drm/amdgpu: use DRM print instead of printk
drm/amdgpu: fix oland and hainan asic specific handle at
si_program_aspm
drm/amdgpu/si: fix the dce6 for si macro
drm/amdgpu: fix the tahiti specific value ofDEEP_SLEEP_CLK_SELfield drm/amdgpu: fix to miss adding thermal controller drm/amdgpu: addrv770_get_memory_typeto set the GDDR5 flag drm/amdgpu: fix incorrect index ofCG_FFCT_0register drm/amdgpu: introduce pcie port read/write entry drm/amdgpu: fix incorrect reading method atsi_get_current_pcie_speeddrm/amdgpu/si: enable SI DPM by defaultdrivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 + drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 14 ++++ drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 + drivers/gpu/drm/amd/amdgpu/si.c | 112 ++++++++++++++------------ drivers/gpu/drm/amd/amdgpu/si_dpm.c | 54 +++++++++---- drivers/gpu/drm/amd/amdgpu/si_smc.c | 1 + drivers/gpu/drm/amd/include/asic_reg/si/sid.h | 6 +- 8 files changed, 124 insertions(+), 71 deletions(-)
Quoted 7 lines
--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx