Rex Zhu
270d013659
drm/amd/powerplay: enable clock stretch feature for polaris
...
Power saving feature which reduces the amount of
voltage needed for specific engine clocks.
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-06-21 10:22:42 -04:00
Rex Zhu
432c3a3ca7
drm/amd/powerplay: enable avfs feature for polaris
...
avfs feature is for voltage control based on
gpu system clock on polaris10
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-06-21 10:22:41 -04:00
Rex Zhu
31b2124377
drm/amd/powerplay: add avfs related define for polaris
...
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-06-21 10:22:40 -04:00
Rex Zhu
9a3c1b342b
drm/amd/powrplay: enable stutter_mode for polaris.
...
To minimize the dram power expenditure during static -screen
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-06-21 10:22:40 -04:00
Rex Zhu
40787ef21c
drm/amd/powerplay: disable UVD SMU handshake for MCLK.
...
sync up with internal programming recommendations.
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-06-21 10:22:39 -04:00
Rex Zhu
a2fb4934e9
drm/amd/powerplay: initialize variables which were missed.
...
Missing pcie dpm settings.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-06-21 10:22:38 -04:00
Rex Zhu
919e334dec
drm/amd/powerplay: enable PowerContainment feature 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-06-21 10:22:38 -04:00
Rex Zhu
0a4fef559b
drm/amd/powerplay: need to notify system bios pcie device ready
...
before request performance state.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2016-06-21 10:22:37 -04:00
Rex Zhu
576b4401b1
drm/amd/powerplay: fix bug that function parameter was incorect.
...
Wrong value passed to acpi_pcie_perf_request.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2016-06-21 10:22:37 -04:00
Rex Zhu
1d7b84d12a
drm/amd/powerplay: fix logic error.
...
the error lead powerplay can't get display info in DGPU case.
store_cc6_data just implement in APU.
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 >
Cc: stable@vger.kernel.org
2016-06-21 10:22:29 -04:00
Rex Zhu
871fd8403d
drm/amd/powerplay: select samu dpm 0 as boot level on polaris.
...
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-06-15 02:00:54 -04:00
Rex Zhu
3ff211270a
drm/amd/powerplay: update powerplay table parsing
...
to handle pptable format change on Polaris boards
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-06-15 02:00:46 -04:00
Rex Zhu
5f96ddb460
drm/amd/powerplay: delete useless code as pptable changed in vbios.
...
The vbios table changed so this code is useless now.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-06-09 10:49:16 -04:00
Rex Zhu
d2e312183b
drm/amd/powerplay: fix bug visit array out of bounds
...
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Acked-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-06-09 10:49:15 -04:00
Monk Liu
5bbc16cc7b
drm/amdgpu: fix smu ucode memleak (v2)
...
Properly release the smu ucode in powerplay.
v2: agd: add polaris as well
Signed-off-by: Monk Liu <Monk.Liu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-06-09 10:49:14 -04:00
Monk Liu
86e4cdd675
drm/amdgpu: fix tonga smu_fini mem leak
...
Signed-off-by: Monk Liu <Monk.Liu@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-06-09 10:49:13 -04:00
Monk Liu
e6232effab
drm/amdgpu: fix fiji smu fini mem leak
...
Signed-off-by: Monk Liu <Monk.Liu@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-06-09 10:49:12 -04:00
Monk Liu
9d8f086cd0
drm/amdgpu: fix memleak in pptable_init
...
Signed-off-by: Monk Liu <Monk.Liu@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-06-09 10:49:04 -04:00
Monk Liu
61da601b95
drm/amdgpu: fix mem leak in pplib/hwmgr
...
Signed-off-by: Monk Liu <Monk.Liu@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-06-09 10:49:03 -04:00
Monk Liu
3a3e88804d
drm/amdgpu: fix mem leak in smumgr
...
Signed-off-by: Monk Liu <Monk.Liu@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-06-09 10:49:02 -04:00
Monk Liu
a6dcfd9cc5
drm/amdgpu: fix pplib finish bug
...
1,should use late_fini to kfree all resource otherwise
the released pointer maybe accessed in IRQ ip fini routine.
2,hwmgr should not be kfree by pem_fini which is invoked
by hw fini path.
Signed-off-by: Monk Liu <Monk.Liu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-06-09 10:48:56 -04:00
Rex Zhu
8b4af8a8e3
drm/admgpu/powerplay/polaris: fix powertune table upload
...
Exclude AVFS related fields when update powertune table to hw.
The driver shouldn't set them directly.
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-06-09 10:48:53 -04:00
Muhammad Falak R Wani
c688c641c5
drm/amd/powerplay/hwmgr: use kmemdup
...
Use kmemdup when some other buffer is immediately copied into allocated
region. It replaces call to allocation followed by memcpy, by a single
call to kmemdup.
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-19 11:01:02 -04:00
Muhammad Falak R Wani
510e65dfb0
drm/amd/powerplay/hwmgr: use kmemdup
...
Use kmemdup when some other buffer is immediately copied into allocated
region. It replaces call to allocation followed by memcpy, by a single
call to kmemdup.
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-19 11:00:33 -04:00
Muhammad Falak R Wani
761de5f9da
drm/amd/powerplay/hwmgr: use kmemdup
...
Use kmemdup when some other buffer is immediately copied into allocated
region. It replaces call to allocation followed by memcpy, by a single
call to kmemdup.
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-19 11:00:07 -04:00
Eric Huang
3b59c344ab
drm/amd/powerplay: fix bugs of checking if dpm is running on Tonga
...
Fixes OD failures on Tonga.
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-18 09:22:30 -04:00
Muhammad Falak R Wani
a7aabcc8a5
drm/amd/powerplay: use ARRAY_SIZE() to calculate array size.
...
It is preferred to use ARRAY_SIZE() for size calculation, instead
using sizeof(array)/sizeof(*array). It makes the code more readable.
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com >
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-16 12:17:25 -04:00
Eric Huang
e2ed8a132a
drm/amd/powerplay: fix a bug on updating sclk for Tonga
...
Update sclk smc table rather than mclk smc table for sclk updates.
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-13 15:32:36 -04:00
Eric Huang
bd6080d662
drm/amd/powerplay: fix a bug on updating sclk for Fiji
...
Update sclk smc table rather than mclk smc table for sclk updates.
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-13 15:32:29 -04:00
Rex Zhu
8b41e7a03a
drm/amd/powerplay: move asic unrelated function to hwmgr.c.
...
It's generic and used by multiple asics.
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:42 -04:00
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