aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/ni_dpm.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-02-18drm/radeon/ni: fix typo in dpm sq ramping setupAlex Deucher1-1/+1
inverted logic. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2014-02-06drm/radeon/dpm: use stored max_vddc rather than looking it upAlex Deucher1-3/+2
When we parse the power tables use the stored mac_vddc value rather than lookig it up manually each time. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-06drm/radeon/dpm: use the driver state for dpm debugfsAlex Deucher1-1/+2
For btc and newer, we may modify the power state depending on the circumstances. Use the modified state rather than the base state. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24drm/radeon/pm: move pm handling into the asic specific codeAlex Deucher1-0/+6
We need more control over the ordering of dpm init with respect to the rest of the asic. Specifically, the SMC has to be initialized before the rlc and cg/pg. The pm code currently initializes late in the driver, but we need it to happen much earlier so move pm handling into the asic specific callbacks. This makes dpm more reliable and makes clockgating work properly on CIK parts and should help on SI parts as well. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24drm/radeon/dpm: switch on new late_enable callbackAlex Deucher1-15/+0
Right now it's called right after enable, but after reworking the dpm init order, it will get called later to accomodate loading the smc early, but enabling thermal interrupts and block powergating later after the ring tests are complete. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-02drm/radeon/dpm: simplify state adjust logic for NIAlex Deucher1-17/+11
This is based on a similar patch from Alexandre Demers. While fixing up some warnings with that patch I saw some additional cleanups that could be applied. This patch simplifies the logic for patching the power state. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: Alexandre Demers <alexandre.f.demers@gmail.com>
2013-11-15drm: radeon: ni_dpm: Fix unused variable warning when CONFIG_ACPI=nFabio Estevam1-1/+1
With CONFIG_ACPI=n the following build warning is seen: drivers/gpu/drm/radeon/ni_dpm.c:3448:31: warning: unused variable 'eg_pi' [-Wunused-variable] Move the definition of eg_pi inside the CONFIG_ACPI 'if' block. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-23drm/radeon/dpm/ni: filter clocks based on voltage/clk dep tablesAlex Deucher1-0/+24
filter out mclk and sclk levels higher than listed in the clk voltage dependency tables. Supporting these clocks will require additional driver tweaking that isn't supported yet. See bug: https://bugs.freedesktop.org/show_bug.cgi?id=68235 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-15drm/radeon/dpm: rework auto performance level enableAlex Deucher1-6/+0
Calling force_performance_level() from set_power_state() doesn't work on some asics because the current power state pointer has not been properly updated at that point. Move the calls to force_performance_level() out of the asic specific set_power_state() functions and into the main power state sequence. Fixes dpm resume on SI. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30drm/radeon/dpm: make sure dc performance level limits are valid (BTC-SI) (v2)Alex Deucher1-0/+6
Check to make sure the dc limits are valid before using them. Some systems may not have a dc limits table. In that case just use the ac limits. This fixes hangs on systems when the power state is changed when on battery (dc) due to invalid performance state parameters. Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=68708 v2: fix up limits in dpm_init() Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2013-08-30drm/radeon: gcc fixes for ni dpmAlex Deucher1-2/+3
Newer versions of gcc seem to wander off into the weeds when dealing with variable sizes arrays in structs. Rather than indexing the arrays, use pointer arithmetic. See bugs: https://bugs.freedesktop.org/show_bug.cgi?id=66932 https://bugs.freedesktop.org/show_bug.cgi?id=66972 https://bugs.freedesktop.org/show_bug.cgi?id=66945 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30drm/radeon/dpm: adjust the vblank time checks for eg, ni, siAlex Deucher1-1/+2
According to the internal teams, we never hit the limit for mclk switching on these asics, so we can disable the check. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07drm/radeon/dpm: fix spread spectrum setup (v2)Alex Deucher1-13/+1
Need to check for engine and memory clock ss separately and only enable dynamic ss if either of them are found. This should fix systems which have a ss table, but do not have entries for engine or memory. On those systems we may enable dynamic spread spectrum without enabling it on the engine or memory clocks which can lead to a hang in some cases. fixes some systems reported here: https://bugs.freedesktop.org/show_bug.cgi?id=66963 v2: fix typo Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07drm/radeon/dpm: adjust thermal protection requirementsAlex Deucher1-2/+1
On rv770 and newer, clock gating is not required for thermal protection. The only requirement is that the design utilizes a thermal sensor. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-29drm/radeon/dpm: fix forcing performance state to low on caymanAlex Deucher1-6/+1
Need to program EnabledLevels to 1 to force the low state. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-08drm/radeon/dpm: implement vblank_too_short callback for caymanAlex Deucher1-1/+15
Check if we can switch the mclk during the vblank time otherwise we may get artifacts on the screen when the mclk changes. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-05drm/radeon/dpm: implement force performance level for caymanAlex Deucher1-7/+31
Allows you to force a performance level via sysfs. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-02drm/radeon/dpm: fix compilation with certain versions of gccMike Lothian1-0/+1
Add #include <linux/seq_file.h> to *_dpm.c files Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-01drm/radeon/dpm: add debugfs support for caymanAlex Deucher1-0/+20
This allows you to look at the current DPM state via debugfs. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-01drm/radeon/dpm: re-enable state transitions for CaymanAlex Deucher1-5/+0
Was disabled due to stability issues on certain boards caused by the a bug in the parsing of the atom mc reg tables. That's fixed now so re-enable. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/NI: fix TDP adjustment in set_power_stateAlex Deucher1-7/+11
Fixes hangs with DPM in some cases. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/dpm: fix UVD clock setting on caymanAlex Deucher1-2/+38
The rv770 version was using the wrong power state type. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon: fix typo in ni_print_power_stateAlex Deucher1-4/+4
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27add dpm_set_power_state failure output (7xx-ni)Alex Deucher1-1/+3
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/dpm: add dpm_set_power_state failure output (7xx-ni)Alex Deucher1-12/+36
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/dpm: add dpm_enable failure output (7xx-ni)Alex Deucher1-12/+36
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/kms: add dpm support for SI (v7)Alex Deucher1-9/+13
This adds dpm support for SI asics. This includes: - dynamic engine clock scaling - dynamic memory clock scaling - dynamic voltage scaling - dynamic pcie gen1/gen2/gen3 switching - power containment - shader power scaling Set radeon.dpm=1 to enable. v2: enable hainan support, rebase v3: guard acpi stuff v4: fix 64 bit math v5: fix 64 bit div harder v6: fix thermal interrupt check noticed by Jerome v7: attempt fix state enable Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/dpm/ni: properly catch errors in dpm setupAlex Deucher1-34/+98
We weren't properly catching errors in dpm_enable() and dpm_set_power_state(). Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon: update radeon_atombios_get_default_voltages for mvddAlex Deucher1-2/+2
Add a way to look up the bootup mvdd. Required for DPM on SI. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/dpm: validate voltages against dispclk requirementsAlex Deucher1-1/+20
Validate the voltages against the voltage requirements of the dispclk. We currently don't adjust the disp clock so it never changes, but we need to filter out voltage levels that are too low none the less. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/dpm/cayman: use new fixed point functions (v2)Alex Deucher1-35/+11
Use the new fixed point functions for leakage calculations on cayman. v2: fix up 64 bit math Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon: update radeon_atom_is_voltage_gpio() for SIAlex Deucher1-3/+3
SI uses a new atom table. Required for DPM on SI. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon: add missing UVD clock set in cayman dpm codeAlex Deucher1-0/+3
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/dpm: add pre/post_set_power_state callback (cayman)Alex Deucher1-11/+54
This properly implemented dynamic state adjustment by using a working copy of the requested and current power states. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/dpm/cayman: restructure codeAlex Deucher1-33/+36
Needed to properly handle dynamic state adjustment. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/dpm/btc: restructure codeAlex Deucher1-1/+2
Needed to properly handle dynamic state adjustment. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27drm/radeon/kms: add dpm support for cayman (v5)Alex Deucher1-0/+4113
This adds dpm support for cayman asics. This includes: - clockgating - dynamic engine clock scaling - dynamic memory clock scaling - dynamic voltage scaling - dynamic pcie gen1/gen2 switching (requires additional acpi support) - power containment - shader power scaling Set radeon.dpm=1 to enable. v2: fold in tdp fix v3: fix indentation v4: fix 64 bit div v5: attempt to fix state enable Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>