Commit graph

378103 commits

Author SHA1 Message Date
Alex Deucher 4bd9f516f6 drm/radeon/dpm: add pcie gen helper function
Add a helper function to determine the preferred
pcie gen based on the card, system, and circumstance.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:40 -04:00
Alex Deucher 2abba66e7a drm/radeon: update radeon_atombios_get_default_voltages for mvdd
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-27 19:16:40 -04:00
Alex Deucher 4489cd62e5 drm/radeon/dpm: validate voltages against dispclk requirements
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-27 19:16:39 -04:00
Alex Deucher f907eec036 drm/radeon: fix some memory leaks in extended table parsing
Forgot to free some structs when allocation fails for some
tables.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:38 -04:00
Alex Deucher b253e4b359 drm/radeon/dpm/cayman: use new fixed point functions (v2)
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-27 19:16:38 -04:00
Alex Deucher 210a0b9e21 drm: add some additional fixed point helpers (v3)
Required for certain driver calculations.  Code
was written by Christian König and ported to the
drm by me.

v2: fix 64 bit divides
v3: fix 64 bit for real (math64.h)

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:37 -04:00
Alex Deucher 9ed36f7505 drm/radeon: minor sid.h cleanup
Consolidate the non-register defines.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:36 -04:00
Alex Deucher 7178d2a642 drm/radeon/dpm: save some display parameters for DPM
Required for SI.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:36 -04:00
Alex Deucher a5cb318e3f drm/radeon/dpm: pull in ppm info from atom
Used by SI dpm.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:35 -04:00
Alex Deucher 9985318b7f drm/radeon/dpm: endian fixes for extended power tables
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:34 -04:00
Alex Deucher 929ee7a8b3 drm/radeon/dpm: pull in phase shedding limits from atom
Required for dpm on SI.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:34 -04:00
Alex Deucher 32ce4652dc drm/radeon/dpm: add an enum for pcie gen selection
This makes it easier the understand what the code is
doing.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:33 -04:00
Alex Deucher f8f84ac5d4 drm/radeon: implement clock and power gating for SI
Only Cape Verde supports power gating.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:32 -04:00
Alex Deucher bd8cd5391a drm/radeon: add clearstate init for verde power gating
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:31 -04:00
Alex Deucher 6d8cf0005d drm/radeon: initialize save/restore buffer for pg on verde
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:31 -04:00
Alex Deucher 93656cdd3c drm/radeon: add indirect accessors for UVD CTX registers
These are needed for certain UVD power saving features.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:30 -04:00
Alex Deucher beb79f40b8 drm/radeon: add atom get leakage vddc function
Required for DPM on SI.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:29 -04:00
Alex Deucher d719cef316 drm/radeon: update rlc programming sequence on SI
This is required for certain power management features.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:29 -04:00
Alex Deucher 8ba104637b drm/radeon: enable additional power gating features on trinity
TN has some additional powergating features beyond what is
supported on ON/LN.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:28 -04:00
Alex Deucher e0bcf1654d drm/radeon: add support for ASPM on SI asics (v2)
Enables PCIE ASPM (Active State Power Management) on
SI asics.

v2: fix typo

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:27 -04:00
Alex Deucher f52382d73e drm/radeon: add support for ASPM on evergreen asics
Enables PCIE ASPM (Active State Power Management) on
evergreen-cayman asics.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:27 -04:00
Alex Deucher 792edd6957 drm/radeon: add accessors of pif_phy indirect register space
Required for accessing certain pcie related registers.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:26 -04:00
Alex Deucher b9d305dfb6 drm/radeon: implement pcie gen2/3 support for SI
If both the motherboard and GPU support pcie gen2 or 3,
enable it.  PCIE gen2 and 3 offer more bandwidth than
pcie gen1.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:25 -04:00
Alex Deucher 6517194417 drm/radeon: update radeon_atom_get_voltage_table() for SI
SI uses a new atom table revision.  Required for DPM on SI.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:25 -04:00
Alex Deucher 58653abdd2 drm/radeon: update radeon_atom_is_voltage_gpio() for SI
SI uses a new atom table.  Required for DPM on SI.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:24 -04:00
Alex Deucher eaa778aff0 drm/radeon/atom: add helper to calcuate mpll params
There's a new table for calculating the memory pll
parameters on SI.  Required for SI DPM support.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:23 -04:00
Alex Deucher e37e6a0e4f drm/radeon: implement apci perf request
These functions use acpi methods to adjust the pcie
gen speed.  Used by DPM.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:23 -04:00
Alex Deucher 9d45ad5aff drm/radeon/dpm: remove local sumo_get_xclk()
Use the new asic callback instead.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:22 -04:00
Alex Deucher a5b91af2e2 drm/radeon: add missing UVD clock set in cayman dpm code
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:21 -04:00
Alex Deucher 89c9bc5651 drm/radeon/dpm: remove broken dyn state remnants
Now that the proper fix has been implemented I can
remove the last remnants of the initial implementation.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:21 -04:00
Alex Deucher fee3d744bf drm/radeon/dpm: add pre/post_set_power_state callback (cayman)
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-27 19:16:20 -04:00
Alex Deucher e8a9539fa0 drm/radeon/dpm: add pre/post_set_power_state callback (BTC)
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-27 19:16:19 -04:00
Alex Deucher a284c48ae7 drm/radeon/dpm: add pre/post_set_power_state callback (TN)
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-27 19:16:18 -04:00
Alex Deucher 422a56bc8a drm/radeon/dpm: add pre/post_set_power_state callback (sumo)
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-27 19:16:18 -04:00
Alex Deucher 98243917d7 drm/radeon/dpm: add pre/post_set_power_state callbacks (6xx-eg)
For r6xx-evergreen, they are no-ops as they don't support
any dynamic state adjustment.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:17 -04:00
Alex Deucher 84dd192826 drm/radeon/dpm: add new pre/post_set_power_state callbacks
Needed to properly handle dynamic state adjustment.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:16 -04:00
Alex Deucher 940eea8e4d drm/radeon/dpm/tn: restructure code
Needed to properly handle dynamic state adjustment.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:16 -04:00
Alex Deucher 34936f5514 drm/radeon/dpm/sumo: restructure code
Needed to properly handle dynamic state adjustment.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:15 -04:00
Alex Deucher 51a8de029b drm/radeon/dpm/cayman: restructure code
Needed to properly handle dynamic state adjustment.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:14 -04:00
Alex Deucher 4cb3a02f88 drm/radeon/dpm/btc: restructure code
Needed to properly handle dynamic state adjustment.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:14 -04:00
Alex Deucher dbc3416024 drm/radeon/dpm/evergreen: restructure code
Needed to properly handle dynamic state adjustment.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:13 -04:00
Alex Deucher 5d77d77641 drm/radeon/dpm/rv7xx: restructure code
Needed to properly handle dynamic state adjustment.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:12 -04:00
Alex Deucher c70d45536c drm/radeon/dpm/rv6xx: restructure code
Needed to properly handle dynamic state adjustment.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:12 -04:00
Alex Deucher f5d73a809e drm/radeon/dpm/rs780: restructure code
Needed to properly handle dynamic state adjustment.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:11 -04:00
Alex Deucher 69e0b57a91 drm/radeon/kms: add dpm support for cayman (v5)
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>
2013-06-27 19:16:10 -04:00
Alex Deucher d22b7e406a drm/radeon/dpm: fixup dynamic state adjust for btc (v2)
Use a dedicated copy of the current power state since
we may have to adjust it on the fly.

v2: fix up redundant state sets

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:15:53 -04:00
Alex Deucher a8dbaeff3d drm/radeon/dpm: fixup dynamic state adjust for TN
Use a dedicated copy of the current power state since
we may have to adjust it on the fly.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:15:52 -04:00
Alex Deucher 7cf36de9eb drm/radeon/dpm: fixup dynamic state adjust for sumo
Use a dedicated copy of the current power state since
we may have to adjust it on the fly.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:15:51 -04:00
Alex Deucher 5ca302f701 drm/radeon/dpm: track whether we are on AC or battery
Driver needs this information to validate power states.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:15:51 -04:00
Alex Deucher 61b7d60110 drm/radeon/dpm: add helpers for extended power tables (v2)
This data will be needed for dpm on newer asics.

v2: fix typo in rebase

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:15:50 -04:00