dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] drm/radeon/dpm: fetch the max clk from voltage dep tables helper
@ 2013-09-21 19:53 Alex Deucher
  2013-09-21 19:53 ` [PATCH 2/6] drm/radeon/dpm/btc: filter clocks based on voltage/clk dep tables Alex Deucher
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Alex Deucher @ 2013-09-21 19:53 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher

This patch adds a helper function to fetch the max clock
from the voltage clock dependecy tables.  Clocks above that
level tend to be unstable and will require additional driver
tweaks in order to work properly.

This patch implemented the helper function to fetch the max clocks
from the dependency tables.  The following patches implement the
per-asic clock filtering.

See bug:
https://bugs.freedesktop.org/show_bug.cgi?id=68235

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/radeon/btc_dpm.c | 17 +++++++++++++++++
 drivers/gpu/drm/radeon/btc_dpm.h |  2 ++
 2 files changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c
index 05ff315..0d0f065 100644
--- a/drivers/gpu/drm/radeon/btc_dpm.c
+++ b/drivers/gpu/drm/radeon/btc_dpm.c
@@ -1168,6 +1168,23 @@ static const struct radeon_blacklist_clocks btc_blacklist_clocks[] =
         { 25000, 30000, RADEON_SCLK_UP }
 };
 
+void btc_get_max_clock_from_voltage_dependency_table(struct radeon_clock_voltage_dependency_table *table,
+						     u32 *max_clock)
+{
+	u32 i, clock = 0;
+
+	if ((table == NULL) || (table->count == 0)) {
+		*max_clock = clock;
+		return;
+	}
+
+	for (i = 0; i < table->count; i++) {
+		if (clock < table->entries[i].clk)
+			clock = table->entries[i].clk;
+	}
+	*max_clock = clock;
+}
+
 void btc_apply_voltage_dependency_rules(struct radeon_clock_voltage_dependency_table *table,
 					u32 clock, u16 max_voltage, u16 *voltage)
 {
diff --git a/drivers/gpu/drm/radeon/btc_dpm.h b/drivers/gpu/drm/radeon/btc_dpm.h
index 1a15e0e..3b6f12b 100644
--- a/drivers/gpu/drm/radeon/btc_dpm.h
+++ b/drivers/gpu/drm/radeon/btc_dpm.h
@@ -46,6 +46,8 @@ void btc_adjust_clock_combinations(struct radeon_device *rdev,
 				   struct rv7xx_pl *pl);
 void btc_apply_voltage_dependency_rules(struct radeon_clock_voltage_dependency_table *table,
 					u32 clock, u16 max_voltage, u16 *voltage);
+void btc_get_max_clock_from_voltage_dependency_table(struct radeon_clock_voltage_dependency_table *table,
+						     u32 *max_clock);
 void btc_apply_voltage_delta_rules(struct radeon_device *rdev,
 				   u16 max_vddc, u16 max_vddci,
 				   u16 *vddc, u16 *vddci);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-21 19:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-21 19:53 [PATCH 1/6] drm/radeon/dpm: fetch the max clk from voltage dep tables helper Alex Deucher
2013-09-21 19:53 ` [PATCH 2/6] drm/radeon/dpm/btc: filter clocks based on voltage/clk dep tables Alex Deucher
2013-09-21 19:53 ` [PATCH 3/6] drm/radeon/dpm/ni: " Alex Deucher
2013-09-21 19:53 ` [PATCH 4/6] drm/radeon/dpm/si: " Alex Deucher
2013-09-21 19:53 ` [PATCH 5/6] drm/radeon/dpm/ci: " Alex Deucher
2013-09-21 19:53 ` [PATCH 6/6] drm/radeon: don't set default clocks for SI when DPM is disabled Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).