Skip to contentSkip to conversation

drm/radeon/dpm: add debugfs support for rs780

PATCH In review Anthoine Bourgeois 2 participants 3 messages Jul 16, 2013 – Jul 17, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon/dpm: add debugfs support for rs780

This allows you to look at the current DPM state via debugfs.

---

drivers/gpu/drm/radeon/radeon_asic.c |  1 +
drivers/gpu/drm/radeon/radeon_asic.h |  2 ++
drivers/gpu/drm/radeon/rs780_dpm.c   | 28 ++++++++++++++++++++++++++++
3 files changed, 31 insertions(+)
drivers/gpu/drm/radeon/radeon_asic.c +0 -0
index fea997e..78bec1a 100644
@@ -1270,6 +1270,7 @@ static struct radeon_asic rs780_asic = {
		.get_sclk = &rs780_dpm_get_sclk,
		.get_mclk = &rs780_dpm_get_mclk,
		.print_power_state = &rs780_dpm_print_power_state,
+		.debugfs_print_current_performance_level = &rs780_dpm_debugfs_print_current_performance_level,
	},
	.pflip = {
		.pre_page_flip = &rs600_pre_page_flip,
drivers/gpu/drm/radeon/radeon_asic.h +0 -0
index b04b578..ca18957 100644
@@ -433,6 +433,8 @@ u32 rs780_dpm_get_sclk(struct radeon_device *rdev, bool low);

u32 rs780_dpm_get_mclk(struct radeon_device *rdev, bool low); void rs780_dpm_print_power_state(struct radeon_device *rdev,

				 struct radeon_ps *ps);

+void rs780_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
+ struct seq_file *m);

/* uvd */
int r600_uvd_init(struct radeon_device *rdev);

drivers/gpu/drm/radeon/rs780_dpm.c +0 -0
index bef832a..ef5a28e 100644
@@ -961,3 +961,31 @@ u32 rs780_dpm_get_mclk(struct radeon_device *rdev, bool low)
 
	return pi->bootup_uma_clk;
}

+
+void rs780_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
+ struct seq_file *m)
+{
+ struct radeon_ps *rps = rdev->pm.dpm.current_ps;
+ struct igp_ps *ps = rs780_get_ps(rps);
+ u32 sclk;
+ enum rs780_vddc_level vddc;
+ u32 current_index = r600_power_level_get_current_index(rdev);
+
+ if (current_index > 1) {
+ seq_printf(m, "invalid dpm profile %d\n", current_index);
+ } else {
+ if (current_index == 0) {
+ sclk = ps->sclk_low;
+ vddc = rs780_get_voltage_for_vddc_level(rdev,
+ ps->min_voltage);
+ } else { /* current_index == 1 */
+ sclk = ps->sclk_high;
+ vddc = rs780_get_voltage_for_vddc_level(rdev,
+ ps->max_voltage);
+ }
+ seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk);
+ seq_printf(m, "power level %d sclk: %u mclk: %u vddc: %u\n",
+ current_index, sclk,
+ rs780_dpm_get_mclk(rdev, false), vddc);
+ }
+}

Signature · 1 line
1.8.1.5
#1 lore raw
Quoted 61 lines

-----Original Message-----
From: Anthoine Bourgeois [mailto:[email protected]]
Sent: Tuesday, July 16, 2013 5:09 PM
To: Deucher, Alexander; Koenig, Christian; Jerome Glisse; Anthoine Bourgeois
Cc: [email protected]
Subject: [PATCH] drm/radeon/dpm: add debugfs support for rs780

This allows you to look at the current DPM state via debugfs.

---
 drivers/gpu/drm/radeon/radeon_asic.c |  1 +
 drivers/gpu/drm/radeon/radeon_asic.h |  2 ++
 drivers/gpu/drm/radeon/rs780_dpm.c   | 28
++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
drivers/gpu/drm/radeon/radeon_asic.c +1 -0
index fea997e..78bec1a 100644
@@ -1270,6 +1270,7 @@ static struct radeon_asic rs780_asic = {
 		.get_sclk = &rs780_dpm_get_sclk,
 		.get_mclk = &rs780_dpm_get_mclk,
 		.print_power_state = &rs780_dpm_print_power_state,
+		.debugfs_print_current_performance_level =
 &rs780_dpm_debugfs_print_current_performance_level,
 	},
 	.pflip = {
drivers/gpu/drm/radeon/radeon_asic.c +0 -0
 		.pre_page_flip = &rs600_pre_page_flip,
drivers/gpu/drm/radeon/radeon_asic.h +2 -0
index b04b578..ca18957 100644
@@ -433,6 +433,8 @@ u32 rs780_dpm_get_sclk(struct radeon_device *rdev,
 bool low);
 u32 rs780_dpm_get_mclk(struct radeon_device *rdev, bool low);
 void rs780_dpm_print_power_state(struct radeon_device *rdev,
 				 struct radeon_ps *ps);
+void rs780_dpm_debugfs_print_current_performance_level(struct
 radeon_device *rdev,
+						       struct seq_file *m);
 

/* uvd */
int r600_uvd_init(struct radeon_device *rdev);

drivers/gpu/drm/radeon/rs780_dpm.c +2 -0
index bef832a..ef5a28e 100644
@@ -961,3 +961,31 @@ u32 rs780_dpm_get_mclk(struct radeon_device
 *rdev, bool low)
 
 	return pi->bootup_uma_clk;
 }
+
+void rs780_dpm_debugfs_print_current_performance_level(struct

radeon_device *rdev,

drivers/gpu/drm/radeon/rs780_dpm.c

Quoted 8 lines
drivers/gpu/drm/radeon/rs780_dpm.c +8 -0
+						       struct seq_file *m)
+{
+	struct radeon_ps *rps = rdev->pm.dpm.current_ps;
+	struct igp_ps *ps = rs780_get_ps(rps);
+	u32 sclk;
+	enum rs780_vddc_level vddc;
+	u32 current_index = r600_power_level_get_current_index(rdev);
+

Rs780 uses different dpm hardware compared to other r6xx asics, so r600_power_level_get_current_index() doesn't actually do anything on rs780. There's no convenient way to look this up on rs780. I attempted to add support for it:
http://people.freedesktop.org/~agd5f/0001-drm-radeon-dpm-add-debugfs-support-for-RS780-RS880.patch
but the registers don't seem read back reliably when dpm is enabled so the output is bogus.

Alex

Quoted 25 lines
drivers/gpu/drm/radeon/rs780_dpm.c +7 -0
+	if (current_index > 1) {
+		seq_printf(m, "invalid dpm profile %d\n", current_index);
+	} else {
+		if (current_index == 0) {
+			sclk = ps->sclk_low;
+			vddc = rs780_get_voltage_for_vddc_level(rdev,
+								ps-
Quoted 1 line

min_voltage);

drivers/gpu/drm/radeon/rs780_dpm.c +4 -0
+		} else { /* current_index == 1 */
+			sclk = ps->sclk_high;
+			vddc = rs780_get_voltage_for_vddc_level(rdev,
+								ps-
Quoted 1 line

max_voltage);

drivers/gpu/drm/radeon/rs780_dpm.c +2 -0
+		}
+		seq_printf(m, "uvd    vclk: %d dclk: %d\n", rps->vclk, rps-
Quoted 1 line

dclk);

drivers/gpu/drm/radeon/rs780_dpm.c +1 -0
+		seq_printf(m, "power level %d    sclk: %u mclk: %u vddc:

%u\n",

drivers/gpu/drm/radeon/rs780_dpm.c +4 -1
+			   current_index, sclk,
+			   rs780_dpm_get_mclk(rdev, false), vddc);
+	}
+}
--

1.8.1.5

#2 lore raw

2013/7/16 Deucher, Alexander <[email protected]>

Quoted 56 lines
Quoted 56 lines

-----Original Message-----
From: Anthoine Bourgeois [mailto:[email protected]]
Sent: Tuesday, July 16, 2013 5:09 PM
To: Deucher, Alexander; Koenig, Christian; Jerome Glisse; Anthoine Bourgeois
Cc: [email protected]
Subject: [PATCH] drm/radeon/dpm: add debugfs support for rs780

This allows you to look at the current DPM state via debugfs.

---
 drivers/gpu/drm/radeon/radeon_asic.c |  1 +
 drivers/gpu/drm/radeon/radeon_asic.h |  2 ++
 drivers/gpu/drm/radeon/rs780_dpm.c   | 28
++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
drivers/gpu/drm/radeon/radeon_asic.c +1 -0
index fea997e..78bec1a 100644
@@ -1270,6 +1270,7 @@ static struct radeon_asic rs780_asic = {
              .get_sclk = &rs780_dpm_get_sclk,
              .get_mclk = &rs780_dpm_get_mclk,
              .print_power_state = &rs780_dpm_print_power_state,
+             .debugfs_print_current_performance_level =
 &rs780_dpm_debugfs_print_current_performance_level,
      },
      .pflip = {
              .pre_page_flip = &rs600_pre_page_flip,
drivers/gpu/drm/radeon/radeon_asic.h +2 -0
index b04b578..ca18957 100644
@@ -433,6 +433,8 @@ u32 rs780_dpm_get_sclk(struct radeon_device *rdev,
 bool low);
 u32 rs780_dpm_get_mclk(struct radeon_device *rdev, bool low);
 void rs780_dpm_print_power_state(struct radeon_device *rdev,
                               struct radeon_ps *ps);
+void rs780_dpm_debugfs_print_current_performance_level(struct
 radeon_device *rdev,
+                                                    struct seq_file *m);
 

/* uvd */
int r600_uvd_init(struct radeon_device *rdev);

drivers/gpu/drm/radeon/rs780_dpm.c +0 -0
index bef832a..ef5a28e 100644
@@ -961,3 +961,31 @@ u32 rs780_dpm_get_mclk(struct radeon_device
 *rdev, bool low)
 
Quoted 16 lines

drivers/gpu/drm/radeon/rs780_dpm.c

Quoted 13 lines
drivers/gpu/drm/radeon/rs780_dpm.c +2 -0
      return pi->bootup_uma_clk;
 }
+
+void rs780_dpm_debugfs_print_current_performance_level(struct

radeon_device *rdev,

drivers/gpu/drm/radeon/rs780_dpm.c +8 -0
+                                                    struct seq_file *m)
+{
+     struct radeon_ps *rps = rdev->pm.dpm.current_ps;
+     struct igp_ps *ps = rs780_get_ps(rps);
+     u32 sclk;
+     enum rs780_vddc_level vddc;
+     u32 current_index = r600_power_level_get_current_index(rdev);
+

Rs780 uses different dpm hardware compared to other r6xx asics, so r600_power_level_get_current_index() doesn't actually do anything on rs780.

In that case is there any reason to do a r600_power_level_set_enter_index in the rs780_initialize_dpm_parameters ? This function set the same register TARGET_AND_CURRENT_PROFILE_INDEX.

I try to change the index value of this call to R600_POWER_LEVEL_MEDIUM to test my patch. The r600_power_level_get_current_index returns the modified index afterward but doesn't seem very "dynamic". I try to implement force_performance_level and in that case a r600_power_level_set_enter_index doesn't seem to modify the register.

Quoted 8 lines

There's no convenient way to look this up on rs780. I attempted to add support for it:

http://people.freedesktop.org/~agd5f/0001-drm-radeon-dpm-add-debugfs-support-for-RS780-RS880.patch
but the registers don't seem read back reliably when dpm is enabled so the output is bogus.

Too bad :-(

Thanks,
Anthoine

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel