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
Arindam Nath
505bc983bf
drm/amd/powerplay: make sure VCE is disabled by default
...
This patch is a port of similar patch for amdgpu
when PP is disabled. Since the code flow is little
different when PP is enabled, we need to make sure
the patch is applied for PP enabled path as well.
With the current code, when we boot with the amdgpu
driver enabled and loaded, the VCE also automatically
remains enabled since bootup. This can be verified from
the output of amdgpu_pm_info. It does not matter whether
we boot into command line directly or into X, the VCE
stays enabled the entire time.
This patch addresses the issue and makes sure that
VCE is turned on only during playback, and remains
disabled otherwise.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Arindam Nath <arindam.nath@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:47 -04:00
Arnd Bergmann
eafc9c2704
amdgpu: use NULL instead of 0 for pointer
...
In the AMD powerplay driver, a pointer is checked for validity by
comparing against an integer '0', which causes a harmless warning
when building with "make W=1":
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/processpptables.c:1502:16: error: ordered comparison of pointer with integer zero [-Werror=extra]
This changes the code to the more conventional "if (pointer)" check.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:54:43 -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
4dcf9e6f2e
drm/amd/powerplay: add uploading pptable and resetting powerplay support
...
Necessary for re-initializing dpm with new pptables at runtime.
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
c27371b879
drm/amd/powerplay: add disable dpm tasks for Polaris10
...
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
57461af73f
drm/amd/powerplay: add disable dpm tasks for 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-07-07 14:51:36 -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
80597521e6
drm/amd/powerplay: add event task of disable dynamic state management
...
Add an interface to disable dpm so that we can disable dpm before
updating pptables at runtime.
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
cf17039f48
drm/amd/powerplay: keep soft_pp_table pointer value for re-uploading
...
Necessary for updating pptables at runtime.
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:34 -04:00
Eric Huang
840dd4c605
drm/amd/powerplay: set UVD clocks bypass mode for Polaris10
...
Saves power when not in use.
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:32 -04:00
Eric Huang
0c9e20055d
drm/amd/powerplay: add mclk OD(overdrive) support for Polaris10
...
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:58 -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
f715d5b357
drm/amd/powerplay: add mclk OD(overdrive) support for Tonga
...
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:56 -04:00
Huang Rui
6bb6b2972d
drm/amdgpu: add powercontainment module parameter
...
This patch makes powercontainment feature configurable. Currently, the
powercontainment is not very stable, so add a module parameter to
enable/disable it via user mode.
Signed-off-by: Huang Rui <ray.huang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-07 14:50:55 -04:00
Eric Huang
09a0426404
drm/amd/powerplay: add sclk OD support on Polaris10
...
This implements sclk overdrive(OD) overclocking support for Polaris10,
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:42 -04:00
Eric Huang
9ccd4e1346
drm/amd/powerplay: add sclk OD support on Tonga
...
This implements sclk overdrive(OD) overclocking support for Tonga,
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
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
ab6bad05c8
drm/amd/powerplay: Update CKS on/ CKS off voltage offset calculation.
...
As get the right evv voltage, update them to latest coefficients to
align with BB.
agd: squash in Slava's 32 bit build 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-07-06 17:56:31 -04:00
Rex Zhu
e5eb37170b
drm/amd/powerplay: fix bug that get wrong polaris evv voltage.
...
value is 32 bits for polaris, not 16.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-06 17:44:14 -04:00
Rex Zhu
4b2427605e
drm/amd/powerplay: incorrectly use of the function return value
...
'0' means true.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2016-07-06 17:43:59 -04:00
Huang Rui
1dfefee893
drm/amd/powerplay: fix incorrect voltage table value for tonga
...
Signed-off-by: Huang Rui <ray.huang@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-07-06 16:16:43 -04:00
Huang Rui
095d28c62f
drm/amd/powerplay: fix incorrect voltage table value for polaris10
...
Signed-off-by: Huang Rui <ray.huang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-07-06 16:16:09 -04:00
Rex Zhu
0636e0d666
drm/amd/powerplay: fix issue uvd dpm can't enabled on Polaris11.
...
1. Populate correct value of VDDCI voltage for SMC SAMU, VCE,
and UVD levels depending on whether VDDCi control is SVI2 or GPIO.
2. Populate SMC ACPI minimum voltage using VBIOS boot SCLK and MCLK
When static voltage is configured as VDDCI, driver still tries to program
a voltage for MM minVoltage using VDDC-VDDCI delta requirement.
minVoltage should be set as boot up 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 >
2016-06-29 12:10:02 -04:00
Rex Zhu
3a8bd717ee
drm/amd/powerplay: Workaround for Memory EDC Error 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-29 12:09:27 -04:00
Rex Zhu
0812a945fb
drm/amd/powerplay: Update CKS on/ CKS off voltage offset calculation
...
CKS on/off voltage offset calculation algorithm takes in a few coefficients.
We need to update them for polaris to latest coefficients to align with BB.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2016-06-23 14:15:10 -04:00
Rex Zhu
83a7af6dcf
drm/amd/powerplay: disable FFC.
...
SMC need use VBI signal for MCLK switching
Send 2 x frame time as vbi timeout
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-23 14:14:30 -04:00
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
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
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
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
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