Rex Zhu
2dcbffad94
drm/amd/powerplay: fix NULL point check error
...
&& was used instead of ||
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-13 14:26:11 -04:00
Rex Zhu
9ab9cf058a
drm/amd/powerplay: SCLK will have a big drop with low VDDC when PPlib was enabled.
...
SMC uses CurrSclkPllRange structure to keep track of what range of
PLL SCLK is sitting on. Driver overwrites this value to 0 because
it's part of DPM table and driver doesn't program this.
This change will set this field to 0xFF every time there's a
init SMC table call.
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-13 14:24:51 -04:00
Huang Rui
b4eeed590d
drm/amd/powerplay: rewrite pp_sw_init to make code readable
...
Actually, pp_sw_init executes pptable_init and backend_init orderly if
they are initialized successfully. So rewrite it to make code more
readable.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Huang Rui <ray.huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-11 13:30:33 -04:00
Tom St Denis
88a907d67c
drm/amd/amdgpu: Add name field to amd_ip_funcs (v2)
...
Add name that we can print out in kernel messages
to aid in debugging.
v2: drop DAL changes for upstream
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-11 12:31:26 -04:00
Nils Wallménius
438498a862
drm/amdgpu: Drop unused parameter for *get_sleep_divider_id_from_clock
...
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-11 12:31:24 -04:00
Nils Wallménius
354ef928a0
drm/amdgpu: Simplify calculation in *get_sleep_divider_id_from_clock
...
a / (1 << b) is equivalent to a >> b for unsigned values
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-11 12:31:23 -04:00
Nils Wallménius
9887e425f9
drm/amdgpu: Use max macro in *get_sleep_divider_id_from_clock
...
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-11 12:31:23 -04:00
Nils Wallménius
859b8b6a27
drm/amd/powerplay: Use defined constants for minium engine clock
...
Replacing magic numbers in calculation of sleep divider id for fiji
and polaris.
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-11 12:31:22 -04:00
Alex Deucher
f9fbac64eb
drm/amdgpu: add missing licenses on a couple of files
...
Noticed by n1s on IRC.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-11 12:31:22 -04:00
Christian König
edf600dac6
drm/amd: cleanup remaining spaces and tabs v2
...
This is the result of running the following commands:
find drivers/gpu/drm/amd/ -name "*.h" -exec sed -i 's/[ \t]\+$//' {} \;
find drivers/gpu/drm/amd/ -name "*.c" -exec sed -i 's/[ \t]\+$//' {} \;
find drivers/gpu/drm/amd/ -name "*.h" -exec sed -i 's/ \+\t/\t/' {} \;
find drivers/gpu/drm/amd/ -name "*.c" -exec sed -i 's/ \+\t/\t/' {} \;
v2: drop changes to DAL and internal headers
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-11 12:31:20 -04:00
Dave Airlie
ba391646d0
drm/amdgpu: fix build on aarch64.
...
Same fix went in previously for some other files.
Signed-off-by: Dave Airlie <airlied@redhat.com >
2016-05-09 10:30:42 +10: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
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
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
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
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
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
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
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
Eric Huang
92c6d645ee
drm/amd/powerplay: add UVD&VCE DPM and powergating support for elm/baf
...
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:26:13 -04:00
Eric Huang
eede52627b
drm/amd/powerplay: add thermal control for elm/baf
...
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:26:07 -04:00