Skip to contentSkip to conversation

drm/amdgpu/si: Make SI DPM workable

PATCH In review Huang Rui 4 participants 22 messages Aug 31, 2016 – Sep 6, 2016 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Huang Rui

author
#0 lore raw

v2 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 fix several issues to make SI DPM workable now.

Patch 1: Update SI firmware path to share it with radeon

Patch 2 -> 4: Add firmware version for checking firmware loading via sysfs.

Patch 5 -> 6: Refine the codes for si dpm.

Patch 7 -> 14: Fix the issues which impact DPM functionality.

Patch 15: Enable SI DPM by default.

Changes from V1 -> V2:
- Add a patch to update SI dpm path to firmware/radeon
- Reword patch 5 to "unused function" according to Christian's comments
- Drop ASIC_IS_DCE6 macro
- Modify patch 11 to use "adev->mc.vram_type" instead of pi->mem_gddr5

Thanks,
Rui

Huang Rui (15):
drm/amdgpu/si: update si firmware path
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 unused function forward define drm/amdgpu: use DRM print instead of printk
drm/amdgpu: fix oland and hainan asic specific handle at
si_program_aspm
drm/amdgpu/si: drop ASIC_IS_DCE6 macro on SI
drm/amdgpu: fix the tahiti specific value of DEEP_SLEEP_CLK_SEL field drm/amdgpu: fix to miss adding thermal controller drm/amdgpu: use vram_type instead of checking mem_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           |  60 +++++++-------
 drivers/gpu/drm/amd/amdgpu/si_smc.c           |   1 +
 drivers/gpu/drm/amd/include/asic_reg/si/sid.h |   1 -
 8 files changed, 114 insertions(+), 82 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): 1472621007-17578-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH v2 1/15 drm/amdgpu/si: update si firmware path

SI firmware is shared with radeon for now, so update path with this patch.

---
 drivers/gpu/drm/amd/amdgpu/si_dpm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +5 -5
index 076f6cd..d66435d 100644
@@ -55,15 +55,15 @@
 
 #define BIOS_SCRATCH_4                                    0x5cd
 
-MODULE_FIRMWARE("amdgpu/tahiti_smc.bin");
+MODULE_FIRMWARE("radeon/tahiti_smc.bin");
 MODULE_FIRMWARE("radeon/tahiti_k_smc.bin");
-MODULE_FIRMWARE("amdgpu/pitcairn_smc.bin");
+MODULE_FIRMWARE("radeon/pitcairn_smc.bin");
 MODULE_FIRMWARE("radeon/pitcairn_k_smc.bin");
-MODULE_FIRMWARE("amdgpu/verde_smc.bin");
+MODULE_FIRMWARE("radeon/verde_smc.bin");
 MODULE_FIRMWARE("radeon/verde_k_smc.bin");
-MODULE_FIRMWARE("amdgpu/oland_smc.bin");
+MODULE_FIRMWARE("radeon/oland_smc.bin");
 MODULE_FIRMWARE("radeon/oland_k_smc.bin");
-MODULE_FIRMWARE("amdgpu/hainan_smc.bin");
+MODULE_FIRMWARE("radeon/hainan_smc.bin");
 MODULE_FIRMWARE("radeon/hainan_k_smc.bin");
 
 union power_info {
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#3 lore raw

PATCH v2 2/15 drm/amdgpu: add gfx v6 firmware versions for sysfs dump

In reply to a message not in the archive
---
 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
index f3ad4aa..17a560c 100644
@@ -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
author
#4 lore raw

PATCH v2 3/15 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
index c18a4ef..1d2952b 100644
@@ -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
author
#5 lore raw

PATCH v2 4/15 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
index 214f37c..c1c2594 100644
@@ -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
author
#6 lore raw

PATCH v2 5/15 drm/amdgpu: remove unused function forward define

In reply to a message not in the archive

The functions don't exists any more.

---
 drivers/gpu/drm/amd/amdgpu/si_dpm.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +0 -3
index d66435d..fa56184 100644
@@ -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
author
#7 lore raw

PATCH v2 6/15 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
index fa56184..c9b0989 100644
@@ -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
author
#8 lore raw

PATCH v2 7/15 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
index d2309b7..d5fc197 100644
@@ -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
author
#9 lore raw

PATCH v2 8/15 drm/amdgpu/si: drop ASIC_IS_DCE6 macro on SI

In reply to a message not in the archive

Drop ASIC_IS_DCE6 macro, because it will check the asic types explicitly in future.

---
 drivers/gpu/drm/amd/include/asic_reg/si/sid.h | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/include/asic_reg/si/sid.h +0 -1
index 9609199..8c5608a 100644
@@ -1968,7 +1968,6 @@
 #define AMDGPU_MM_INDEX		        0x0000
 #define AMDGPU_MM_DATA		        0x0001
 
-#define ASIC_IS_DCE6(adev) ((adev->asic_type == CHIP_VERDE))
 #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
author
#10 lore raw

PATCH v2 9/15 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
index c9b0989..5269c33 100644
@@ -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
author
#11 lore raw

PATCH v2 10/15 drm/amdgpu: fix to miss adding thermal controller

In reply to a message not in the archive

Thermal 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
index 5269c33..ece2527 100644
@@ -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
author
#12 lore raw

PATCH v2 11/15 drm/amdgpu: use vram_type instead of checking mem_gddr5 flag

In reply to a message not in the archive

For current design, it would better use vram_type member to check if current vram is GDDR5. So remove the old mem_gddr5 flag.

---
 drivers/gpu/drm/amd/amdgpu/si_dpm.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/si_dpm.c +6 -6
index ece2527..e1b2ab5 100644
@@ -4375,7 +4375,7 @@ static u8 si_get_strobe_mode_settings(struct amdgpu_device *adev, u32 mclk)
 	if (mclk <= pi->mclk_strobe_mode_threshold)
 		strobe_mode = true;
 
-	if (pi->mem_gddr5)
+	if (adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5)
 		result = si_get_mclk_frequency_ratio(mclk, strobe_mode);
 	else
 		result = si_get_ddr3_mclk_frequency_ratio(mclk);
@@ -4965,7 +4965,7 @@ static int si_populate_smc_initial_state(struct amdgpu_device *adev,
 
 	table->initialState.levels[0].gen2PCIE = (u8)si_pi->boot_pcie_gen;
 
-	if (pi->mem_gddr5) {
+	if (adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5) {
 		table->initialState.levels[0].strobeMode =
 			si_get_strobe_mode_settings(adev,
 						    initial_state->performance_levels[0].mclk);
@@ -5237,7 +5237,7 @@ static int si_init_smc_table(struct amdgpu_device *adev)
 	if (adev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_STEPVDDC)
 		table->systemFlags |= PPSMC_SYSTEMFLAG_STEPVDDC;
 
-	if (pi->mem_gddr5)
+	if (adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5)
 		table->systemFlags |= PPSMC_SYSTEMFLAG_GDDR5;
 
 	if (adev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_REVERT_GPIO5_POLARITY)
@@ -5414,7 +5414,7 @@ static int si_populate_mclk_value(struct amdgpu_device *adev,
 	mpll_ad_func_cntl &= ~YCLK_POST_DIV_MASK;
 	mpll_ad_func_cntl |= YCLK_POST_DIV(mpll_param.post_div);
 
-	if (pi->mem_gddr5) {
+	if (adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5) {
 		mpll_dq_func_cntl &= ~(YCLK_SEL_MASK | YCLK_POST_DIV_MASK);
 		mpll_dq_func_cntl |= YCLK_SEL(mpll_param.yclk_sel) |
 			YCLK_POST_DIV(mpll_param.post_div);
@@ -5426,7 +5426,7 @@ static int si_populate_mclk_value(struct amdgpu_device *adev,
 		u32 tmp;
 		u32 reference_clock = adev->clock.mpll.reference_freq;
 
-		if (pi->mem_gddr5)
+		if (adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5)
 			freq_nom = memory_clock * 4;
 		else
 			freq_nom = memory_clock * 2;
@@ -5518,7 +5518,7 @@ static int si_convert_power_level_to_smc(struct amdgpu_device *adev,
 			level->mcFlags |= SISLANDS_SMC_MC_PG_EN;
 	}
 
-	if (pi->mem_gddr5) {
+	if (adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5) {
 		if (pl->mclk > pi->mclk_edc_enable_threshold)
 			level->mcFlags |= SISLANDS_SMC_MC_EDC_RD_FLAG;
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#13 lore raw

PATCH v2 12/15 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
index e1b2ab5..8541830 100644
@@ -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
author
#14 lore raw

PATCH v2 13/15 drm/amdgpu: introduce pcie port read/write entry

In reply to a message not in the archive

This 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
index 19c9a2e..6eb1d3d 100644
@@ -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
index 8eb5396..a20a2b2 100644
@@ -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
author
#15 lore raw

PATCH v2 14/15 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
index 8541830..b63dd39 100644
@@ -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
author
#16 lore raw

PATCH v2 15/15 drm/amdgpu/si: enable SI DPM by default

In reply to a message not in the archive

SI 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
index b63dd39..0c3bc22 100644
@@ -7633,7 +7633,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 */
@@ -7760,7 +7760,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);
@@ -7805,7 +7805,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
#17 lore raw
In reply to a message not in the archive
Quoted 15 lines · Huang Rui

Hi all,

These patchest resolve the DPM issues of SI.
SI DPM doesn't work since it implemented, the following patches fix several issues to make SI DPM workable now.

Patch 1: Update SI firmware path to share it with radeon

Patch 2 -> 4: Add firmware version for checking firmware loading via sysfs.

Patch 5 -> 6: Refine the codes for si dpm.

Patch 7 -> 14: Fix the issues which impact DPM functionality.

Quoted 9 lines

Patch 15: Enable SI DPM by default.

Changes from V1 -> V2:
- Add a patch to update SI dpm path to firmware/radeon
- Reword patch 5 to "unused function" according to Christian's comments
- Drop ASIC_IS_DCE6 macro
- Modify patch 11 to use "adev->mc.vram_type" instead of pi->mem_gddr5

I've squashed most of these into the original patches and pushed the whole things. Thanks!

Alex

Quoted 32 lines

Thanks,
Rui

Huang Rui (15):
drm/amdgpu/si: update si firmware path
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 unused function forward define drm/amdgpu: use DRM print instead of printk
drm/amdgpu: fix oland and hainan asic specific handle at
si_program_aspm
drm/amdgpu/si: drop ASIC_IS_DCE6 macro on SI
drm/amdgpu: fix the tahiti specific value of DEEP_SLEEP_CLK_SEL field drm/amdgpu: fix to miss adding thermal controller drm/amdgpu: use vram_type instead of checking mem_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           |  60 +++++++-------
 drivers/gpu/drm/amd/amdgpu/si_smc.c           |   1 +
 drivers/gpu/drm/amd/include/asic_reg/si/sid.h |   1 -
 8 files changed, 114 insertions(+), 82 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

#18 lore raw
In reply to a message not in the archive

Hi Rui,

Do you have Tahiti LE in the office? It might be worth testing it to see if it works. There were some issues with it in the past.

Marek

Quoted 56 lines · Huang Rui

Hi all,

These patchest resolve the DPM issues of SI.
SI DPM doesn't work since it implemented, the following patches fix several issues to make SI DPM workable now.

Patch 1: Update SI firmware path to share it with radeon

Patch 2 -> 4: Add firmware version for checking firmware loading via sysfs.

Patch 5 -> 6: Refine the codes for si dpm.

Patch 7 -> 14: Fix the issues which impact DPM functionality.

Patch 15: Enable SI DPM by default.

Changes from V1 -> V2:
- Add a patch to update SI dpm path to firmware/radeon
- Reword patch 5 to "unused function" according to Christian's comments
- Drop ASIC_IS_DCE6 macro
- Modify patch 11 to use "adev->mc.vram_type" instead of pi->mem_gddr5

Thanks,
Rui

Huang Rui (15):
drm/amdgpu/si: update si firmware path
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 unused function forward define drm/amdgpu: use DRM print instead of printk
drm/amdgpu: fix oland and hainan asic specific handle at
si_program_aspm
drm/amdgpu/si: drop ASIC_IS_DCE6 macro on SI
drm/amdgpu: fix the tahiti specific value of DEEP_SLEEP_CLK_SEL field drm/amdgpu: fix to miss adding thermal controller drm/amdgpu: use vram_type instead of checking mem_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           |  60 +++++++-------
 drivers/gpu/drm/amd/amdgpu/si_smc.c           |   1 +
 drivers/gpu/drm/amd/include/asic_reg/si/sid.h |   1 -
 8 files changed, 114 insertions(+), 82 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

A message that is not in the archive (sent off-list or not yet received): CAAxE2A6D3hAP1D3i0py3G4erMGNq8-5LjypVA_PnEQQSUjEshQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#21 lore raw
Quoted 8 lines · Huang Rui
Quoted 5 lines · Marek Olšák

Hi Rui,

Do you have Tahiti LE in the office? It might be worth testing it to see if it works. There were some issues with it in the past.

I used Tahiti XT [Device ID 6798], do you know the device id of Tahiti LE?

No, I only know that Tahiti LE is Radeon HD 7870 XT. It was made by Sapphire and Powercolor.

Marek
_______________________________________________
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): CAAxE2A46-75NBq1Bn0o6-EsmsRS6yYOqacfL973SSSVexgwPpA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#23 lore raw
Quoted 4 lines · Marek Olšák
Quoted 3 lines · Huang Rui
Quoted 2 lines · Marek Olšák

Hi Rui,

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

Do you have Tahiti LE in the office? It might be worth testing it to see if it works. There were some issues with it in the past.

I used Tahiti XT [Device ID 6798], do you know the device id of Tahiti LE?

No, I only know that Tahiti LE is Radeon HD 7870 XT. It was made by Sapphire and Powercolor.

OK, my card is Radeon HD 7970 XT. It works well. Do you know what kind of issues, anymore info?

Thanks,
Rui
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#24 lore raw
Quoted 9 lines · Huang Rui
Quoted 8 lines · Marek Olšák
Quoted 7 lines · Huang Rui
Quoted 5 lines · Marek Olšák

Hi Rui,

Do you have Tahiti LE in the office? It might be worth testing it to see if it works. There were some issues with it in the past.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I used Tahiti XT [Device ID 6798], do you know the device id of Tahiti LE?

No, I only know that Tahiti LE is Radeon HD 7870 XT. It was made by Sapphire and Powercolor.

OK, my card is Radeon HD 7970 XT. It works well. Do you know what kind of issues, anymore info?

See https://bugs.freedesktop.org/show_bug.cgi?id=60879 . The PCI ID is 0x679e.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx