Skip to contentSkip to conversation

drm/radeon/kms: dynclks fixes

PATCH New Alex Deucher 1 participant 1 message Feb 5, 2010

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

PATCH 1/1 drm/radeon/kms: dynclks fixes

Quoted 1 line

From c29850388327d9cc6c0370b1fc0d0920df92bffe Mon Sep 17 00:00:00 2001

From: Alex Deucher <[email protected]>
Date: Fri, 5 Feb 2010 00:55:32 -0500
Subject: [PATCH] drm/radeon/kms: dynclks fixes

- only r4xx/r5xx/rs6xx/rs740 have clock gating atom table, so disable it on r6xx. it's already disabled on r7xx
- check to make sure the clock_gating hook exists before calling it. This avoids a segfault on asics without that function.
- remove unused static power management function.

---
 drivers/gpu/drm/radeon/radeon_asic.h     |    2 +-
 drivers/gpu/drm/radeon/radeon_atombios.c |   10 ----------
 drivers/gpu/drm/radeon/radeon_clocks.c   |    6 ++++--
 3 files changed, 5 insertions(+), 13 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/radeon/radeon_asic.h
index cfeb372..e9cb801 100644

drivers/gpu/drm/radeon/radeon_asic.h +1 -1
@@ -530,7 +530,7 @@ static struct radeon_asic r600_asic = {
 	.get_memory_clock = &radeon_atom_get_memory_clock,
 	.set_memory_clock = &radeon_atom_set_memory_clock,
 	.set_pcie_lanes = NULL,
-	.set_clock_gating = &radeon_atom_set_clock_gating,
+	.set_clock_gating = NULL,
 	.set_surface_reg = r600_set_surface_reg,
 	.clear_surface_reg = r600_clear_surface_reg,
 	.bandwidth_update = &rv515_bandwidth_update,
(quoted diff) +0 -0

b/drivers/gpu/drm/radeon/radeon_atombios.c
index 6eb0ae7..f95528e 100644

drivers/gpu/drm/radeon/radeon_atombios.c +0 -0
@@ -1426,16 +1426,6 @@ void radeon_atom_set_clock_gating(struct

radeon_device *rdev, int enable)
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
}

-void radeon_atom_static_pwrmgt_setup(struct radeon_device *rdev, int enable) -{
- ENABLE_ASIC_STATIC_PWR_MGT_PS_ALLOCATION args;
- int index = GetIndexIntoMasterTable(COMMAND, EnableASIC_StaticPwrMgt);
-
- args.ucEnable = enable;
-
- atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
-}
-
uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev) {
GET_ENGINE_CLOCK_PS_ALLOCATION args;

(quoted diff) +0 -0

b/drivers/gpu/drm/radeon/radeon_clocks.c
index 747a992..f64936c 100644

drivers/gpu/drm/radeon/radeon_clocks.c +4 -2
@@ -858,8 +858,10 @@ int radeon_static_clocks_init(struct drm_device *dev)
 	/* XXX make sure engine is idle */
 
 	if (radeon_dynclks != -1) {
-		if (radeon_dynclks)
-			radeon_set_clock_gating(rdev, 1);
+		if (radeon_dynclks) {
+			if (rdev->asic->set_clock_gating)
+				radeon_set_clock_gating(rdev, 1);
+		}
 	}
 	radeon_apply_clock_quirks(rdev);
 	return 0;
Signature · 1 line
1.5.6.3

From c29850388327d9cc6c0370b1fc0d0920df92bffe Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Fri, 5 Feb 2010 00:55:32 -0500
Subject: [PATCH] drm/radeon/kms: dynclks fixes

- only r4xx/r5xx/rs6xx/rs740 have clock gating atom table, so disable it on r6xx. it's already disabled on r7xx
- check to make sure the clock_gating hook exists before calling it. This avoids a segfault on asics without that function.
- remove unused static power management function.

---
 drivers/gpu/drm/radeon/radeon_asic.h     |    2 +-
 drivers/gpu/drm/radeon/radeon_atombios.c |   10 ----------
 drivers/gpu/drm/radeon/radeon_clocks.c   |    6 ++++--
 3 files changed, 5 insertions(+), 13 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.h +1 -1
index cfeb372..e9cb801 100644
@@ -530,7 +530,7 @@ static struct radeon_asic r600_asic = {
 	.get_memory_clock = &radeon_atom_get_memory_clock,
 	.set_memory_clock = &radeon_atom_set_memory_clock,
 	.set_pcie_lanes = NULL,
-	.set_clock_gating = &radeon_atom_set_clock_gating,
+	.set_clock_gating = NULL,
 	.set_surface_reg = r600_set_surface_reg,
 	.clear_surface_reg = r600_clear_surface_reg,
 	.bandwidth_update = &rv515_bandwidth_update,
drivers/gpu/drm/radeon/radeon_atombios.c +0 -10
index 6eb0ae7..f95528e 100644
@@ -1426,16 +1426,6 @@ void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable)
 	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
 }
 
-void radeon_atom_static_pwrmgt_setup(struct radeon_device *rdev, int enable)
-{
-	ENABLE_ASIC_STATIC_PWR_MGT_PS_ALLOCATION args;
-	int index = GetIndexIntoMasterTable(COMMAND, EnableASIC_StaticPwrMgt);
-
-	args.ucEnable = enable;
-
-	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
-}
-
 uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev)
 {
 	GET_ENGINE_CLOCK_PS_ALLOCATION args;
drivers/gpu/drm/radeon/radeon_clocks.c +4 -2
index 747a992..f64936c 100644
@@ -858,8 +858,10 @@ int radeon_static_clocks_init(struct drm_device *dev)
 	/* XXX make sure engine is idle */
 
 	if (radeon_dynclks != -1) {
-		if (radeon_dynclks)
-			radeon_set_clock_gating(rdev, 1);
+		if (radeon_dynclks) {
+			if (rdev->asic->set_clock_gating)
+				radeon_set_clock_gating(rdev, 1);
+		}
 	}
 	radeon_apply_clock_quirks(rdev);
 	return 0;
Signature · 1 line
1.5.6.3

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com

--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel