Alex Deucher
6b8812eb00
drm/amdgpu: use drm_mode_vrefresh() rather than mode->vrefresh
...
This is a port of radeon commit:
3d2d98ee1a
drm/radeon: use drm_mode_vrefresh() rather than mode->vrefresh
to amdgpu.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2016-05-04 20:31:02 -04:00
Alex Deucher
a0cdef9e82
drm/amdgpu/uvd6: add bypass support for fiji (v3)
...
Handle uvd clock bypass settings as part of clockgating
setup.
v2: fix gate logic
v3: fix header include
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:30:57 -04:00
Alex Deucher
bdf1ecea3c
drm/amdgpu/fiji: set UVD CG state when enabling UVD DPM (v2)
...
Need to call the IP cg callbacks.
v2: fix gate logic
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:30:44 -04:00
Alex Deucher
ce90dbd9b8
drm/powerplay: add missing clockgating callback for tonga
...
Without this clockgating is not enabled.
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:30:38 -04:00
Nils Wallménius
909a0631b1
drm/amdgpu: Constify some tables
...
Some more tables with constant data were added with the polaris support
v2: missed a few
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:30:34 -04:00
Nils Wallménius
58174c2787
drm/amd/powerplay: Delete dead struct declaration
...
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:30:31 -04:00
Moritz Kühner
ac0cc35008
drm/amd/powerplay/hwmgr: don't add invalid voltage
...
if atomctrl_get_voltage_evv_on_sclk returns non zero (fail) in the expansion
of the PP_ASSERT_WITH_CODE macro the continue will actually do nothing
(The macro uses a do ... while(0) as scope, which eats the continue).
Based on the code I don't think this was the intent.
Unfortunately fixing this requires rewriting the control flow and
removing the macros.
v2: added signed of by
fixed error message print
v3: agd: drop DRM_ERROR
Signed-off-by: Moritz Kühner <kuehner.moritz@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:30:27 -04:00
Moritz Kühner
c790f87318
drm/amd/powerplay/hwmgr: prevent VDDC from exceeding 2V
...
If the tonga gpu is controlled by SVID2 tonga_get_evv_voltage will only print
an error if the voltage exceeds 2V although a comment clearly states that it
needs be less than 2V.
v2: added signed of by
Signed-off-by: Moritz Kühner <kuehner.moritz@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:30:24 -04:00
Tom St Denis
adcec288bc
drm/amd/amdgpu: Add debugfs entries for smc/didt/pcie
...
This adds 3 new files that can be read/written to access
indirect GPU registers.
Signed-off-by: Tom St Denis <tom.stdenis@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:30:11 -04:00
Tom St Denis
16a7989ac6
drm/amd/amdgpu: Drop print_status callbacks.
...
First patch in series to move to user mode
debug tools we're removing the print_status callbacks.
These functions were unused at the moment anyway.
Signed-off-by: Tom St Denis <tom.stdenis@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:30:06 -04:00
Eric Huang
a72d5604ea
drm/amd/powerplay: revise reading/writing pptable on Polaris10
...
Change the way we store pptables in the driver to better
facilitate eventual runtime updates for debugging.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:30:02 -04:00
Eric Huang
92dea67dd6
drm/amd/powerplay: revise reading/writing pptable on Tonga
...
Change the way we store pptables in the driver to better
facilitate eventual runtime updates for debugging.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:59 -04:00
Eric Huang
65ba4f227c
drm/amd/powerplay: revise reading/writing pptable on Fiji
...
Change the way we store pptables in the driver to better
facilitate eventual runtime updates for debugging.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:55 -04:00
Eric Huang
1551019523
drm/amd/powerplay: revise caching the soft pptable and add it's size
...
This fixes a bug in the pptable access interface that could lead to
a crash. Check the pointer before using it.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:52 -04:00
Eric Huang
5632708f44
drm/amd/powerplay: add dpm force multiple levels on cz/tonga/fiji/polaris (v2)
...
Allows you to force multiple levels rather than just one via the new
sysfs interrface.
v2: squash in:
drm/amd/powerplay: ensure clock level set by user is valid.
From Rex.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:47 -04:00
Eric Huang
5122438954
drm/amd/powerplay: fix fan speed percent setting error on Polaris10
...
The logic was reversed.
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:43 -04:00
Eric Huang
681ed01c62
drm/amd/powerplay: fix bug dpm can't work when resume back on Polaris
...
Need to initialize the values to 0 since they get or'ed with additional
values. If the initialization is missing, on resume, they may end up
with a combination of stale data and new data.
Fixes dpm on resume.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:39 -04:00
Rex Zhu
7d367c2aea
drm/amd/powerplay: fix some initialize error on polaris10.
...
1. don't enable SclkThrottleLowNotification, it's not supported.
2. Set missing mclk_dpm0_activity_target
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:34 -04:00
Rex Zhu
7383bcb94a
drm/amd/powerplay: return 0 when interface not implement on some asic.
...
Don't fail if certain optional interface callbacks are missing.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:27 -04:00
Mykola Lysenko
0b45541df3
drm/amdgpu: fix memory leak in CGS (FW info)
...
Previously requested FW pointer should not be
overwritten on a subsequent call.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Mykola Lysenko <Mykola.Lysenko@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:20 -04:00
Rex Zhu
b0d113453a
drm/amd/powerplay: update vce power gate state for baffin.
...
Forgot to save the current gate state so we don't know
what the current state is if we try and gate/ungate the
block.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:15 -04:00
Eric Huang
c8c67448b7
drm/amd/powerplay: Fix a bug for enabling ACDC gpio interrupt
...
Only enable it if it's supported rather than unconitionally.
Signed-off-by: Eric Yang <eric.yang2@amd.com >
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:11 -04:00
Rex Zhu
dcf799e54b
drm/amd/powerplay: fix issue that get wrong reference clock value.
...
use wrong parameter to compute the reference clock.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:07 -04:00
Rex Zhu
e16ff21d2a
drm/amd/powerplay: parameter updates according to SMC.
...
Update to latest changes for SMC team.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:29:03 -04:00
Rex Zhu
9e26bbb36a
drm/amd/powerplay: add fan control mode interface for baffin
...
Add interface for manual fan control.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:28:59 -04:00
Rex Zhu
f0911de82c
drm/amd/powerplay: enable some feature for baffin/ellesmere. (v2)
...
Sync up with internal updates.
v2: squash in:
drm/amd/powerplay: set revert flag for enable thermal protect.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:28:53 -04:00
Rex Zhu
925a51c442
drm/amdgpu: code style refine.
...
Whitespace fix.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:28:50 -04:00
Alex Deucher
5f88567c62
drm/amd/powerplay: fix copy paste error in error message
...
Noticed-by: Vasily Anonimov <vasily.anonimov@googlemail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:28:44 -04:00
Slava Grigorev
ae17c999f0
drm/amd/amdgpu: fix 64-bit division
...
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:28:37 -04:00
Flora Cui
f89510686c
drm/amdgpu: add polaris10/11 smc fw declaration
...
Signed-off-by: Flora Cui <Flora.Cui@amd.com >
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:28:33 -04:00
Rex Zhu
5de95e55de
drm/amd/powerplay: Disable Spread Spectrum on DPM 0 on baffin as SPLL Shut Down feature is enabled.
...
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Acked-by: Flora Cui <Flora.Cui@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:28:24 -04:00
Rex Zhu
2043f43e4b
drm/amd/powerplay: enable set lowest mclk clock on baffin.
...
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:28:19 -04:00
Rex Zhu
971f8daafa
drm/amd/powrplay: fix issue that get wrong enable flag.
...
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:28:13 -04:00
Rex Zhu
b4c6f99ee7
drm/amd/powerplay: fix mclk in high clock for baffin
...
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:28:08 -04:00
Rex Zhu
b2d9614318
drm/amd/powerplay: print gpu loading and uvd/vce power gate enablement for polaris10/11.
...
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:28:02 -04:00
Flora Cui
2cc0c0b5cd
drm/amdgpu: change ELM/BAF to Polaris10/Polaris11
...
Adjust to preferred code names.
Signed-off-by: Flora Cui <Flora.Cui@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:27:57 -04:00
Flora Cui
a3ad7a9ad8
drm/amdgpu: add ELM/BAF pci ids
...
Signed-off-by: Flora Cui <Flora.Cui@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:27:51 -04:00
Flora Cui
c0c1f579e6
drm/amdgpu: update the core VI support for ELM/BAF
...
Signed-off-by: Flora Cui <Flora.Cui@amd.com >
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:27:45 -04:00
Flora Cui
c5a93a282f
drm/amdgpu: ungate SMC clockgating first before suspend
...
46c34bcb6a15dd85329a39a5e72c62108626acdc put all block’s clockgating
support in SMC. The sequence in suspend routine should be adjusted
accordingly, otherwise it causes asic hang.
Signed-off-by: Flora Cui <Flora.Cui@amd.com >
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:27:39 -04:00
Eric Huang
f4bfffddd7
drm/amd/amdgpu: add power gating init for Baffin
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:27:34 -04:00
Eric Huang
2b6cd97797
drm/amd/amdgpu: add power gating initialization support for GFX8.0
...
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:27:28 -04:00
Flora Cui
538333f0dc
drm/amd/powerplay: add default clockgating handling
...
This is to workaround regression introduced in
46c34bcb6a15dd85329a39a5e72c62108626acdc. It should be reverted with a
final fix.
Signed-off-by: Flora Cui <Flora.Cui@amd.com >
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:27:22 -04:00
Eric Huang
62a86fc234
drm/amd/amdgpu: add medium grain powergating support for Baffin
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:27:16 -04:00
Eric Huang
7df48927b2
drm/amd/powerplay: add GFX per cu powergating for Baffin
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:27:09 -04:00
Eric Huang
65f85e7d82
drm/amd/powerplay: add GFX per cu powergating support through SMU/powerplay
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:27:02 -04:00
Eric Huang
bacec8985f
drm/amd/amdgpu: add query GFX cu info in CGS query system info
...
Needed for per CU powergating.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:26:55 -04:00
Eric Huang
8fe3d33307
drm/amd/powerplay: add GFX/SYS clockgating support for ELM/BAF
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:26:48 -04:00
Eric Huang
03e3905f21
drm/amd/powerplay: add all blocks clockgating support through SMU/powerplay
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:26:42 -04:00
yanyang1
e85c7d664d
drm/amd/powerplay: update baffin & ellesmere smc_sk firmware.
...
sync the code form catalyst CL:#1230866.
Signed-off-by: yanyang1 <Young.Yang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:26:33 -04:00
yanyang1
a6ece7ffd9
drm/amd/powerplay: Add smc_sk firmware to baffin & ellesmere.
...
update relational h files.
Signed-off-by: yanyang1 <Young.Yang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:26:26 -04:00