]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/log
mirror_ubuntu-zesty-kernel.git
8 years agodrm/amdgpu/cik: don't mess with aspm if gpu is root bus
Alex Deucher [Thu, 4 Feb 2016 15:33:59 +0000 (10:33 -0500)]
drm/amdgpu/cik: don't mess with aspm if gpu is root bus

BugLink: http://bugs.launchpad.net/bugs/1546572
Pcie registers may not be available in a virtualized
environment.

Reviewed-by: monk liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 76ecb2c75bc772050f2e0462b9cf0163cc43046e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add pcie cap module parameters (v2)
Alex Deucher [Thu, 4 Feb 2016 15:21:23 +0000 (10:21 -0500)]
drm/amdgpu: add pcie cap module parameters (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
Allows the user to force the supported pcie gen and lane
config on both the asic and the chipset.
Useful for debugging pcie problems and for virtualization
where we may not be able to query the pcie bridge caps.

Default to:
gen: chipset 1/2, asic 1/2/3
lanes: 1/2/4/8/16

v2: fix bare metal case

Reviewed-by: monk liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit cd474ba0d6048aeefe6f1066a6bfb5eac36a2a81)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: disable uvd and vce clockgating on Fiji
Alex Deucher [Tue, 2 Feb 2016 23:22:24 +0000 (18:22 -0500)]
drm/amdgpu: disable uvd and vce clockgating on Fiji

BugLink: http://bugs.launchpad.net/bugs/1546572
Doesn't work properly yet.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Sonny Jiang <sonny.jiang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6357b75a5c356a9d8f91c614ab72ac5264a5932c)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: load MEC ucode manually on iceland
Alex Deucher [Tue, 2 Feb 2016 21:22:15 +0000 (16:22 -0500)]
drm/amdgpu: load MEC ucode manually on iceland

BugLink: http://bugs.launchpad.net/bugs/1546572
The smc doesn't handle it.

Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
(cherry picked from commit 951e09624a9f417f0b64c872f71feb6738905086)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/gfx7: enable cp inst/reg error interrupts
Alex Deucher [Tue, 2 Feb 2016 19:46:48 +0000 (14:46 -0500)]
drm/amdgpu/gfx7: enable cp inst/reg error interrupts

BugLink: http://bugs.launchpad.net/bugs/1546572
Enable CP register/instruction error interrupts. Useful
for debugging command stream problems.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit ef720532ecc22a76fea4450bcc91ee054cde9bdb)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/gfx8: enable cp inst/reg error interrupts
Alex Deucher [Tue, 2 Feb 2016 19:42:28 +0000 (14:42 -0500)]
drm/amdgpu/gfx8: enable cp inst/reg error interrupts

BugLink: http://bugs.launchpad.net/bugs/1546572
Enable CP register/instruction error interrupts. Useful
for debugging command stream problems.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1d22a454ecda91c8b8c67ff2b07cdbdf7d26ede1)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: mask out WC from BO on unsupported arches
Oded Gabbay [Sat, 30 Jan 2016 05:59:34 +0000 (07:59 +0200)]
drm/amdgpu: mask out WC from BO on unsupported arches

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
(cherry picked from commit a187f17f0e15a046aa5d7263b35df55230d92779)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: only move pt bos in LRU list on success
Nicolai Hähnle [Wed, 27 Jan 2016 16:04:19 +0000 (11:04 -0500)]
drm/amdgpu: only move pt bos in LRU list on success

BugLink: http://bugs.launchpad.net/bugs/1546572
This fixes a race condition in the error case: since the pt bos have not
necessarily been reserved in case of an error, we could move a pt bo that
is currently in the middle of being evicted/moved by another process,
which then resulted in a BUG_ON in ttm_bo_add_to_lru.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 28b8d66e0c1cc6c02b8159ae44aec359e12feefa)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdkfd: Remove unnecessary cast in kfree
Amitoj Kaur Chawla [Mon, 25 Jan 2016 17:33:57 +0000 (23:03 +0530)]
drm/amdkfd: Remove unnecessary cast in kfree

BugLink: http://bugs.launchpad.net/bugs/1546572
Remove an unnecassary cast in the argument to kfree.

Found using Coccinelle. The semantic patch used to find this is as follows:

//<smpl>
@@
type T;
expression *f;
@@

- kfree((T *)(f));
+ kfree(f);
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
(cherry picked from commit 642f0f2a1563b5ab6f5de896f602177ac1f06652)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: fix non-ANSI declaration of amdgpu_amdkfd_gfx_*_get_functions()
Colin Ian King [Fri, 22 Jan 2016 17:35:26 +0000 (17:35 +0000)]
drm/amdgpu: fix non-ANSI declaration of amdgpu_amdkfd_gfx_*_get_functions()

BugLink: http://bugs.launchpad.net/bugs/1546572
amdgpu_amdkfd_gfx_7_get_functions and amdgpu_amdkfd_gfx_8_0_get_functions
have no parameters, so use the normal void parameter convention to make
them  match their prototypes in the header file
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
(cherry picked from commit f785d98711925aceb198fb96abd786fd19fad657)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: Update SMU firmware loading for Stoney
Rex Zhu [Thu, 21 Jan 2016 11:24:44 +0000 (19:24 +0800)]
drm/amd/powerplay: Update SMU firmware loading for Stoney

BugLink: http://bugs.launchpad.net/bugs/1546572
Fix firmware init on Stoney when powerplay is enabled.

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 08b21d30c6f619aa3718620a7de91207d28bdbc5)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: don't init fbdev if we don't have any connectors
Alex Deucher [Tue, 26 Jan 2016 05:30:33 +0000 (00:30 -0500)]
drm/amdgpu: don't init fbdev if we don't have any connectors

BugLink: http://bugs.launchpad.net/bugs/1546572
Don't init fbdev if we don't have connectors.  E.g., if you have
a PX laptop with the displays attached to an IGP with no driver
support, you may end up with a blank screen rather than falling
back to vesa, etc.

Based on a similar radeon patch from Rob Clark.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f49d45c973984eb805eb989b6220aa7c1ee30bc2)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/radeon: only init fbdev if we have connectors
Rob Clark [Mon, 25 Jan 2016 23:06:48 +0000 (18:06 -0500)]
drm/radeon: only init fbdev if we have connectors

BugLink: http://bugs.launchpad.net/bugs/1546572
This fixes an issue that was noticed on an optimus/prime laptop with
a kernel that was old enough to not support the integrated intel gfx
(which was driving all the outputs), but did have support for the
discrete radeon gpu.  The end result was not falling back to VESA and
leaving the user with a black screen.

(Plus it is kind of silly to create an framebuffer device if there
are no outputs hooked up to the gpu.)

Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f95429eccc570dc45d589c327bfcfddcdc3e8228)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/radeon: Ensure radeon bo is unreserved in radeon_gem_va_ioctl
Matthew Dawson [Mon, 25 Jan 2016 15:34:12 +0000 (10:34 -0500)]
drm/radeon: Ensure radeon bo is unreserved in radeon_gem_va_ioctl

BugLink: http://bugs.launchpad.net/bugs/1546572
Found with lockdep while testing gpu reset.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Matthew Dawson <matthew@mjdsystems.ca>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 186bac815227a4c26a0ad2f18c7450015d93ed0a)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: fix next_rptr handling for debugfs
Christian König [Thu, 21 Jan 2016 11:56:52 +0000 (12:56 +0100)]
drm/amdgpu: fix next_rptr handling for debugfs

BugLink: http://bugs.launchpad.net/bugs/1546572
That somehow got lost.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 41f2d9905646b1cd4be5852b273c06b6a6d23a80)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add a message to indicate when powerplay is enabled (v2)
Alex Deucher [Wed, 20 Jan 2016 17:15:09 +0000 (12:15 -0500)]
drm/amdgpu: add a message to indicate when powerplay is enabled (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
Makes it clear to the user which power management path is in
use.

v2: make consistent with dpm

Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 9441f964f8e39374ab175e0a8fe870e1a2f02af1)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/amdgpu: Improve amdgpu_dpm* macros to avoid unexpected result (v2)
Eric Huang [Tue, 19 Jan 2016 19:28:56 +0000 (14:28 -0500)]
drm/amd/amdgpu: Improve amdgpu_dpm* macros to avoid unexpected result (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
The two macros returns are values which probably are used
in the expression of calculation. Without the brackets
the result of the expression may be wrong.

v2: agd: squash both patches together

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 4b5ece24ce564176f8ad786ad02b681a373bc615)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/atomic-helper: Export framebuffer_changed()
John Keeping [Tue, 19 Jan 2016 10:46:58 +0000 (10:46 +0000)]
drm/atomic-helper: Export framebuffer_changed()

BugLink: http://bugs.launchpad.net/bugs/1546572
The Rockchip driver cannot use drm_atomic_helper_wait_for_vblanks()
because it has hardware counters for neither vblanks nor scanlines.

In order to simplify re-implementing the functionality for this driver,
export the framebuffer_changed() helper so it can be reused.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit c240906d36653944d5c049df7ce667a7e8bea6ac)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: Allow the driver to load if amdgpu.powerplay=1 on asics without powerplay...
Jordan Lazare [Mon, 18 Jan 2016 22:00:03 +0000 (17:00 -0500)]
drm/amdgpu: Allow the driver to load if amdgpu.powerplay=1 on asics without powerplay support

BugLink: http://bugs.launchpad.net/bugs/1546572
Avoid setting pp_enabled if there is no powerplay implementation.

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3466904d38ff1e63f0a19cb31166db67f2d05c61)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoamd/powerplay: disable powerplay by default initially
Alex Deucher [Mon, 21 Dec 2015 22:07:40 +0000 (17:07 -0500)]
amd/powerplay: disable powerplay by default initially

BugLink: http://bugs.launchpad.net/bugs/1546572
Hopefully we can enable this by default once we get more
upstream feedback on stability, etc.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 53d8eabe3df36015daf40a7a9bfad9b2ffafc6bd)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: Use drm_calloc_large for VM page_tables array
Michel Dänzer [Tue, 19 Jan 2016 08:59:46 +0000 (17:59 +0900)]
drm/amdgpu: Use drm_calloc_large for VM page_tables array

BugLink: http://bugs.launchpad.net/bugs/1546572
It can be big, depending on the VM address space size, which is tunable
via the vm_size module parameter.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93721
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
(cherry picked from commit 9571e1d84042f5670df9fabdcbe7dd5da3abe43e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoamdkfd: Copy from the proper user command pointer
Borislav Petkov [Fri, 15 Jan 2016 18:26:44 +0000 (19:26 +0100)]
amdkfd: Copy from the proper user command pointer

BugLink: http://bugs.launchpad.net/bugs/1546572
8f1d57c17248 ("amdkfd: don't open-code memdup_user()") mistakenly uses
an uninitialized local pointer, gcc complains:

  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c: In function ‘kfd_ioctl_dbg_address_watch’:
  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:562:12: warning: ‘args_buff’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    args_buff = memdup_user(args_buff,
                ^

Fix it.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit 39c01bf933106296e43e46cdbd9edce13ae5a5b7)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoamdkfd: don't open-code memdup_user()
Al Viro [Sat, 2 Jan 2016 20:06:19 +0000 (15:06 -0500)]
amdkfd: don't open-code memdup_user()

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit 8f1d57c172482c9a1568ec647fc5c2e64c6c6a57)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: Add some tweaks to gfx 8 soft reset
Alex Deucher [Thu, 15 Oct 2015 14:59:16 +0000 (10:59 -0400)]
drm/amdgpu: Add some tweaks to gfx 8 soft reset

BugLink: http://bugs.launchpad.net/bugs/1546572
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7776a69386179ea477f501aa222692b9856ec56c)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/fb_cma_helper: Remove implicit call to disable_unused_functions
Maxime Ripard [Thu, 14 Jan 2016 15:24:56 +0000 (16:24 +0100)]
drm/fb_cma_helper: Remove implicit call to disable_unused_functions

BugLink: http://bugs.launchpad.net/bugs/1546572
The drm_fbdev_cma_init function always calls the
drm_helper_disable_unused_functions. Since it's part of the usual probe
process, all the drivers using that helper will end up having their encoder
and CRTC disable functions called at probe if their device has not been
reported as enabled.

This could be fixed by reading out from the registers the current state of
the device if it is enabled, but even that will not handle the case where
the device is actually disabled.

Moreover, the drivers using the atomic modesetting expect that their enable
and disable callback to be called when the device is already enabled or
disabled (respectively).

We can however fix this issue by moving the call to
drm_helper_disable_unused_functions out of drm_fbdev_cma_init and make the
drivers needing it (all the drivers calling drm_fbdev_cma_init and not
using the atomic modesetting) explicitly call it.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1452785109-6172-14-git-send-email-maxime.ripard@free-electrons.com
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 4314e19ef4ae0ba8872bd8610f6fef5e8743e236)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add missing irq.h include
Dave Airlie [Wed, 13 Jan 2016 22:07:55 +0000 (08:07 +1000)]
drm/amdgpu: add missing irq.h include

BugLink: http://bugs.launchpad.net/bugs/1546572
this fixes the build on arm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit e9c5e7402dad6f4f04c2430db6f283512bcd4392)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: validate duplicates first
Christian König [Mon, 11 Jan 2016 14:35:22 +0000 (15:35 +0100)]
drm/amdgpu: validate duplicates first

BugLink: http://bugs.launchpad.net/bugs/1546572
Most VM BOs end up in the duplicates list, validate it
first make -ENOMEM less likely.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <David1.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d8e0cae645504a787b05abfb91afee8cd7fa1701)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: move VM page tables to the LRU end on CS v2
Christian König [Mon, 11 Jan 2016 14:35:21 +0000 (15:35 +0100)]
drm/amdgpu: move VM page tables to the LRU end on CS v2

BugLink: http://bugs.launchpad.net/bugs/1546572
This makes it less likely to run into an ENOMEM because
VM page tables are evicted last.

v2: move the BOs in the LRU tail after validation

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit eceb8a1562db6fc3e1c21cd54a4be0189aa1d0e3)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/ttm: add ttm_bo_move_to_lru_tail function v2
Christian König [Mon, 11 Jan 2016 14:35:20 +0000 (15:35 +0100)]
drm/ttm: add ttm_bo_move_to_lru_tail function v2

BugLink: http://bugs.launchpad.net/bugs/1546572
This allows the drivers to move a BO to the end of the LRU
without removing and adding it again.

v2: Make it more robust, handle pinned and swapable BOs as well.

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 ab74961810ba7935b5f9643da10daaa36690f48e)
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 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>