Rex Zhu
8f5508617b
drm/amd/powerplay: add function set_clock_limit for Rv.
...
Sets floors for various clocks depending on current
requirements.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 18:31:01 -04:00
Rex Zhu
781e263bff
drm/amd/powerplay: delete duplicated code in vega10_hwmgr.c
...
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 18:24:57 -04:00
Felix Kuehling
e0ec450636
drm/amd/powerplay: Fix Vega10 power profile switching
...
Clock index 0 is a valid index that is needed to restore the default
graphics power profile. Use ~0 to indicate a failure to find a clock
index. This fixes the clocks getting stuck in the compute power
profile after running a compute application on Vega10.
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Reviewed-by: Tom St Denis <tom.stdenis@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 18:09:48 -04:00
kbuild test robot
c651fd7c11
drm/amd/powerplay: fix array_size.cocci warnings
...
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/rv_hwmgr.c:75:42-43: WARNING: Use ARRAY_SIZE
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/rv_hwmgr.c:466:22-23: WARNING: Use ARRAY_SIZE
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/rv_hwmgr.c:468:22-23: WARNING: Use ARRAY_SIZE
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/rv_hwmgr.c:470:20-21: WARNING: Use ARRAY_SIZE
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/rv_hwmgr.c:473:22-23: WARNING: Use ARRAY_SIZE
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/rv_hwmgr.c:475:21-22: WARNING: Use ARRAY_SIZE
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/rv_hwmgr.c:477:21-22: WARNING: Use ARRAY_SIZE
Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element
Semantic patch information:
This makes an effort to find cases where ARRAY_SIZE can be used such as
where there is a division of sizeof the array by the sizeof its first
element or by any indexed element or the element type. It replaces the
division of the two sizeofs by ARRAY_SIZE.
Generated by: scripts/coccinelle/misc/array_size.cocci
CC: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 17:41:58 -04:00
Rex Zhu
a960d61cbd
drm/amd/powerplay: add raven support in hwmgr. (v2)
...
hwmgr handles the GPU power state management.
v2: squash in updates (Alex)
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 17:41:52 -04:00
Rex Zhu
4fa483e5b3
drm/amd/powerplay: add raven support in smumgr. (v2)
...
smumgr provides the interface for interacting with the
smu firmware which handles power management.
v2: squash in updates (Alex)
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 17:41:51 -04:00
Eric Huang
b6dc60cf79
drm/amd/powerplay: fix pcie dpm table for vega10
...
This resolves pcie low speed problem.
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 17:39:43 -04:00
Rex Zhu
14641ac4eb
drm/amd/powerplay: delete dead code in vega10_thermal.c
...
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 17:39:42 -04:00
Rex Zhu
fbf66a3c9c
drm/amd/powerplay: Add Vega10 Powertune Table v3 support.
...
Handle the latest powerplay table format; includes Boost
State support.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewws-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 17:39:41 -04:00
Rex Zhu
676b4087fc
drm/amd/powerplay: convert from number of lanes to lane bits on vega10
...
We need a mask.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewws-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 17:39:40 -04:00
Rex Zhu
9c2cc3a10c
drm/amd/powerplay: fix bug in processing CKS_Enable bit.
...
Typo in the mask.
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 >
2017-05-24 17:39:39 -04:00
Rex Zhu
ab5cf3a551
drm/amd/powerplay: add avfs fuse overdriver func.
...
Add a function to look up the AVFS fuse values for vega10
These are used to populate the avfs fuse table in the smu.
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 >
2017-05-24 17:39:38 -04:00
Eric Huang
d6c025d243
drm/amd/powerplay: add power profile support for Vega10 (v2)
...
This implements the workload specific interface of optimized
compute power profile for Vega10.
v2: squash in fix (Tom)
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 >
2017-05-24 17:39:38 -04:00
Dan Carpenter
2f590f8419
drm/amd/powerplay: fix a signedness bugs
...
Smatch complains about a signedness bug here:
vega10_hwmgr.c:4202 vega10_force_clock_level()
warn: always true condition '(i >= 0) => (0-u32max >= 0)'
Fixes: 7b52db39a4 ("drm/amd/powerplay: fix bug sclk/mclk
level can't be set on vega10.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 17:39:34 -04:00
Alex Deucher
ae5037dcfe
drm/amd/powerplay/smu7: disable mclk switching for high refresh rates
...
Even if the vblank period would allow it, it still seems to
be problematic on some cards.
bug: https://bugs.freedesktop.org/show_bug.cgi?id=96868
Cc: stable@vger.kernel.org
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 17:39:32 -04:00
Alex Deucher
14efcf11e9
drm/amd/powerplay/smu7: add vblank check for mclk switching (v2)
...
Check to make sure the vblank period is long enough to support
mclk switching.
v2: drop needless initial assignment (Nils)
bug: https://bugs.freedesktop.org/show_bug.cgi?id=96868
Cc: stable@vger.kernel.org
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 17:39:32 -04:00
Dan Carpenter
3083696a1e
drm/amd/powerplay: fix a signedness bugs
...
Smatch complains about a signedness bug here:
vega10_hwmgr.c:4202 vega10_force_clock_level()
warn: always true condition '(i >= 0) => (0-u32max >= 0)'
Fixes: 7b52db39a4 ("drm/amd/powerplay: fix bug sclk/mclk
level can't be set on vega10.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 16:49:34 -04:00
Alex Deucher
2275a3a2fe
drm/amd/powerplay/smu7: disable mclk switching for high refresh rates
...
Even if the vblank period would allow it, it still seems to
be problematic on some cards.
bug: https://bugs.freedesktop.org/show_bug.cgi?id=96868
Cc: stable@vger.kernel.org
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 16:46:01 -04:00
Alex Deucher
09be4a5219
drm/amd/powerplay/smu7: add vblank check for mclk switching (v2)
...
Check to make sure the vblank period is long enough to support
mclk switching.
v2: drop needless initial assignment (Nils)
bug: https://bugs.freedesktop.org/show_bug.cgi?id=96868
Cc: stable@vger.kernel.org
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-24 16:45:28 -04:00
Masahiro Yamada
f90dee20b4
drm/amd: include <linux/delay.h> instead of "linux/delay.h"
...
Use <...> notation to include headers located in include/linux.
While we are here, tweak the includes order a bit to sort them
alphabetically.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1495082612-10385-1-git-send-email-yamada.masahiro@socionext.com
2017-05-22 10:05:00 +02:00
Rex Zhu
2fde9ab218
drm/amd/powerplay: refine pwm1_enable callback functions for vi.
...
Use the new enums for setting and getting the fan control mode.
Fixes problems due to previous inconsistencies between enums.
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 >
2017-05-10 13:36:35 -04:00
Rex Zhu
7522ffc41b
drm/amd/powerplay: refine pwm1_enable callback functions for Vega10.
...
Use the new enums for setting and getting the fan control mode.
Fixes problems due to previous inconsistencies between enums.
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 >
2017-05-10 13:36:28 -04:00
Rex Zhu
7b52db39a4
drm/amd/powerplay: fix bug sclk/mclk level can't be set on vega10.
...
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 >
2017-05-05 18:15:08 -04:00
Rex Zhu
5784d5cca6
drm/amd/powerplay: Setup sw CTF to allow graceful exit when temperature exceeds maximum.
...
cherry-pick from amd windows driver.
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 >
2017-05-05 18:14:56 -04:00
Rex Zhu
652bd0c344
drm/amd/powerplay: delete dead code in powerplay.
...
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 >
2017-05-05 18:14:44 -04:00
Rex Zhu
327fce0c0d
drm/amd/powerplay: disable engine spread spectrum feature on Vega10.
...
Vega10 atomfirmware do not have ASIC_InternalSS_Info table
so disable this feature by default in driver.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Ken Wang <Qingqing.wang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-05-05 18:13:28 -04:00
Rex Zhu
0dca704751
drm/amd/powerplay: correct LoadLineResistance value in pptable.
...
this value is used by avfs to adjust inversion voltage.
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 >
2017-05-05 18:12:08 -04:00
Rex Zhu
b7a1f0e3cc
drm/amd/powerplay: Allow duplicate enteries in pptable.
...
This is a valid configuration.
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 >
2017-05-05 18:12:00 -04:00
Rex Zhu
56a2f08c41
drm/amd/powerplay: set fan target temperature by msg on vega10.
...
SMU not support FanTargetTemperature in pptable,
so send msg instand.
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 >
2017-05-05 18:11:52 -04:00
Rex Zhu
05ee321511
drm/amd/powerplay: set soc floor voltage on boot on vega10.
...
Send the VBIOS bootup VDDC as a SOC floor voltage to SMU
before populating the PPTABLE. After DPM is enabled, This
floor voltage will be removed. This will prevent SMC from
going to Vmin upon receiving PPTable causing a violation.
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 >
2017-05-05 18:11:44 -04:00
Rex Zhu
8b9242eddd
drm/amd/powerplay: implement stop dpm task for vega10.
...
Add functions to disable dpm for S3/S4.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Huang Rui <ray.huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-04-28 17:33:16 -04:00
Rex Zhu
1dfc41d44c
drm/amd/powerplay: add disable_smc_ctf callback in hwmgr.
...
export disablesmcctf to eventmgr.
need to disable temperature alert when s3/s4.
otherwise, when resume back,enable temperature
alert will fail.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Huang Rui <ray.huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-04-28 17:33:15 -04:00
Rex Zhu
00c4855ef8
drm/amd/powerplay: refine set pcie dpm default table on vega10.
...
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 >
2017-04-28 17:33:12 -04:00
Rex Zhu
97782cc93f
drm/amd/powerplay: disable cks by default on vega10.
...
run gpu test auto reboot when enable cks right now.
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 >
2017-04-28 17:33:11 -04:00
Rex Zhu
effa290caa
drm/amd/powerplay: correct UlvOffsetVid on Vega10.
...
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 >
2017-04-28 17:33:10 -04:00
Rex Zhu
4bae05e196
drm/amd/powerplay: Fix AVFS param.
...
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 >
2017-04-28 17:32:51 -04:00
Rex Zhu
afc0255c9a
drm/amd/powerplay: enable clock stretch feature on Vega10.
...
Correctly calculate CKSVidOffset
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 >
2017-04-28 17:32:51 -04:00
Rex Zhu
2d5f5f9496
drm/amd/powerplay: enable pcie dpm on Vega10.
...
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 >
2017-04-28 17:32:50 -04:00
Rex Zhu
67131aa525
drm/amd/powerplay: enable AGM logging while dpm disabled.
...
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 >
2017-04-28 17:32:49 -04:00
Rex Zhu
2211a787de
drm/amd/powerplay: delete dead functions in vega10.
...
Vega10 does not support AVFS BTC, remove function.
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 >
2017-04-28 17:32:39 -04:00
Rex Zhu
6524e494a8
drm/amd/powerplay: align with VBIOS to support new AVFS structure
...
Align the driver with the latest vbios structures.
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 >
2017-04-28 16:37:55 -04:00
Rex Zhu
8250880ed8
drm/amd/powerplay: add fan controller table v11 support.
...
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 >
2017-04-07 15:15:44 -04:00
Rex Zhu
1e1eb6a893
drm/amd/powerplay: port newest process pptable code for vega10.
...
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 >
2017-04-07 15:15:43 -04:00
Rex Zhu
a7c7bc4c0c
drm/amd/powerplay: reduce sample period time
...
for power readings.
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 >
2017-03-29 23:55:22 -04:00
Eric Huang
f83a999164
drm/amd/powerplay: add Vega10 powerplay support (v5)
...
Adds power management support for vega10.
v2: squash in fan control and led config fixes from Rex
v3: squash in dead code removal and socvid fixes from Rex
v4: squash in dpm force level fix from Rex
v5: squash in latest headless, gpu load fixes from Rex
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 >
2017-03-29 23:54:54 -04:00
Eric Huang
d018772748
drm/amd/powerplay: add some display/powerplay interfaces
...
New interfaces needed to handle the new clock trees and
bandwidth requirements on vega10.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Tony Cheng <tony.cheng@amd.com >
Acked-by: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-03-29 23:54:54 -04:00
Eric Huang
e29922795f
drm/amd/powerplay: add some new structures for Vega10
...
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-03-29 23:54:52 -04:00
Eric Huang
0d2c7569e1
drm/amdgpu: add new atomfirmware based helpers for powerplay
...
New helpers for fetching info out of atomfirmware.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Reviewed-by: Ken Wang <Ken.Wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-03-29 23:54:51 -04:00
Eric Huang
923d26db85
drm/amd/powerplay: restore disabling power containment on Fiji (v2)
...
Power containment will degrade performance in some compute tests.
Restore disabling it as before code refining in powerplay.
v2: only in the compute profile
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com >
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-03-29 23:54:14 -04:00
Andrew F. Davis
93a4aec218
drm/amd/powerplay: remove unneeded conversions to bool
...
Found with scripts/coccinelle/misc/boolconv.cocci.
Signed-off-by: Andrew F. Davis <afd@ti.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-03-29 23:53:58 -04:00