Commit graph

33 commits

Author SHA1 Message Date
Alex Deucher 1955f107a7 drm/radeon: rework CI dpm thermal setup
In preparation for fan control.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-11-12 11:56:35 -05:00
Michele Curti 01467a9b5e drm/radeon: reduce sparse false positive warnings
include radeon_asic.h header file in the various xxx_dpm.c files
to reduce sparse false positive warnings. Not so great patch
in itself, but reducing warning count from 391 to 258 may help
to see real problems..

Signed-off-by: Michele Curti <michele.curti@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-10-16 18:34:10 -04:00
Alex Deucher 3e15c35374 drm/radeon/ci: add uvd/vce info to dpm debugfs output
Track whether UVD or VCE are enabled in debugfs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-10-03 09:19:17 -04:00
Alex Deucher 6aff1e282a drm/radeon/dpm: drop clk/voltage dependency filters for CI
Not sure this was ever necessary for CI, was just done
to be on the safe side.

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

Reviewed-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-10-01 09:00:06 -04:00
Oleg Chernovskiy 6bce8d9772 drm/radeon: Add missing lines to ci_set_thermal_temperature_range
Properly set the thermal min and max temp on CI.
Otherwise, we end up setting the thermal ranges
to 0 on resume and end up in the lowest power state.

Signed-off-by: Oleg Chernovskiy <algonkvel@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2014-08-15 00:58:18 -04:00
Alex Deucher 6b57f20cb5 drm/radeon/dpm: handle voltage info fetching on hawaii
Some hawaii cards use a different method to fetch the
voltage info from the vbios.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2014-08-05 08:53:47 -04:00
Alex Deucher ed96377132 drm/radeon: fix typo in ci_stop_dpm()
Need to use the RREG32_SMC() accessor since the register
is an smc indirect index.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2014-07-10 17:01:30 -04:00
Alex Deucher 7e1858f9af drm/radeon: re-enable mclk dpm on R7 260X asics
If the new mc ucode is available.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2014-04-17 13:59:53 +02:00
Alex Deucher 6abc6d5c73 drm/radeon: update CI DPM powertune settings
As per internal recommendations.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-17 13:59:41 +02:00
Alex Deucher 57700ad1f2 drm/radeon: disable mclk dpm on R7 260X
Setting higher mclks seems to cause stability issues
on some R7 260X boards.  Disable it for now for stability
until we find a proper fix.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2014-04-17 13:59:36 +02:00
Alex Deucher a1d6f97c8c drm/radeon/cik: enable/disable vce cg when encoding v2
Some of the vce clocks are automatic, others need to
be manually enabled.  For ease, just disable cg when
vce is active.

v2: rebased

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-18 16:11:46 +01:00
Alex Deucher ee35b0024a drm/radeon: enable vce dpm on CI
VCE dpm dynamically adjusts the uvd clocks on
demand.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-18 16:11:38 +01:00
Alex Deucher 8cd366823e drm/radeon: add vce dpm support for CI
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-18 16:11:36 +01:00
Alex Deucher 82f79cc54b drm/radeon/dpm: move platform caps fetching to a separate function
It's needed by by both the asic specific functions and the
extended table parser.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-18 16:11:30 +01:00
Alex Deucher 9a04dad3a1 drm/radeon/dpm: make some functions static for CI
Noticed by Rashika Kheria and cherry-picked from
her larger patch set.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Rashika Kheria <rashika.kheria@gmail.com>
2014-01-07 12:55:37 -05:00
Alex Deucher 6c7bccea39 drm/radeon/pm: move pm handling into the asic specific code
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-24 17:57:06 -05:00
Alex Deucher e14cd2bbcb drm/radeon/dpm: switch on new late_enable callback
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-24 17:56:50 -05:00
Alex Deucher 902084278b drm/radeon/dpm: add late_enable for CI
Make sure interrupts are enabled
before we enable thermal interrupts.
Also, don't powergate uvd until after
the ring tests.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 17:56:19 -05:00
Alex Deucher f2185ecef1 drm/radeon/cik: drop cg_update from dpm code
I'm not entirely sure this is required and it won't work
with the dpm restructing anyway.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 17:54:25 -05:00
Alex Deucher 2d40038d3f drm/radeon: add hawaii dpm support
This updates the CI dpm (dynamic power management)
support for hawaii.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-08 12:33:44 -05:00
Alex Deucher a52b5eb647 drm/radeon/dpm/ci: filter clocks based on voltage/clk dep tables
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-23 10:29:53 -04:00
Alex Deucher 1cd8b21aa2 drm/radeon/dpm: rework auto performance level enable
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-09-15 20:27:52 -04:00
Stephen Rothwell ab62e76861 drm/radeon: protect ACPI calls with CONFIG_ACPI
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Alex Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-09-05 08:19:31 +10:00
Alex Deucher 679fe80fbe drm/radeon/dpm: make sure dc performance level limits are valid (CI)
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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:31:25 -04:00
Alex Deucher b309ed9867 drm/radeon: gcc fixes for ci dpm
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-30 16:31:22 -04:00
Alex Deucher 47acb1ff9b drm/radeon/dpm: track uvd gated state for ci
Track the current uvd gated state on CI to avoid unnecessary
state changes when uvd is active.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:31:06 -04:00
Alex Deucher 9597fe1e6a drm/radeon: enable uvd dpm on CI
UVD dpm dynamically adjusts the uvd clocks on
demand.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:31:05 -04:00
Alex Deucher cf0ab2cd45 drm/radeon: handle cg in CI dpm code
Clockgating needs to be disabled around certain parts
of dpm setup otherwise the smc gets into a bad state
and dpm doesn't work properly.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:57 -04:00
Alex Deucher 942bdf7f9e drm/radeon/dpm: implement UVD powergating for CI
Disable the UVD block when not in use to save power.
The block is not actually powergated on CI, but we
switch between UVD DPM (where the uvd clocks are
adjusted on demand) and clocks off.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:36 -04:00
Alex Deucher 5496131e45 drm/radeon/dpm: implement vblank_too_short callback for CI
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-08-30 16:30:31 -04:00
Alex Deucher 89536fd600 drm/radeon/dpm: implement force performance level for CI
Allows you to force the selected performance level via sysfs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:30 -04:00
Alex Deucher 94b4adc5ae drm/radeon/dpm: add debugfs support for CI
This allows you to look at the current DPM state via debugfs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:30 -04:00
Alex Deucher cc8dbbb4f6 drm/radeon: add dpm support for CI dGPUs (v2)
This adds dpm support for btc asics. This includes:
- dynamic engine clock scaling
- dynamic memory clock scaling
- dynamic voltage scaling
- dynamic pcie gen switching

Set radeon.dpm=1 to enable.

v2: remove unused radeon_atombios.c changes,
    make missing smc ucode non-fatal

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:29 -04:00