Commit graph

192 commits

Author SHA1 Message Date
Alex Deucher 5ad6bf91ef drm/radeon: fill in set_vce_clocks for CIK asics
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-18 16:11:35 +01:00
Christian König d93f79376f drm/radeon: initial VCE support v4
Only VCE 2.0 support so far.

v2: squashing multiple patches into this one
v3: add IRQ support for CIK, major cleanups,
    basic code documentation
v4: remove HAINAN from chipset list

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-18 16:11:22 +01:00
Alex Deucher 9f3f63f24c drm/radeon/dpm: use the driver state for dpm debugfs
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>
2014-02-06 12:22:46 -05:00
Dave Airlie cfd72a4c20 Merge branch 'drm-intel-next' of git://people.freedesktop.org/~danvet/drm-intel into drm-next
drm-intel-next-2014-01-10:
- final bits for runtime D3 on Haswell from Paul (now enabled fully)
- parse the backlight modulation freq information in the VBT from Jani
  (but not yet used)
- more watermark improvements from Ville for ilk-ivb and bdw
- bugfixes for fastboot from Jesse
- watermark fix for i830M (but not yet everything)
- vlv vga hotplug w/a (Imre)
- piles of other small improvements, cleanups and fixes all over

Note that the pull request includes a backmerge of the last drm-fixes
pulled into Linus' tree - things where getting a bit too messy. So the
shortlog also contains a bunch of patches from Linus tree. Please yell if
you want me to frob it for you a bit.

* 'drm-intel-next' of git://people.freedesktop.org/~danvet/drm-intel: (609 commits)
  drm/i915/bdw: make sure south port interrupts are enabled properly v2
  drm/i915: Include more information in disabled hotplug interrupt warning
  drm/i915: Only complain about a rogue hotplug IRQ after disabling
  drm/i915: Only WARN about a stuck hotplug irq ONCE
  drm/i915: s/hotplugt_status_gen4/hotplug_status_g4x/
2014-01-20 10:21:54 +10:00
Alex Deucher ea31bf697d drm/radeon: remove generic rptr/wptr functions (v2)
Fill in asic family specific versions rather than
using the generic version.  This lets us handle asic
specific differences more easily.  In this case, we
disable sw swapping of the rtpr writeback value on
r6xx+ since the hw does it for us.  Fixes bogus
rptr readback on BE systems.

v2: remove missed cpu_to_le32(), add comments

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 18:01:10 -05:00
Alex Deucher 0042fca504 drm/radeon: enable gfx cgcg on CIK APUs
Enable coarse grained clockgating.  This works properly now
that smc is initialized earlier than the rlc and cp.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 17:57:34 -05:00
Alex Deucher 92598db0b4 drm/radeon: enable gfx cgcg on CIK dGPUs
Enable coarse grained clockgating on CIK dGPUs.  This
works properly now that smc is initialized earlier than
the rlc and cp.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 17:57:20 -05:00
Alex Deucher d8852c3446 drm/radeon/dpm: add late_enable for KB/KV
Make sure interrupts are enabled
before we enable thermal interrupts.
Also, don't powergate uvd, etc. until after
the ring tests.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 17:56:34 -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 963c115dae drm/radeon/dpm: add late_enable for SI
Make sure interrupts are enabled
before we enable thermal interrupts.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 17:56:06 -05:00
Alex Deucher bda44c1ae7 drm/radeon/dpm: add late_enable for trinity
Need to wait to enable cg and pg until after
ring tests. Also make sure interrupts are enabled
before we enable thermal interrupts.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 17:55:53 -05:00
Alex Deucher 14ec9faba3 drm/radeon/dpm: add late_enable for sumo
Need to wait to enable cg and pg until after
ring tests. Also make sure interrupts are enabled
before we enable thermal interrupts.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 17:55:39 -05:00
Alex Deucher a3f1124515 drm/radeon/dpm: add late_enable for rv7xx-NI
Make sure interrupts are enabled
before we enable thermal interrupts.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 17:55:26 -05:00
Alex Deucher a4643ba340 drm/radeon/dpm: add late_enable for rs780/rs880/rv6xx
Make sure interrupts are enabled before we enable
thermal interrupts.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 17:55:12 -05:00
Alex Deucher 7819678fae drm/radeon/cik: plug in missing blit callback
I implemented support for this, but forget to hook
up the callback so the driver can actually use it.
On asics with a dedicated DMA engine, we use the DMA
engine for buffer migration so this is just for testing
purposes.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-12 12:22:04 -05:00
Samuel Li 7272c9d228 drm/radeon: hook up backlight functions for CI and KV family.
Fixes crashes when handling atif events due to the lack of a
callback being registered.

Signed-off-by: Samuel Li <samuel.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2013-11-19 15:57:29 -05:00
Alex Deucher 41971b37d1 drm/radeon: fill in radeon_asic_init for hawaii
Fill in gpu details for hawaii.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-08 12:33:47 -05:00
Christian König 24c164393d drm/radeon: drop CP page table updates & cleanup v2
The DMA ring seems to be stable now.

v2: remove pt_ring_index as well

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-01 15:25:52 -04:00
Alex Deucher 5c72273913 drm/radeon: plug in blit copy routine for SI
Uses CP DMA packet just like previous asics.
Useful for debugging and benchmarking.  Uses
same packet format as prior asics.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-01 12:43:15 -04:00
Alex Deucher 99d79aa2f3 drm/radeon: add missing hdmi callbacks for rv6xx
When dpm was merged, I added a new asic struct for
rv6xx, but it never got properly updated when the
hdmi callbacks were added due to the two patch sets
being developed in parallel.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
2013-09-24 11:00:59 -04:00
Alex Deucher b7a5ae9750 drm/radeon/dpm: add bapm callback for kb/kv
This adds the enable_bapm callback for kb/kv.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11 11:44:40 -04:00
Alex Deucher 11877060e6 drm/radeon/dpm: add bapm callback for trinity
This adds the enable_bapm callback for trinity.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11 11:44:39 -04:00
Alex Deucher 1b9ba70a49 drm/radeon/r6xx: add a stubbed out set_uvd_clocks callback
Certain r6xx boards use the same power state for both UVD
and other things.  Since we don't support UVD on r6xx boards
at the moment, there was no callback installed for setting
the UVD clocks, however, on systems that use the same power
state, this leads to a NULL pointer dereference.  Fill
in a stubbed out implementation for now to avoid the crash.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: "3.11" <stable@vger.kernel.org>
2013-09-11 11:44:32 -04:00
Alex Deucher 2b19d17fbd drm/radeon: fix typo in PG flags
s/CG/PG/ in the GFX powergating flag name.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11 11:44:31 -04:00
Anthoine Bourgeois 63580c3e48 drm/radeon/dpm: implement force performance levels for rs780 (v2)
Allows you to limit the selected power levels via sysfs.

Force the feedback divider to select a power level.

v2: fix checking in rs780_force_fbdiv,
    drop a duplicate divider structure in rs780_dpm_force_performance_level,
    Force the voltage level too.

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11 11:44:24 -04:00
Alex Deucher 773dc10a8a drm/radeon: enable mgcg on CIK
Now that the CP is no longer reset and cg is properly
disabled in when appropriate in the dpm code we can
now enable mgcg (medium grained clockgating).

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:58 -04:00
Alex Deucher ddc76ff6c7 drm/radeon: fixes for gfx clockgating on CIK
Clockgating requires signalling between the CP and the
RLC to work properly.  Resetting the CP block in the
CP resume code messed up the internal coordination
between the blocks.  Removing the reset allows gfx
clockgating to work properly.  However, when gfx clock
gating is enabled, there is a strange interaction with
dpm which causes the chip to stay in the high performance
level all the time, so leave gfx clockgating disabled
for now.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:55 -04:00
Alex Deucher 473359bc28 drm/radeon: restructure cg/pg on cik (v2)
- use new cg/pg flags for finer grained clock and
powergating control
- restructure the cg/pg code so it can be called from
other components such as dpm

v2: fix build breakage from rebase

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:54 -04:00
Alex Deucher ca6ebb39df drm/radeon/si: enable DMA pg by default
Enable DMA powergating by default.  The DMA engines
will be powergated when not in use.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:53 -04:00
Alex Deucher 090f4b6ad3 drm/radeon: enable mgcg on SI
Now that the CP is no longer reset and cg is properly
disabled in when appropriate in the dpm code we can
now enable mgcg (medium grained clockgating).

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:52 -04:00
Alex Deucher 5594a558fa drm/radeon: fixes for gfx clockgating on SI
Clockgating requires signalling between the CP and the
RLC to work properly.  Resetting the CP block in the
CP resume code messed up the internal coordination
between the blocks.  Removing the reset allows gfx
clockgating to work properly.  However, when gfx clock
gating is enabled, there is a strange interaction with
dpm which causes the chip to stay in the high performance
level all the time, so leave gfx clockgating disabled
for now.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:50 -04:00
Alex Deucher e16866ecfb drm/radeon/si: restructure cg code (v3)
Resturcture clockgating code so that it can be
enabled/disabled from other components such as
dpm.

v2: make function static
v3: add fine grained cg controls

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:49 -04:00
Alex Deucher 0116e1efaf drm/radeon: use new cg/pg flags for SI
Allows us finer grained control over clock and
powergating on SI.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:49 -04:00
Alex Deucher b530602fd4 drm/radeon: add audio support for DCE6/8 GPUs (v12)
Similar to DCE4/5, but supports multiple audio pins
which can be assigned per afmt block.

v2: rework the driver to handle more than one audio
pin.
v3: try different dto reg
v4: properly program dto
v5 (ck): change dto programming order
v6: program speaker allocation block
v7: rebase
v8: rebase on Rafał's changes
v9: integrated Rafał's comments, update to latest
    drm_edid_to_speaker_allocation API
v10: add missing line break in error message
v11: add back audio enabled messages
v12: fix copy paste typo in r600_audio_enable

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Rafał Miłecki <zajec5@gmail.com>
2013-08-30 16:30:45 -04:00
Christian König e409b12862 drm/radeon: separate UVD code v3
Our different hardware blocks are actually completely
separated, so it doesn't make much sense any more to
structure the code by pure chipset generations.

Start restructuring the code by separating our the UVD block.

v2: updated commit message
v3: rebased and restructurized start/stop functions for kv dpm.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:42 -04:00
Christian König 2e1e6dad6a drm/radeon: remove special handling for the DMA ring
Now that we have callbacks for [rw]ptr handling we can
remove the special handling for the DMA rings and use
the callbacks instead.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:41 -04:00
Christian König 02c9f7fa4e drm/radeon: rework UVD writeback & [rw]ptr handling
The hardware just doesn't support this correctly.
Disable it before we accidentally write anywhere we shouldn't.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:40 -04:00
Christian König 76a0df859d drm/radeon: rework ring function handling
Give the ring functions a separate structure and let the asic
structure point to the ring specific functions. This simplifies
the code and allows us to make changes at only one point.

No change in functionality.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:39 -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 77df508a98 drm/radeon/dpm: implement UVD powergating for KB/KV
Powergate the UVD block when not in use to save power.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:35 -04:00
Alex Deucher 2b4c8022fa drm/radeon/dpm: implement force performance level for KB/KV
Allows you to force the selected performance level via sysfs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:33 -04:00
Alex Deucher ae3e40e871 drm/radeon/dpm: add debugfs support for KB/KV
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:32 -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
Alex Deucher 41a524abff drm/radeon/kms: add dpm support for KB/KV
This adds dpm support for KB/KV asics.  This includes:
- dynamic engine clock scaling
- dynamic voltage scaling
- power containment
- shader power scaling

Set radeon.dpm=1 to enable.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:28 -04:00
Alex Deucher 286d9cc67a drm/radeon: add get_temperature() callbacks for CIK (v2)
This added support for the on-chip thermal sensors on
CIK asics.

v2: fix register offset.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:15 -04:00
Alex Deucher 22c775ce80 drm/radeon: implement clock and power gating for CIK (v3)
Only the APUs support power gating.

v2: disable cgcg for now
v3: workaround hw issue in mgcg

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30 16:30:08 -04:00
Alex Deucher 8dddb993bc drm/radeon: switch r6xx+ to using CP DMA for the blit copy callback
CP DMA is lighter weight than using the 3D engine.

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