Commit graph

121 commits

Author SHA1 Message Date
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 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 d70229f704 drm/radeon/kms: add dpm support for trinity asics
This adds dpm support for trinity asics.  This includes:
- clockgating
- powergating
- dynamic engine clock scaling
- dynamic voltage scaling

set radeon.dpm=1 to enable it.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:15:45 -04:00
Alex Deucher 80ea2c129c drm/radeon/kms: add dpm support for sumo asics (v2)
This adds dpm support for sumo asics.  This includes:
- clockgating
- powergating
- dynamic engine clock scaling
- dynamic voltage scaling

set radeon.dpm=1 to enable it.

v2: fix indention

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2013-06-27 19:15:44 -04:00
Alex Deucher 6596afd48a drm/radeon/kms: add dpm support for btc (v3)
This adds dpm support for btc asics.  This includes:
- clockgating
- dynamic engine clock scaling
- dynamic memory clock scaling
- dynamic voltage scaling
- dynamic pcie gen1/gen2 switching (requires additional acpi support)

Set radeon.dpm=1 to enable.

v2: reduce stack usage
v3: attempt to fix state enable

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:15:44 -04:00
Alex Deucher dc50ba7f9a drm/radeon/kms: add dpm support for evergreen (v4)
This adds dpm support for evergreen asics.  This includes:
- clockgating
- dynamic engine clock scaling
- dynamic memory clock scaling
- dynamic voltage scaling
- dynamic pcie gen1/gen2 switching (requires additional acpi support)

Set radeon.dpm=1 to enable.

v2: reduce stack usage, rename ulv struct
v3: fix thermal interrupt check notices by Jerome
v4: fix state enable

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:15:22 -04:00
Alex Deucher 66229b2005 drm/radeon/kms: add dpm support for rv7xx (v4)
This adds dpm support for rv7xx asics.  This includes:
- clockgating
- dynamic engine clock scaling
- dynamic memory clock scaling
- dynamic voltage scaling
- dynamic pcie gen1/gen2 switching

Set radeon.dpm=1 to enable.

v2: reduce stack usage
v3: fix 64 bit div
v4: fix state enable

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:14:59 -04:00
Alex Deucher 4a6369e993 drm/radeon/kms: add dpm support for rv6xx (v3)
This adds dpm support for rv6xx asics.  This includes:
- clockgating
- dynamic engine clock scaling
- dynamic memory clock scaling
- dynamic voltage scaling
- dynamic pcie gen1/gen2 switching

Set radeon.dpm=1 to enable.

v2: remove duplicate line
v3: fix thermal interrupt check noticed by Jerome

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-06-27 10:50:08 -04:00
Alex Deucher 9d67006e6e drm/radeon/kms: add dpm support for rs780/rs880
This adds dpm support for rs780/rs880 asics.  This includes:
- clockgating
- dynamic engine clock scaling
- dynamic voltage scaling

set radeon.dpm=1 to enable it.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 10:49:25 -04:00
Alex Deucher ca361b6538 drm/radeon/kms: add new asic struct for rv6xx (v4)
Has a different dpm controller than r600.

v2: rebase on gpu reset changes
v3: rebase on get_xclk changes
v4: update rptr/wtpr callbacks

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 10:49:20 -04:00
Alex Deucher 29a1522189 drm/radeon: add support for thermal sensor on tn
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 10:49:17 -04:00
Alex Deucher 6bd1c38532 drm/radeon: make get_temperature functions a callback
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 10:49:16 -04:00
Alex Deucher 0672e27bea drm/radeon: add radeon_asic struct for CIK (v12)
v2: fix up for latest reset changes
v3: use CP for pt updates for now
v4: update for 2 level PTs
v5: update for ib_parse removal
v6: vm_flush api change
v7: rebase
v8: fix gfx ring function pointers
v9: fix vm_set_page function params
v10: update for compute changes
v11: cleanup for release
v12: update rptr/wptr callbacks

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 10:49:12 -04:00
Alex Deucher f93bdefe62 drm/radeon: use callbacks for ring pointer handling (v3)
Add callbacks to the radeon_asic struct to handle
rptr/wptr fetchs and wptr updates.
We currently use one version for all rings, but this
allows us to override with a ring specific versions.

Needed for compute rings on CIK.

v2: udpate as per Christian's comments
v3: fix some rebase cruft

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 10:49:07 -04:00
Alex Deucher 6e2c3c0ae7 drm/radeon/cik: add pcie_port indirect register accessors
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-26 16:11:48 -04:00
Samuel Li 65337e60a7 drm/radeon: Use direct mapping for fast fb access on RS780/RS880 (v2)
v2: fix trailing whitespace

Signed-off-by: Samuel Li <samuel.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-03 10:36:21 -04:00
Alex Deucher 948bee3ff4 drm/radeon: track which asics have UVD
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-05-20 12:09:37 -04:00
Alex Deucher 86a45cac3f drm/radeon: radeon-asic updates for Hainan
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-05-20 12:09:36 -04:00
Alex Deucher a973bea11c drm/radeon: switch audio handling to use callbacks
Register audio callbacks for asic where we support
audio.  Cleans up the code and makes it easier to
add support for newer asics.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-04-23 18:03:53 -04:00
Alex Deucher 55b615aec6 drm/radeon: add pcie set/get lanes callbacks for newer asics
Uses the same functions as older asics.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-04-09 10:31:41 -04:00
Christian König ef0e6e657c drm/radeon: add set_uvd_clocks callback for r7xx v3
v2: avoid 64bit divide
v3: rv740 uses the evegreen upll configuration

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2013-04-09 10:31:37 -04:00
Christian König 2539eb02de drm/radeon: add set_uvd_clocks callback for SI
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-04-09 10:31:37 -04:00
Alex Deucher a8b4925c79 drm/radeon: add set_uvd_clocks callback for evergreen
v2: remove unneeded register definitions

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-04-09 10:31:36 -04:00
Alex Deucher 23d33ba32b drm/radeon: add set_uvd_clocks callback for ON/LN/TN (v4)
v2: write clk registers only once!
v3: update cg scratch register properly
v4: add TN support

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-04-09 10:31:35 -04:00
Christian König f2ba57b5ea drm/radeon: UVD bringup v8
Just everything needed to decode videos using UVD.

v6: just all the bugfixes and support for R7xx-SI merged in one patch
v7: UVD_CGC_GATE is a write only register, lockup detection fix
v8: split out VRAM fallback changes, remove support for RV770,
    add support for HEMLOCK, add buffer sizes checks

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-04-09 10:31:33 -04:00
Alex Deucher d041889414 drm/radeon: switch get_gpu_clock() to a callback (v2)
Cleans up the code for future asics

v2: rebase, fix some missing radeon_asic updates

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-02-20 08:51:21 -05:00
Alex Deucher 454d2e2a32 drm/radeon: add a asic callback to get the xclk
This is required to get the reference clock used
by the gfx engine for things like timestamps. Fixes
support for GL extensions the use timestamps on
certain boards.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-02-20 08:51:20 -05:00
Alex Deucher e737a14cd1 drm/radeon: radeon-asic updates for Oland
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-02-01 19:34:51 -05:00
Alex Deucher df16004447 drm/radeon: switch back to using the DMA ring for VM PT updates
Now that we have switched to using IBs for page table updates,
we can switch back the using the DMA ring.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-02-01 13:57:10 -05:00
Alex Deucher 123bc1832c drm/radeon: use the reset mask to determine if rings are hung
fetch the reset mask and check if the relevant ring flags
are set to determine whether the ring is hung or not.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-31 16:24:57 -05:00
Alex Deucher 3646e4209f drm/radeon: switch back to the CP ring for VM PT updates
For large VM page table updates, we can sometimes generate
more packets than there is space on the ring.  This happens
more readily with the DMA ring since it is 64K (vs 1M for the
CP).  For now, switch back to the CP.  For the next kernel,
I have a patch to utilize IBs for VM PT updates which
alleviates this problem.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=58354

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-31 16:19:19 -05:00
Alex Deucher 43fb778754 drm/radeon: split r6xx and r7xx copy_dma functions
- r6xx actually uses a slightly different packet format,
although both formats seem to work ok.
- r7xx doesn't have the count multiple of 2 limitation.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-04 09:29:54 -05:00
Alex Deucher cd459e525f drm/radeon: add VM CS parser support for async DMA on cayman/TN/SI
Allows us to use async DMA from userspace.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14 10:45:26 -05:00
Alex Deucher d2ead3eaf8 drm/radeon/kms: add evergreen/cayman CS parser for async DMA (v2)
Allows us to use the DMA ring from userspace.
DMA doesn't have a good NOP packet in which to embed the
reloc idx, so userspace has to add a reloc for each
buffer used and order them to match the command stream.

v2: fix address bounds checking

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14 10:45:25 -05:00
Alex Deucher cf4ccd016b drm/radeon/kms: add 6xx/7xx CS parser for async DMA (v2)
Allows us to use the DMA ring from userspace.
DMA doesn't have a good NOP packet in which to embed the
reloc idx, so userspace has to add a reloc for each
buffer used and order them to match the command stream.

v2: fix address bounds checking, reloc indexing

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14 10:45:25 -05:00
Alex Deucher bf66a786c9 drm/radeon: use DMA engine for VM page table updates on SI
DMA engine has special packets to facilitate this and it also keeps
the 3D engine free for other things.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-10 17:21:43 -05:00
Alex Deucher 33e5467871 drm/radeon: use DMA engine for VM page table updates on cayman/TN
DMA engine has special packets to facilitate this and it also keeps
the 3D engine free for other things.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-10 17:21:42 -05:00
Alex Deucher 2d6cc7296d drm/radeon: use async dma for ttm buffer moves on 6xx-SI
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-10 16:53:53 -05:00
Alex Deucher 8c5fd7efcc drm/radeon/kms: Add initial support for async DMA on SI
Pretty much the same as cayman.  Some changes to the copy
packets.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-10 16:53:41 -05:00
Alex Deucher f60cbd117a drm/radeon/kms: Add initial support for async DMA on cayman/TN
There are 2 async DMA engines on cayman, one at 0xd000 and
one at 0xd800.  The programming interface is the same as
evergreen however there are some changes to the commands
for using vmids.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-10 16:53:34 -05:00
Alex Deucher 233d1ad59a drm/radeon/kms: Add initial support for async DMA on evergreen
Pretty similar to 6xx/7xx except the count field increased in the
packet header and the max IB size increased.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-10 16:53:29 -05:00
Alex Deucher 4d75658bff drm/radeon/kms: Add initial support for async DMA on r6xx/r7xx
Uses the new multi-ring infrastucture.  6xx/7xx has a single
async DMA ring.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-10 16:53:23 -05:00
Alex Deucher 82ffd92b16 drm/radeon: add vm set_page() callback for SI
Use the new WRITE_DATA packet rather than the legacy
ME_WRITE packet.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-02 15:02:23 -04:00
Alex Deucher 27810fb2d2 drm/radeon/pm: fix multi-head profile handling on BTC+ (v2)
Starting on BTC, there are no longer separate states for
single head and multi-head, we just use the high mclk/voltage
for all states for multi-head.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=49981

v2: fix typo

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-02 10:27:51 -04:00
Alex Deucher 6d92f81dcf drm/radeon: add get_backlight_level callback
Read back the backlight level from the hw.
Needed for proper backlight restoration on resume.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-27 10:22:41 -04:00
Christian König 2a6f1abbb4 drm/radeon: make page table updates async v2
Currently doing the update with the CP.

v2: Rebased on Jeromes bugfix. Make validity comparison
    more human readable.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-09-20 13:10:40 -04:00