Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit db5cffcd2bca5fafc4912446605101ec368d4d5f) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 52b52a87814b4016bb324c0d1b45eb6e6f4cea3b) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e3b04bc790ecd6d08d4699bc60b4f5a76f7f7b6b) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b118af7012f9bd4bdbda12681ce66f91aabffd3f) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 08d334087617ed9662d40db776c5d2c0a614315a) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f997e6f21308f0627c46caed0315ee005ef4775a) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3d5afb41f82f55e6912678ea24d637b84c160d65) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 67a0a0fd11524bd9943635168f8380b9906fb389) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d4fdc08e251316e2e0710d02e65b4576ce7963d2) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 35e5912d0801184b57119383da003263a21eeed1) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 0fd4af9e328c0f694d21a646232a7a62da7ec4ae) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 808a934fd47c1c4a1670069cbe2fae7c23068b14) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b6df77fc5c42041a11ff094e5595d1e7379c917f) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: monk liu <monk.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 50171ebecf87521056db2b3d5654c4348f32c9bd) Signed-off-by: Alberto Milone <alberto.milone@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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: 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>