Edward O'Callaghan
538f1ef34c
drivers/amdgpu: Remove redundant itermediate return val
...
Found-by: Coccinelle
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net >
Reviewed-by: Tom St Denis <tom.stdenis@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-29 14:36:51 -04:00
Edward O'Callaghan
4ba27f9ba9
drivers/amdgpu: Use canonical boolean form in various predicates
...
V.2: Fixup by hand to remove a few instances of redundant '()'
left over.
Found-by: Coccinelle
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net >
Reviewed-by: Tom St Denis <tom.stdenis@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-29 14:36:50 -04:00
Edward O'Callaghan
ed5121a3d8
drivers/amdgpu: Use 'true/false' for bool typed variables
...
Found-by: Coccinelle
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net >
Reviewed-by: Tom St Denis <tom.stdenis@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-29 14:36:48 -04:00
Huang Rui
d1371f8c5d
drm/amdgpu: change pcie_gen_cap magic code to macro
...
This patch changes pcie_gen_cap magic code to macro to make it more
readable.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Huang Rui <ray.huang@amd.com >
Cc: Eric Huang <JinHuiEric.Huang@amd.com >
Cc: Ken Wang <Qingqing.Wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 15:01:59 -04:00
Eric Huang
0a81a87c98
drm/amd/powerplay: remove useless soft pptable in Asic related backend
...
The soft pptable was used for re-uploading pptable as cache, but since
previous commits, the generic codes for uploading pptable are used and
backend is released during resetting powerplay. So it becomes redundance.
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-07-07 14:54:09 -04:00
Eric Huang
e8c1fe9f50
drm/amd/powerplay: remove useless pp_table codes for Tonga/Fiji/Polaris10
...
Due to uploading pptable implementation changed, the generic codes in
previous commit have been used intead of the Asic specific codes.
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-07-07 14:51:38 -04:00
Eric Huang
76ad42c192
drm/amd/powerplay: change backend allocation to backend init
...
backend_init and backend_fini are paired functions, backend is freed
in backend_fini and should be allocated in backend_init.
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-07-07 14:51:37 -04:00
Eric Huang
55d74fc921
drm/amd/powerplay: add function disable_dpm_tasks for Fiji
...
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-07-07 14:51:35 -04:00
Eric Huang
391be5307a
drm/amd/powerplay: add mclk OD(overdrive) support for Fiji
...
The maximum OD percentage is 20.
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-07-07 14:50:57 -04:00
Eric Huang
decb5fb6f2
drm/amd/powerplay: add sclk OD support on Fiji
...
This implements sclk overdrive(OD) overclocking support for Fiji,
and the maximum overdrive percentage is 20.
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-07-07 14:50:41 -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
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
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
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
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
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
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
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
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
Nils Wallménius
f498d9ed26
drm/amd: Mark some tables as const
...
This patch marks some compile-time constant tables 'const'.
The tables marked in this patch are the low hanging fruit
where little other changes were necesary to avoid casting
away constness etc. Also mark some tables that are private
to a file as static.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-05-04 20:20:00 -04:00
Rex Zhu
0eadeab4af
drm/amd/powerplay: use min_clock_in_sr for deep sleep feature.
...
This comes from the display handling code.
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-02 15:25:42 -04:00
Rex Zhu
0168f78fe1
drm/amd/powerplay: fix issue that resume back, dpm can't work on FIJI.
...
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-04-04 17:05:29 -04:00
Rex Zhu
bbe6aa9953
drm/amd/powerplay: add new Fiji function for not setting same ps.
...
Add comparison function used by powerplay to determine which
power state to select.
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-04-01 10:08:31 -04:00
Rex Zhu
66f4854c34
drm/amd/powerplay: show uvd/vce power gate info for fiji
...
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-03-17 12:01:52 -04:00
Eric Huang
b9c1a77e8c
drm/amd/powerplay: add hwmgr's functions for Fiji sysfs interfaces.
...
These add the interfaces for manual clock control.
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-02-10 14:17:00 -05:00
Rex Zhu
0cfd9f2697
drm/amdgpu: Show gpu load when display gpu performance for Fiji of VI.
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-01-08 15:39:25 -05:00
Rex Zhu
c15c8d7020
drm/amd/powerplay: fix Smatch static checker warnings
...
1. return -1 instead of -ENOMEM
2. The struct type mismatch warnings.
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-01-08 15:39:23 -05:00
Rex Zhu
75ac63dbc3
drm/amd/powerplay: fix Smatch static checker warnings with indenting (v2)
...
v2: AGD: rebase on upstream
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-01-08 15:39:22 -05:00
Rex Zhu
17c00a2fed
drm/amd/powerplay: move shared function of vi to hwmgr. (v2)
...
v2: agd: rebase on upstream
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
2015-12-21 16:42:51 -05:00
Eric Huang
db18ce397c
drm/amd/powerplay: add functions set/get_fan_control_mode in hwmgr for Fiji.
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
2015-12-21 16:42:49 -05:00
Eric Huang
601038142f
drm/amd/powerplay: Add thermal protection support for Fiji.
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
2015-12-21 16:42:47 -05:00
Eric Huang
ea617bc9f9
drm/amd/powerplay: add display configeration changed function in hwmgr for Fiji.
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
2015-12-21 16:42:47 -05:00
Eric Huang
91c4c98155
drm/amd/powerplay: add multimedia power gating support for Fiji.
...
Acked-by: Jammy Zhou <Jammy.Zhou@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
2015-12-21 16:42:44 -05:00
Alex Deucher
464cea3e35
drm/amdgpu/powerplay/fiji: query supported pcie info from cgs (v2)
...
Rather than hardcode it.
v2: integrate spc fix from Rex
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2015-12-21 16:42:33 -05:00
Alex Deucher
16881da6c0
drm/amdgpu: extract pcie helpers to common header
...
These will be used by multiple powerplay drivers and
other IP modules.
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2015-12-21 16:42:30 -05:00
Alex Deucher
74c577b031
drm/amd/powerplay/fiji: enable pcie and mclk forcing for low
...
When forcing the lowest state also force mclk and pcie.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2015-12-21 16:42:30 -05:00
Eric Huang
aabcb7c11e
drm/amd/powerplay: add Fiji DPM support.
...
This enabled DPM support for Fiji. DPM is dynamic
clock and voltage scaling.
v2: rename fiji_hwmgr_early_init to fiji_hwmgr_init
v3: (agd) fold in endian fix, additional function addition
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
2015-12-21 16:42:17 -05:00