]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/log
mirror_ubuntu-zesty-kernel.git
8 years agodrm/ttm: fix adding foreign BOs to the swap LRU
Christian König [Mon, 11 Jan 2016 14:35:19 +0000 (15:35 +0100)]
drm/ttm: fix adding foreign BOs to the swap LRU

BugLink: http://bugs.launchpad.net/bugs/1546572
It doesn't make any sense to try to swap out imported BOs.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit ed704a43e84cc536081423dcd3491acf2791aaeb)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/ttm: fix adding foreign BOs to the LRU during init v2
Christian König [Mon, 11 Jan 2016 14:35:18 +0000 (15:35 +0100)]
drm/ttm: fix adding foreign BOs to the LRU during init v2

BugLink: http://bugs.launchpad.net/bugs/1546572
If we import a BO with an external reservation object we don't
reserve/unreserve it. So we never add it to the LRU causing a possible
denial of service.

v2: fix typo in commit message

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 33d48cf8256f2b72e4082a7996c04bf1e78fce81)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/radeon: use kobj_to_dev()
Geliang Tang [Wed, 13 Jan 2016 14:48:43 +0000 (22:48 +0800)]
drm/radeon: use kobj_to_dev()

BugLink: http://bugs.launchpad.net/bugs/1546572
Use kobj_to_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e3837b00b6bb2b0344dd28c601edda8eba42de7f)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: use kobj_to_dev()
Geliang Tang [Wed, 13 Jan 2016 14:48:42 +0000 (22:48 +0800)]
drm/amdgpu: use kobj_to_dev()

BugLink: http://bugs.launchpad.net/bugs/1546572
Use kobj_to_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit cc29ec874b3727e3f5a606bd1875e34f6e3f1593)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/cz: force vce clocks when sclks are forced
Alex Deucher [Fri, 18 Dec 2015 16:33:30 +0000 (11:33 -0500)]
drm/amdgpu/cz: force vce clocks when sclks are forced

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 403664bbf840e80a45c4b97115ac518b40487f91)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/cz: force uvd clocks when sclks are forced
Alex Deucher [Fri, 18 Dec 2015 16:28:49 +0000 (11:28 -0500)]
drm/amdgpu/cz: force uvd clocks when sclks are forced

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 5f57642672dd90e3183efcd9e6afbff1305a133a)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/cz: add code to enable forcing VCE clocks
Alex Deucher [Fri, 18 Dec 2015 16:25:16 +0000 (11:25 -0500)]
drm/amdgpu/cz: add code to enable forcing VCE clocks

BugLink: http://bugs.launchpad.net/bugs/1546572
VCE DPM works similarly to SCLK DPM.  Add a similar interface
for VCE for forcing the VCE clocks.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 044c0629b55d73235161557a48870d663d0072f5)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/cz: add code to enable forcing UVD clocks
Alex Deucher [Fri, 18 Dec 2015 16:06:42 +0000 (11:06 -0500)]
drm/amdgpu/cz: add code to enable forcing UVD clocks

BugLink: http://bugs.launchpad.net/bugs/1546572
UVD DPM works similarly to SCLK DPM.  Add a similar interface
for UVD for forcing the UVD clocks.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d83b1e8132f91ba9e038b5206dc81d32ecac1f75)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: fix static checker warning for return meaningless value.
Rex Zhu [Mon, 11 Jan 2016 03:25:18 +0000 (11:25 +0800)]
drm/amd/powerplay: fix static checker warning for return meaningless value.

BugLink: http://bugs.launchpad.net/bugs/1546572
The return value should be either negative or zero, no positive.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f3b5cb3e68952d4a721cc733e03eeb5151dcaa1e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/sysfs: use kobj_to_dev()
Geliang Tang [Wed, 13 Jan 2016 14:48:41 +0000 (22:48 +0800)]
drm/sysfs: use kobj_to_dev()

BugLink: http://bugs.launchpad.net/bugs/1546572
Use kobj_to_dev() instead of open-coding it.

Link: http://patchwork.freedesktop.org/patch/msgid/3fea991541fbfc4ffece2c174adeb02cb9436c90.1452696179.git.geliangtang@163.com
Signed-off-by: Geliang Tang <geliangtang@163.com>
(cherry picked from commit d122cbf1a310d962cef45c2f161b8dc3ec1475a3)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: include asm/div64.h for do_div()
Stephen Rothwell [Thu, 31 Dec 2015 10:20:20 +0000 (21:20 +1100)]
drm/amdgpu/powerplay: include asm/div64.h for do_div()

BugLink: http://bugs.launchpad.net/bugs/1546572
Fixes: 1e4854e96c35 ("drm/amdgpu/powerplay: implement thermal control for tonga.")
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 8a0d560f3e651808ae0a3d9ab9fe476e59de132b)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add irq domain support
Alex Deucher [Fri, 6 Nov 2015 06:29:08 +0000 (01:29 -0500)]
drm/amdgpu: add irq domain support

BugLink: http://bugs.launchpad.net/bugs/1546572
Hardware blocks on the GPU like ACP generate interrupts in
the GPU interrupt controller, but are driven by a separate
driver.  Add an irq domain to the GPU driver so that
blocks like ACP can register a Linux interrupt.

Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 5f2323658e4829ffb893553297e64795a90cbcd9)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/cgs: add an interface to access PCI resources
Alex Deucher [Wed, 23 Dec 2015 16:25:43 +0000 (11:25 -0500)]
drm/amdgpu/cgs: add an interface to access PCI resources

BugLink: http://bugs.launchpad.net/bugs/1546572
This provides an interface to get access to the base address
of PCI resources (MMIO, DOORBELL, etc.).  Only MMIO and
DOORBELL are implemented right now.  This is necessary to
properly utilize shared drivers on platform devices.  IP
modules can use this interface to get the base address
of the resource and add any additional offset and set the
size when setting up the platform driver(s).

Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit ba228ac8f512c9cd09cb4245c424ab1632da0c24)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add warning to amdgpu_bo_gpu_offset() v2
Christian König [Tue, 15 Dec 2015 10:10:30 +0000 (11:10 +0100)]
drm/amdgpu: add warning to amdgpu_bo_gpu_offset() v2

BugLink: http://bugs.launchpad.net/bugs/1546572
Check if there really is a valid offset for the BO.

v2: user WARN_ON_ONCE

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 191caba6cc4c95ba282304a10a2a9cba85450317)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: implement power down asic task for CZ
Rex Zhu [Tue, 29 Dec 2015 03:23:16 +0000 (11:23 +0800)]
drm/amd/powerplay: implement power down asic task for CZ

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit 4d42fa492eb80aed28d2237efaee004453579556)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: enable power down asic task. (v2)
Rex Zhu [Tue, 29 Dec 2015 03:22:34 +0000 (11:22 +0800)]
drm/amd/powerplay: enable power down asic task. (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
v2: AGD: rebase on upstream

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>
(cherry picked from commit e1d32e607b5ce25a7852bef4ab4de2a80f30c546)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: enable set boot state task
Rex Zhu [Tue, 29 Dec 2015 03:19:14 +0000 (11:19 +0800)]
drm/amd/powerplay: enable set boot state task

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit 018462d015c5672de0be8045b1acff19f5df6010)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add thermal control task when resume.
Rex Zhu [Tue, 29 Dec 2015 03:23:57 +0000 (11:23 +0800)]
drm/amd/powerplay: add thermal control task when resume.

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit f556c2744a8e7508493cf409849d5a248ed3fb9d)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: fix hex/decimal bug when show gpu load.
Rex Zhu [Wed, 6 Jan 2016 09:17:53 +0000 (17:17 +0800)]
drm/amdgpu: fix hex/decimal bug when show gpu load.

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit ab4f4b14c36f7ae6fa204ca304477e42f6696453)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: Show gpu load when display gpu performance for Fiji of VI.
Rex Zhu [Wed, 6 Jan 2016 09:15:59 +0000 (17:15 +0800)]
drm/amdgpu: Show gpu load when display gpu performance for Fiji of VI.

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit 0cfd9f26975be88e8d902f9bc7070f98dfdfeea2)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: Show gpu load when display gpu performance for Ci.
Rex Zhu [Wed, 6 Jan 2016 09:08:46 +0000 (17:08 +0800)]
drm/amdgpu: Show gpu load when display gpu performance for Ci.

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit 9354573d76f599e05a34e0b468ffce681769115f)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: Reload and initialize the smc firmware on powerplay resume.
Rex Zhu [Tue, 29 Dec 2015 02:25:19 +0000 (10:25 +0800)]
drm/amd/powerplay: Reload and initialize the smc firmware on powerplay resume.

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit e0b71a7eff644ca256aee6478bf220ba0a835bed)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add powerplay valid check to avoid null point. (v2)
Rex Zhu [Tue, 29 Dec 2015 05:56:03 +0000 (13:56 +0800)]
drm/amd/powerplay: add powerplay valid check to avoid null point. (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
In case CONFIG_DRM_AMD_POWERPLAY is defined and amdgpu.powerplay=0.
some functions in powrplay can also be called by DAL. and the input parameter is *adev.
if just check point not NULL was not enough and will lead to NULL point error.

V2: AGD: rebase on upstream

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>
(cherry picked from commit a969e163a4ac1b0cfa2dc7ab890aaa9ab092951c)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: fix Smatch static checker warnings
Rex Zhu [Wed, 6 Jan 2016 08:48:38 +0000 (16:48 +0800)]
drm/amd/powerplay: fix Smatch static checker warnings

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit c15c8d70207d467bb4312d6ac5536c101246fdc6)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: fix Smatch static checker warnings with indenting (v2)
Rex Zhu [Wed, 6 Jan 2016 08:38:48 +0000 (16:38 +0800)]
drm/amd/powerplay: fix Smatch static checker warnings with indenting (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit 75ac63dbc3b0f4d3af67a5857790749e954e2ba6)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: fix bug that NULL checks are reversed.
Rex Zhu [Wed, 6 Jan 2016 08:22:07 +0000 (16:22 +0800)]
drm/amd/powerplay: fix bug that NULL checks are reversed.

BugLink: http://bugs.launchpad.net/bugs/1546572
&& was used instead of ||.

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>
(cherry picked from commit 53d3de140b668d37e1ebfe01c94ec36d369edcbf)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: fix NULL in vm_grab_id while S3 back
Chunming Zhou [Tue, 29 Dec 2015 03:57:38 +0000 (11:57 +0800)]
drm/amdgpu: fix NULL in vm_grab_id while S3 back

BugLink: http://bugs.launchpad.net/bugs/1546572
vm_manager_fini shouldn't be in suspend phase.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
(cherry picked from commit e1de741529412f31cb53899307bd63286918c49c)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: precedence bug in init_non_clock_fields()
Dan Carpenter [Mon, 4 Jan 2016 20:44:24 +0000 (23:44 +0300)]
drm/amd/powerplay: precedence bug in init_non_clock_fields()

BugLink: http://bugs.launchpad.net/bugs/1546572
The cast to uint8_t happens before the right shift so this always sets
.m3arb to zero.  The cast is actually a no-op so we can remove it.

Fixes: 3bace3591493 ('drm/amd/powerplay: add hardware manager sub-component')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7c9574f262a25c7ca0779df31098ba4e0c382e86)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/cgs: cleanup some indenting
Dan Carpenter [Mon, 4 Jan 2016 20:43:47 +0000 (23:43 +0300)]
drm/amdgpu/cgs: cleanup some indenting

BugLink: http://bugs.launchpad.net/bugs/1546572
This code is indented too far.  Also we normally use spaces to align if
statement conditions.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b92c26d1808ccd2acac17b660dce750ba9b0a0db)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: fix a reversed condition
Dan Carpenter [Mon, 4 Jan 2016 20:42:55 +0000 (23:42 +0300)]
drm/amd/powerplay: fix a reversed condition

BugLink: http://bugs.launchpad.net/bugs/1546572
This test was reversed so it would end up leading to a NULL dereference.

Fixes: 4630f0faae80 ('drm/amd/powerplay: add Carrizo smu support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2500a3c9e06d349defdca00f2efd7fab189ae72f)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm: powerplay: use div64_s64 instead of do_div
Arnd Bergmann [Fri, 1 Jan 2016 13:07:41 +0000 (14:07 +0100)]
drm: powerplay: use div64_s64 instead of do_div

BugLink: http://bugs.launchpad.net/bugs/1546572
The newly added code for Fiji creates a correct compiler warning
about invalid use of the do_div macro:

In file included from powerplay/hwmgr/ppatomctrl.c:31:0:
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppevvmath.h: In function 'fDivide':
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppevvmath.h:382:89: warning: comparison of distinct pointer types lacks a cast
     do_div(longlongX, longlongY); /*Q(32,32) divided by Q(16,16) = Q(16,16) Back to original format */

do_div() divides an unsigned 64-bit number by an unsigned 32-bit number.
The code instead wants to divide two signed 64-bit numbers, which is done
using the div64_s64 function.

Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 770911a3cfbb ("drm/amd/powerplay: add/update headers for Fiji SMU and DPM")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6a53b31349e7fbe6f742b7f09d7c2118d4fe81e3)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: show gpu load when print gpu performance for Cz. (v2)
Rex Zhu [Thu, 17 Dec 2015 09:20:04 +0000 (17:20 +0800)]
drm/amd/powerplay: show gpu load when print gpu performance for Cz. (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
Show GPU load in in the debugfs output.

v2: integrate Tom's optimization

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
(cherry picked from commit 605ed21929fee2b39e8cb25301184c4ad9b468e5)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: check whether need to enable thermal control. (v2)
Rex Zhu [Thu, 17 Dec 2015 06:20:06 +0000 (14:20 +0800)]
drm/amd/powerplay: check whether need to enable thermal control. (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
In I+A platform(skylake), it is controlled by intel.

v2: integrate Tom's fix

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
(cherry picked from commit cae9b9c81bde812590cdac7df32ad5662741b3d5)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add point check to avoid NULL point hang.
Rex Zhu [Fri, 11 Dec 2015 07:21:33 +0000 (15:21 +0800)]
drm/amd/powerplay: add point check to avoid NULL point hang.

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 88b8dcbe21fda8024827a6559af596f9d0caaadb)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: Program a calculated value as Deep Sleep clock.
David Rokhvarg [Fri, 11 Dec 2015 17:06:25 +0000 (12:06 -0500)]
drm/amdgpu/powerplay: Program a calculated value as Deep Sleep clock.

BugLink: http://bugs.launchpad.net/bugs/1546572
This replaces programming of a hardcoded value.

Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com>
(cherry picked from commit c90e5d20fc1bfefdeb99d5ec2cb0fb28f26d208d)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoamd/powerplay: Add structures required to report configuration change
Eric Yang [Tue, 1 Dec 2015 18:23:07 +0000 (13:23 -0500)]
amd/powerplay: Add structures required to report configuration change

BugLink: http://bugs.launchpad.net/bugs/1546572
Add required structures for amd_powerplay_display_configuration_change

Signed-off-by: Eric Yang <eric.yang2@amd.com>
(cherry picked from commit 14f634110fa68120ec66e24f1e423e3cc2109c9f)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoamd/powerplay: Fix get dal power level
Vitaly Prosyak [Thu, 3 Dec 2015 15:27:57 +0000 (10:27 -0500)]
amd/powerplay: Fix get dal power level

BugLink: http://bugs.launchpad.net/bugs/1546572
Simplify data struct for get dal power level

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
(cherry picked from commit 1c9a90820beb63f75ac7dabf75533f425aadc3fa)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoamd\powerplay Implement get dal power level
Vitaly Prosyak [Mon, 30 Nov 2015 21:39:53 +0000 (16:39 -0500)]
amd\powerplay Implement get dal power level

BugLink: http://bugs.launchpad.net/bugs/1546572
Implement get dal power level and simple clock info

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
(cherry picked from commit c4dd206be1560ebb6eef9cf2200d10a4577cef3f)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: Don't return an error if fan table is missing
Alex Deucher [Mon, 14 Dec 2015 15:46:52 +0000 (10:46 -0500)]
drm/amd/powerplay: Don't return an error if fan table is missing

BugLink: http://bugs.launchpad.net/bugs/1546572
It's a valid configuration on some laptops.

Reviewed-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 283b1a8bfba47921df927bd71b9db40045f4de15)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/powerplay/hwmgr: log errors in tonga_hwmgr_backend_init
Alex Deucher [Fri, 11 Dec 2015 17:39:01 +0000 (12:39 -0500)]
drm/powerplay/hwmgr: log errors in tonga_hwmgr_backend_init

BugLink: http://bugs.launchpad.net/bugs/1546572
Helpful in debugging init issues.

Reviewed-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit aa22ae4b1f23a52c7e92599ee47a9b9fbb129604)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/powerplay: add debugging output to processpptables.c
Alex Deucher [Fri, 11 Dec 2015 17:32:55 +0000 (12:32 -0500)]
drm/powerplay: add debugging output to processpptables.c

BugLink: http://bugs.launchpad.net/bugs/1546572
To help track down init errors.

Reviewed-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a71e06d97293bca733e3a98006aa415a2f87a8c2)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/powerplay: add debugging output to tonga_processpptables.c
Alex Deucher [Fri, 11 Dec 2015 17:12:32 +0000 (12:12 -0500)]
drm/powerplay: add debugging output to tonga_processpptables.c

BugLink: http://bugs.launchpad.net/bugs/1546572
To help track down init errors.

Reviewed-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1d5498c23e852f18d6c8d5c8ba2809fb7dfedb2f)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: display gpu load when print performance for tonga.
Rex Zhu [Tue, 8 Dec 2015 06:31:13 +0000 (14:31 +0800)]
drm/amd/powerplay: display gpu load when print performance for tonga.

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
(cherry picked from commit 9c5f8de6ef36df33e655039fb9392b0ee7203d30)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: enable sysfs and debugfs interfaces late
Alex Deucher [Tue, 8 Dec 2015 22:28:28 +0000 (17:28 -0500)]
drm/amdgpu/powerplay: enable sysfs and debugfs interfaces late

BugLink: http://bugs.launchpad.net/bugs/1546572
To avoid users accessing them before the module has finished
initializing them and make sure they are only created if
dpm has properly initialized.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 898b1dead9a99aeeb103febacf838c7c71d58292)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: move shared function of vi to hwmgr. (v2)
Rex Zhu [Thu, 3 Dec 2015 06:16:01 +0000 (14:16 +0800)]
drm/amd/powerplay: move shared function of vi to hwmgr. (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
v2: agd: rebase on upstream

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
(cherry picked from commit 17c00a2fed1bcc80949e0e68607bcea6af3c5358)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: check whether enable dpm in powerplay.
Rex Zhu [Mon, 23 Nov 2015 06:50:10 +0000 (14:50 +0800)]
drm/amd/powerplay: check whether enable dpm in powerplay.

BugLink: http://bugs.launchpad.net/bugs/1546572
Change-Id: I0a2dbf8ef7d4a3e9788fe211fc5964dd2487c519
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
(cherry picked from commit 1ea6c1e8e40c5cccc3572d1221c0770fc0c437f3)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: fix bug that dpm funcs in debugfs/sysfs missing.
Rex Zhu [Mon, 7 Dec 2015 08:42:35 +0000 (16:42 +0800)]
drm/amd/powerplay: fix bug that dpm funcs in debugfs/sysfs missing.

BugLink: http://bugs.launchpad.net/bugs/1546572
in dpm module, sysfs init func move to late_init from sw_init.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Change-Id: Ice4a73212d8e3106d05f04a27043820ffd32929e
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
(cherry picked from commit 7ad4e7f09372946d1bfd5359c45ccce024d0689e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: fix boolreturn.cocci warnings
kbuild test robot [Sat, 5 Dec 2015 00:13:27 +0000 (19:13 -0500)]
drm/amd/powerplay: fix boolreturn.cocci warnings

BugLink: http://bugs.launchpad.net/bugs/1546572
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:475:10-11: WARNING: return of 0/1 in function 'atomctrl_lookup_gpio_pin' with return type bool

 Return statements in functions returning bool should use
 true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

CC: yanyang1 <young.yang@amd.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 195567e99bdf6491a370b71a1dcf6b4c891495d7)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add functions set/get_fan_control_mode in hwmgr for Fiji.
Eric Huang [Fri, 4 Dec 2015 20:49:02 +0000 (15:49 -0500)]
drm/amd/powerplay: add functions set/get_fan_control_mode in hwmgr for Fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit db18ce397c0928bb420a511db52ce36c2003676e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add functions set/get_fan_control_mode in hwmgr for Tonga.
Eric Huang [Fri, 4 Dec 2015 15:57:22 +0000 (10:57 -0500)]
drm/amd/powerplay: add functions set/get_fan_control_mode in hwmgr for Tonga.

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 9dcfc1936aa0f6a18fd2852e224d59610cd73e7a)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: Fix a bug in fan control setting default mode for Tonga and Fiji.
Eric Huang [Thu, 3 Dec 2015 20:13:46 +0000 (15:13 -0500)]
drm/amd/powerplay: Fix a bug in fan control setting default mode for Tonga and Fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 7ae0a66134c7274cd889129f67a83ac004084b3b)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: Add thermal protection support for Fiji.
Eric Huang [Fri, 27 Nov 2015 19:09:53 +0000 (14:09 -0500)]
drm/amd/powerplay: Add thermal protection support for Fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 601038142fdab3750f26c0f7bda8c7f4805cbe1d)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add display configeration changed function in hwmgr for Fiji.
Eric Huang [Tue, 24 Nov 2015 22:00:56 +0000 (17:00 -0500)]
drm/amd/powerplay: add display configeration changed function in hwmgr for Fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit ea617bc9f9f2ad3469397a74129e62a490e56900)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: Prepare DKMS build for powerplay module.
Qiang Yu [Wed, 2 Dec 2015 02:56:57 +0000 (10:56 +0800)]
drm/amdgpu: Prepare DKMS build for powerplay module.

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit bd90dd89e53c383d1fea973721c8e7864946a254)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/amdgpu: enable uvd&vce clock gating for Fiji.
Eric Huang [Tue, 24 Nov 2015 15:53:27 +0000 (10:53 -0500)]
drm/amd/amdgpu: enable uvd&vce clock gating for Fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 0bbb81761864c63b5f323b61b48ee892d472c880)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/amdgpu: add vce3.0 clock gating support. (v2)
Eric Huang [Mon, 23 Nov 2015 21:57:53 +0000 (16:57 -0500)]
drm/amd/amdgpu: add vce3.0 clock gating support. (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
v2: fix grbm locking

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 0689a5701358656fe16e83df7c6c654185593208)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/amdgpu: add uvd6.0 clock gating support. (v2)
Eric Huang [Mon, 23 Nov 2015 16:20:36 +0000 (11:20 -0500)]
drm/amd/amdgpu: add uvd6.0 clock gating support. (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
v2: fix bug in register mask setting.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 9b08a306476d25c9f5721eccbc43e90bb23c5f58)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add multimedia power gating support for Fiji.
Eric Huang [Fri, 20 Nov 2015 20:58:11 +0000 (15:58 -0500)]
drm/amd/powerplay: add multimedia power gating support for Fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit 91c4c98155a86b2b3afc2fc9dd63a4cb5344b71e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: rename fiji_smumgr.h to fiji_smum.h
Jammy Zhou [Wed, 21 Oct 2015 09:18:10 +0000 (17:18 +0800)]
drm/amdgpu: rename fiji_smumgr.h to fiji_smum.h

BugLink: http://bugs.launchpad.net/bugs/1546572
This conflicts with fiji_smumgr.h from powerplay
in DKMS environment

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
(cherry picked from commit b57fd5663e34f024406936283475f4c0eadbfc96)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: rename tonga_smumgr.h to tonga_smum.h
Jammy Zhou [Wed, 21 Oct 2015 09:15:45 +0000 (17:15 +0800)]
drm/amdgpu: rename tonga_smumgr.h to tonga_smum.h

BugLink: http://bugs.launchpad.net/bugs/1546572
This conflicts with the tonga_smumgr.h from powerplay
in DKMS environement

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
(cherry picked from commit dbd29f0d8513b0d660807beb13df94b00402ea57)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: Add PPLib debug print macro.
David Rokhvarg [Thu, 19 Nov 2015 19:45:39 +0000 (14:45 -0500)]
drm/amd/powerplay: Add PPLib debug print macro.

BugLink: http://bugs.launchpad.net/bugs/1546572
- The macro is silent by default.
- Use the macro to print Display Configuration - related changes.

Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com>
(cherry picked from commit 6bd48d24045c3f93f3f57ca1d61388ea0b38c89c)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: enable/disable NB pstate feature for Carrizo.
Rex Zhu [Thu, 19 Nov 2015 05:48:14 +0000 (13:48 +0800)]
drm/amd/powerplay: enable/disable NB pstate feature for Carrizo.

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit 0f8b106e11d616eb50aef8f58a47d383101aa4dc)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: enable set_cpu_power_state task. (v2)
Rex Zhu [Thu, 19 Nov 2015 05:47:02 +0000 (13:47 +0800)]
drm/amd/powerplay: enable set_cpu_power_state task. (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
v2: integrate Jammy's crash fix

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit 73afe621016645ec9dbeacefd6a38cc7054ec8c4)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: export interface to DAL to init/change display configuration.
Rex Zhu [Thu, 19 Nov 2015 05:35:30 +0000 (13:35 +0800)]
drm/amd/powerplay: export interface to DAL to init/change display configuration.

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit 7fb72a1fc01cc1a8de533abc80b9eaf0120e8529)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add smc msg for NB P-State switch
Rex Zhu [Thu, 19 Nov 2015 05:47:36 +0000 (13:47 +0800)]
drm/amd/powerplay: add smc msg for NB P-State switch

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit aceae1bfd91d73965a165b72f55678e5f6337448)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add new function point in hwmgr.
Rex Zhu [Thu, 19 Nov 2015 05:46:01 +0000 (13:46 +0800)]
drm/amd/powerplay: add new function point in hwmgr.

BugLink: http://bugs.launchpad.net/bugs/1546572
1. for set_cpu_power_state
2. restore display configuration

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit 73c9f222889986d6f0ba0708115337a0284a5b61)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: fix warning of cast to pointer from integer of different size.
Rex Zhu [Mon, 16 Nov 2015 03:24:35 +0000 (11:24 +0800)]
drm/amd/powerplay: fix warning of cast to pointer from integer of different size.

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit c9fe74e68b01d44716cf26615b979f0221aaa2ff)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: fix warning of cast to pointer from integer of different size.
rezhu [Thu, 12 Nov 2015 08:40:50 +0000 (16:40 +0800)]
drm/amd/powerplay: fix warning of cast to pointer from integer of different size.

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 09b7a9862222c44945c936f1c4f017b4cda1eaa1)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: implement smc state upload for CZ
Alex Deucher [Sat, 14 Nov 2015 04:51:40 +0000 (23:51 -0500)]
drm/amd/powerplay: implement smc state upload for CZ

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 9c0bad907413f5e3bea19d062beaab65b3dbf98f)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add atomctrl function to calculate CZ sclk dividers
Alex Deucher [Sat, 14 Nov 2015 03:00:01 +0000 (22:00 -0500)]
drm/amd/powerplay: add atomctrl function to calculate CZ sclk dividers

BugLink: http://bugs.launchpad.net/bugs/1546572
Use atombios to calculate the values.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d39d5c2c9dcfb9e9aec2be154784a12f5b4a6c97)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: enable clock gating for Fiji.
Eric Huang [Thu, 12 Nov 2015 22:30:52 +0000 (17:30 -0500)]
drm/amd/powerplay: enable clock gating for Fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 92b05d827df2ffe348f7dc2cfb67807a4efdadd2)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add parts of system clock gating support for Fiji. (v2)
Eric Huang [Thu, 12 Nov 2015 21:59:47 +0000 (16:59 -0500)]
drm/amd/powerplay: add parts of system clock gating support for Fiji. (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
Removed fiji_mgcg_cgcg_init that is affected and redundant for new implementation.

v2: re-add mgcg_cgcg init

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 6cec2655fa988b4df605e46d4b5c7fbe50056dd5)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add sdma clock gating support for Fiji.
Eric Huang [Wed, 11 Nov 2015 16:49:11 +0000 (11:49 -0500)]
drm/amdgpu: add sdma clock gating support for Fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 3c997d2412572a9306b7cebd713271c0fdc1350c)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/amdgpu: add gmc clock gating support for Fiji.
Eric Huang [Tue, 10 Nov 2015 16:27:39 +0000 (11:27 -0500)]
drm/amd/amdgpu: add gmc clock gating support for Fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit a0d69786b5e8c39f8e8a24422a05d3f1f4434b4d)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/amdgpu: add gfx clock gating support for Fiji.
Eric Huang [Tue, 10 Nov 2015 15:50:25 +0000 (10:50 -0500)]
drm/amd/amdgpu: add gfx clock gating support for Fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 6e378858df1df362d8db814666d0caa0703087a3)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay/tonga: Add UVD DPM init
Alex Deucher [Fri, 13 Nov 2015 15:46:30 +0000 (10:46 -0500)]
drm/amd/powerplay/tonga: Add UVD DPM init

BugLink: http://bugs.launchpad.net/bugs/1546572
Load the UVD DPM state into the SMC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 0104aa21a936f6360c7c8aaf2e2b6e18b4ff5dab)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: fix boolreturn.cocci warnings
kbuild test robot [Thu, 12 Nov 2015 17:58:34 +0000 (12:58 -0500)]
drm/amd/powerplay: fix boolreturn.cocci warnings

BugLink: http://bugs.launchpad.net/bugs/1546572
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_hwmgr.c:2653:9-10: WARNING: return of 0/1 in function 'is_pcie_gen2_supported' with return type bool
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_hwmgr.c:2645:9-10: WARNING: return of 0/1 in function 'is_pcie_gen3_supported' with return type bool

 Return statements in functions returning bool should use
 true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

CC: yanyang1 <young.yang@amd.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 62a03f6d58dafd3d25f527e75589d45ba4b3a537)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay/fiji: query supported pcie info from cgs (v2)
Alex Deucher [Thu, 12 Nov 2015 02:02:16 +0000 (21:02 -0500)]
drm/amdgpu/powerplay/fiji: query supported pcie info from cgs (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit 464cea3e35080e80734316e94e052c9027bee780)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay/tonga: query supported pcie info from cgs (v2)
Alex Deucher [Thu, 12 Nov 2015 01:58:55 +0000 (20:58 -0500)]
drm/amdgpu/powerplay/tonga: query supported pcie info from cgs (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit 834b694cc37890b8ac5437115994dac3a2f48725)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/cgs: add sys info query for pcie gen and link width
Alex Deucher [Thu, 12 Nov 2015 01:35:32 +0000 (20:35 -0500)]
drm/amdgpu/cgs: add sys info query for pcie gen and link width

BugLink: http://bugs.launchpad.net/bugs/1546572
Needed by powerplay to properly handle pcie dpm switching.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit cfd316d59e203985699495147a973ba058ff5478)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: store pcie gen mask and link width
Alex Deucher [Thu, 12 Nov 2015 00:45:06 +0000 (19:45 -0500)]
drm/amdgpu: store pcie gen mask and link width

BugLink: http://bugs.launchpad.net/bugs/1546572
We'll need this later for pcie dpm.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d0dd7f0cc345fc8757148004639e1993ba183bd6)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm: add drm_pcie_get_max_link_width helper (v2)
Alex Deucher [Thu, 12 Nov 2015 04:14:39 +0000 (23:14 -0500)]
drm: add drm_pcie_get_max_link_width helper (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
Add a helper to get the max link width of the port.
Similar to the helper to get the max link speed.

v2: fix typo in commit message

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 60d8edd415e9da63599c7601707ca78ad74a927e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: extract pcie helpers to common header
Alex Deucher [Thu, 12 Nov 2015 01:18:52 +0000 (20:18 -0500)]
drm/amdgpu: extract pcie helpers to common header

BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit 16881da6c0b9db5fca95b96b0f02720e94c92629)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay/fiji: enable pcie and mclk forcing for low
Alex Deucher [Wed, 11 Nov 2015 05:31:00 +0000 (00:31 -0500)]
drm/amd/powerplay/fiji: enable pcie and mclk forcing for low

BugLink: http://bugs.launchpad.net/bugs/1546572
When forcing the lowest state also force mclk and pcie.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 74c577b0313d4140ec8b61745c6ade3a4d735d33)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay/tonga: enable pcie and mclk forcing for low
Alex Deucher [Wed, 11 Nov 2015 05:23:57 +0000 (00:23 -0500)]
drm/amd/powerplay/tonga: enable pcie and mclk forcing for low

BugLink: http://bugs.launchpad.net/bugs/1546572
When forcing the lowest state also force mclk and pcie.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 9fe1837d18c2b31f535ef18cd076b678d6a3e2d6)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: refine the logic of whether need to update power state.
Rex Zhu [Wed, 4 Nov 2015 06:56:56 +0000 (14:56 +0800)]
drm/amd/powerplay: refine the logic of whether need to update power state.

BugLink: http://bugs.launchpad.net/bugs/1546572
Better handle power state changes.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit f4caf3e584120e20f8ecabefa8a0d62fe9b3ec89)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: implement new funcs to check current states for tonga.
Rex Zhu [Wed, 4 Nov 2015 03:21:35 +0000 (11:21 +0800)]
drm/amd/powerplay: implement new funcs to check current states for tonga.

BugLink: http://bugs.launchpad.net/bugs/1546572
Implement the new callbacks for tonga.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit e829ecdb15671d8c1a106f608aa419f7fd4d7366)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add and export hwmgr interface to eventmgr to check hw states.
Rex Zhu [Wed, 4 Nov 2015 03:07:34 +0000 (11:07 +0800)]
drm/amd/powerplay: add and export hwmgr interface to eventmgr to check hw states.

BugLink: http://bugs.launchpad.net/bugs/1546572
Interface between hwmgr and eventmgr.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit 09b4c872fe16d5e396de8636f5810078014dbd3f)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: support per device powerplay enablement (v2)
Jammy Zhou [Tue, 10 Nov 2015 23:31:08 +0000 (18:31 -0500)]
drm/amdgpu: support per device powerplay enablement (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
The amdgu_powerplay variable is global for multiple GPU instances.

v2: fold in Flora's module option change, protect adev reference in
macros

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit e61710c59dd205b48413762b2aedd46e86df3c45)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: enable sysfs interface for powerplay
Rex Zhu [Tue, 10 Nov 2015 23:29:11 +0000 (18:29 -0500)]
drm/amdgpu: enable sysfs interface for powerplay

BugLink: http://bugs.launchpad.net/bugs/1546572
Same interface exposed in pre-powerplay dpm code.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 8804b8d5b05bbf5aea205e49fa4ed8240eb1728d)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: export fan control functions to amdgpu
Rex Zhu [Thu, 15 Oct 2015 09:23:43 +0000 (17:23 +0800)]
drm/amdgpu: export fan control functions to amdgpu

BugLink: http://bugs.launchpad.net/bugs/1546572
Hook up the amdgpu thermal control callbacks for powerplay.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3af76f23a45b75441b8eac30aa5a7d957e699e73)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: implement fan control interface in amd_powerplay_funcs
Rex Zhu [Fri, 16 Oct 2015 03:48:21 +0000 (11:48 +0800)]
drm/amdgpu/powerplay: implement fan control interface in amd_powerplay_funcs

BugLink: http://bugs.launchpad.net/bugs/1546572
This adds the interface needed to expose powerplay fan control to sysfs
via hwmon.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit cac9a1991922c12a9a24ae20d250221742aed692)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: implement thermal control for tonga.
Rex Zhu [Tue, 20 Oct 2015 10:06:23 +0000 (18:06 +0800)]
drm/amdgpu/powerplay: implement thermal control for tonga.

BugLink: http://bugs.launchpad.net/bugs/1546572
Implement thermal and fan control for tonga.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1e4854e96c356288a80a0dcd35aa8240df1156c3)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: enable thermal interrupt task in eventmgr.
Rex Zhu [Fri, 16 Oct 2015 12:32:36 +0000 (20:32 +0800)]
drm/amdgpu/powerplay: enable thermal interrupt task in eventmgr.

BugLink: http://bugs.launchpad.net/bugs/1546572
Add thermal handling to the event manager.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2dfea9cd1ffe3aacbf52a913257ab3adedfe1ac1)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: add thermal control interface in hwmgr.
Rex Zhu [Wed, 21 Oct 2015 02:34:22 +0000 (10:34 +0800)]
drm/amdgpu/powerplay: add thermal control interface in hwmgr.

BugLink: http://bugs.launchpad.net/bugs/1546572
Thermal controller interface.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit fba4eef5847a1c9c8b49c039bc8aa6c9070d058e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: mv ppinterrupt.h to inc folder to share with other submodule.
Rex Zhu [Wed, 21 Oct 2015 02:30:02 +0000 (10:30 +0800)]
drm/amdgpu/powerplay: mv ppinterrupt.h to inc folder to share with other submodule.

BugLink: http://bugs.launchpad.net/bugs/1546572
Redefine interrupt callback function in accordance with cgs.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 251bb34fa44ef92dce1903e92af68f12a7f6d594)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: add new function point in hwmgr_funcs for thermal control
Rex Zhu [Fri, 16 Oct 2015 03:46:51 +0000 (11:46 +0800)]
drm/amdgpu/powerplay: add new function point in hwmgr_funcs for thermal control

BugLink: http://bugs.launchpad.net/bugs/1546572
Add the interface for fan and thermal control.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit c28eae26b54cb864310a4088ce4d999b66208b8c)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: Add CG and PG support for tonga
Rex Zhu [Thu, 15 Oct 2015 13:12:58 +0000 (21:12 +0800)]
drm/amd/powerplay: Add CG and PG support for tonga

BugLink: http://bugs.launchpad.net/bugs/1546572
Implement clock and power gating support for tonga.  On Tonga
this is handles by the SMU rather than direct register settings
in the driver.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 0859ed3db96c302f5d1b459e963737301a4080b2)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add new function point in hwmgr_func for CG/PG.
Rex Zhu [Wed, 30 Sep 2015 05:28:49 +0000 (13:28 +0800)]
drm/amd/powerplay: add new function point in hwmgr_func for CG/PG.

BugLink: http://bugs.launchpad.net/bugs/1546572
Add callbacks interface for clock and powergating.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b1132013ce4c8263e1692841223ff022cf8bf18f)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: add some definition for other ip block to update cg pg.
Rex Zhu [Fri, 9 Oct 2015 10:43:28 +0000 (18:43 +0800)]
drm/amdgpu/powerplay: add some definition for other ip block to update cg pg.

BugLink: http://bugs.launchpad.net/bugs/1546572
Interface for clock and power gating handling.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3cec76f973af12c48edce1416193378532cc1bf3)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>