2010/2/19 Ákos Maróy
Rafał Miłecki wrote:
There is not ready command for that, you have to write it. AtomBIOS table is defined for that (GetEngineClock and it's parameters).
indeed.
I've implemented two functions to get the engine and the memory clocks, see below. the output after the low power mode setting is:
(II) RADEON(0): Force Low Power Mode Enabled (II) RADEON(0): Power Mode Switch (II) RADEON(0): Engine Clock Set To 249980 (II) RADEON(0): Memory Clock Set To 799870
thus, the engine clock is indeed set to 250MHz, the memory clock is 800MHz. it seems the engine clock is half of the default one, as Alex also said, while the memory clock is unchanged at 800MHz:
(II) RADEON(0): Default Engine Clock: 500000 (II) RADEON(0): Default Memory Clock: 800000
I wonder if the clock can be set lower, or if it makes sense to change the memory clock?
It does make sense to change it, but the memory clock is trickier to deal with than the engine clock because you need make sure you don't lower it too much for your current bandwidth requirements (3D engine, displays, etc.) or you'll get underflow and display or rendering problems.
here's the diff of what I did - the 10x multiplier I put there after I found this sample for radeonhd: http://lists.opensuse.org/radeonhd/2009-04/msg00163.html actually the possibility in this patch to set the desired clock looks quite good. I wonder what are the acceptable clock speeds...
Atom tables use 10 khz units. There are power tables in the bios that have sets of known good clock combinations. The ddx doesn't currently use them, however, kms does. If you really want to play with power management KMS is your best bet. The ddx options are more of a stop gap until the kms code is more mature.
(BTW, I can't use radeonhd, as it says it cannot find a display device)
rhd doesn't have support for evergreen cards at the moment. Alex
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c index 0fa53ff..ab719aa 100644 --- a/src/radeon_atombios.c +++ b/src/radeon_atombios.c @@ -578,6 +578,42 @@ atombios_static_pwrmgt_setup(ScrnInfoPtr pScrn, Bool enable
}
+uint32_t +atombios_get_memory_clock(ScrnInfoPtr pScrn) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + GET_MEMORY_CLOCK_PARAMETERS mem_p; + AtomBiosArgRec data; + + RADEONWaitForIdleMMIO(pScrn); + + data.exec.index = GetIndexIntoMasterTable(COMMAND, GetMemoryClock); + data.exec.pspace = &mem_p; + + if (RHDAtomBiosFunc(info->atomBIOS->scrnIndex, info->atomBIOS, ATOMBIOS_EXE + return mem_p.ulReturnMemoryClock * 10ul;; + } + return 0; +} + +uint32_t +atombios_get_engine_clock(ScrnInfoPtr pScrn) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + GET_ENGINE_CLOCK_PARAMETERS eng_p; + AtomBiosArgRec data; + + RADEONWaitForIdleMMIO(pScrn); + + data.exec.index = GetIndexIntoMasterTable(COMMAND, GetEngineClock); + data.exec.pspace = &eng_p; + + if (RHDAtomBiosFunc(info->atomBIOS->scrnIndex, info->atomBIOS, ATOMBIOS_EXE + return eng_p.ulReturnEngineClock * 10ul; + } + return 0; +} + int atombios_set_engine_clock(ScrnInfoPtr pScrn, uint32_t engclock) { diff --git a/src/radeon_atombios.h b/src/radeon_atombios.h index 1f21c46..ebcd6ed 100644 --- a/src/radeon_atombios.h +++ b/src/radeon_atombios.h @@ -122,6 +122,12 @@ atombios_clk_gating_setup(ScrnInfoPtr pScrn, Bool enable); extern int atombios_static_pwrmgt_setup(ScrnInfoPtr pScrn, Bool enable);
+extern uint32_t +atombios_get_memory_clock(ScrnInfoPtr pScrn); + +extern uint32_t +atombios_get_engine_clock(ScrnInfoPtr pScrn); + extern int atombios_set_engine_clock(ScrnInfoPtr pScrn, uint32_t engclock);
diff --git a/src/radeon_pm.c b/src/radeon_pm.c index d5152c8..3b45418 100644 --- a/src/radeon_pm.c +++ b/src/radeon_pm.c @@ -754,6 +754,7 @@ static void RADEONSetStaticPowerMode(ScrnInfoPtr pScrn, RADE { RADEONInfoPtr info = RADEONPTR(pScrn); int i; + int clock;
for (i = 0; i < info->pm.num_modes; i++) { if (info->pm.mode[i].type == type) @@ -779,6 +780,12 @@ static void RADEONSetStaticPowerMode(ScrnInfoPtr pScrn, RAD info->pm.current_mode = i;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Power Mode Switch\n"); + + clock = atombios_get_engine_clock(pScrn); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Engine Clock Set To %d\n", clock); + + clock = atombios_get_memory_clock(pScrn); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Memory Clock Set To %d\n", clock); }
-- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org