]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/log
mirror_ubuntu-artful-kernel.git
8 years agodrm/amd/powerplay/tonga: Add UVD DPM init
Alex Deucher [Fri, 13 Nov 2015 15:46:30 +0000 (10:46 -0500)]
drm/amd/powerplay/tonga: Add UVD DPM init

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

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

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

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

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

BugLink: http://bugs.launchpad.net/bugs/1546572
Rather than hardcode it.

v2: integrate spc fix from Rex

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 464cea3e35080e80734316e94e052c9027bee780)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay/tonga: query supported pcie info from cgs (v2)
Alex Deucher [Thu, 12 Nov 2015 01:58:55 +0000 (20:58 -0500)]
drm/amdgpu/powerplay/tonga: query supported pcie info from cgs (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
Rather than hardcode it.

v2: integrate spc fix from Rex

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 834b694cc37890b8ac5437115994dac3a2f48725)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/cgs: add sys info query for pcie gen and link width
Alex Deucher [Thu, 12 Nov 2015 01:35:32 +0000 (20:35 -0500)]
drm/amdgpu/cgs: add sys info query for pcie gen and link width

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

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

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

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

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

v2: fix typo in commit message

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

BugLink: http://bugs.launchpad.net/bugs/1546572
These will be used by multiple powerplay drivers and
other IP modules.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3cec76f973af12c48edce1416193378532cc1bf3)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: enable powerplay module by default for fiji.
Rex Zhu [Tue, 20 Oct 2015 03:05:45 +0000 (11:05 +0800)]
drm/amdgpu: enable powerplay module by default for fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit edb611c1e1e7647510185a3fcde5914f761afd75)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: enable powerplay module by default for tonga.
Rex Zhu [Sat, 17 Oct 2015 09:57:58 +0000 (17:57 +0800)]
drm/amdgpu: enable powerplay module by default for tonga.

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 76c8cc6b3ba2186215322cf45d6547d66713bd7b)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: program display gap for tonga.
Rex Zhu [Fri, 16 Oct 2015 07:02:04 +0000 (15:02 +0800)]
drm/amdgpu/powerplay: program display gap for tonga.

BugLink: http://bugs.launchpad.net/bugs/1546572
Implement displaygap programming for tonga.  This is
required for properly mclk switching.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit bbb207f3dadd68ef4bd1cd7a214fa1d6de80ec3a)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: implement pem_task for display_configuration_change
Rex Zhu [Fri, 16 Oct 2015 06:59:17 +0000 (14:59 +0800)]
drm/amdgpu/powerplay: implement pem_task for display_configuration_change

BugLink: http://bugs.launchpad.net/bugs/1546572
Add support for display configuration changes to the event manager.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2f4afc5733d41c7a8c666f76465008457371d453)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/poweprlay: export program display gap function to eventmgr
Rex Zhu [Fri, 16 Oct 2015 06:55:03 +0000 (14:55 +0800)]
drm/amdgpu/poweprlay: export program display gap function to eventmgr

BugLink: http://bugs.launchpad.net/bugs/1546572
This allows the eventmgr to properly update the displaygap on
certain power events.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6f3bf7474ceaa6f799b1d0be5cd6becaebe3c4f9)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/powerplay: add function point in hwmgr_funcs for program display gap
Rex Zhu [Fri, 16 Oct 2015 06:51:09 +0000 (14:51 +0800)]
drm/amdgpu/powerplay: add function point in hwmgr_funcs for program display gap

BugLink: http://bugs.launchpad.net/bugs/1546572
Displaygap support is required for proper mclk switching.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e8c7de5bf6f69e7bf3bf2d2aac64daa97e51d36c)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/amdgpu: enable powerplay and smc firmware loading for Fiji.
Eric Huang [Tue, 29 Sep 2015 18:58:53 +0000 (14:58 -0400)]
drm/amd/amdgpu: enable powerplay and smc firmware loading for Fiji.

BugLink: http://bugs.launchpad.net/bugs/1546572
Switch over to handling in the powerplay module.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 899fa4c04e3894007174f8fd49f86154440afc91)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add amdgpu.powerplay module option
Jammy Zhou [Tue, 21 Jul 2015 06:01:50 +0000 (14:01 +0800)]
drm/amdgpu: add amdgpu.powerplay module option

BugLink: http://bugs.launchpad.net/bugs/1546572
This option can be used to enable the new powerplay implementation,
and it is disabled by default.

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3a74f6f27328ff4b9784a6d16f2aafa62081d9c7)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add Fiji DPM support.
Eric Huang [Wed, 26 Aug 2015 20:52:28 +0000 (16:52 -0400)]
drm/amd/powerplay: add Fiji DPM support.

BugLink: http://bugs.launchpad.net/bugs/1546572
This enabled DPM support for Fiji.  DPM is dynamic
clock and voltage scaling.

v2: rename fiji_hwmgr_early_init to fiji_hwmgr_init
v3: (agd) fold in endian fix, additional function addition

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit aabcb7c11e3d9d8a5c28fb5b3aa60ec1cec58e64)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add Fiji SMU support.
Eric Huang [Wed, 26 Aug 2015 20:50:59 +0000 (16:50 -0400)]
drm/amd/powerplay: add Fiji SMU support.

BugLink: http://bugs.launchpad.net/bugs/1546572
Add support for the SMU manager for Fiji. This handles the
firmware loading for other IP blocks (GFX, SDMA, etc.).

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 74785623db6889e6fffb5d2565a27fbeb9ddb390)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: update atomctrl for fiji
Eric Huang [Mon, 9 Nov 2015 22:35:45 +0000 (17:35 -0500)]
drm/amd/powerplay: update atomctrl for fiji

BugLink: http://bugs.launchpad.net/bugs/1546572
Add some new functions to support Fiji.  Split out
from the previous patch.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 3ec2cdb85f87dba08a025f12030f419847fcbfd6)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add/update headers for Fiji SMU and DPM
Eric Huang [Mon, 9 Nov 2015 22:34:31 +0000 (17:34 -0500)]
drm/amd/powerplay: add/update headers for Fiji SMU and DPM

BugLink: http://bugs.launchpad.net/bugs/1546572
New headers for Fiji.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit 770911a3cfbb43b67b5ea3189b624e4fe2cb27c1)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add Tonga dpm support (v3)
yanyang1 [Tue, 18 Aug 2015 07:28:32 +0000 (15:28 +0800)]
drm/amd/powerplay: add Tonga dpm support (v3)

BugLink: http://bugs.launchpad.net/bugs/1546572
This implements DPM for tonga.  DPM handles dynamic
clock and voltage scaling.

v2: merge all the patches related with tonga dpm
v3: merge dpm force level fix, cgs display fix, spelling fix

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: yanyang1 <young.yang@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
(cherry picked from commit c82baa28184356a75c0157129f88af42b2e7b695)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: Add Tonga SMU support
Jammy Zhou [Wed, 22 Jul 2015 03:29:58 +0000 (11:29 +0800)]
drm/amd/powerplay: Add Tonga SMU support

BugLink: http://bugs.launchpad.net/bugs/1546572
The SMU manager handles firmware loading for other IP
blocks (GFX, SDMA, etc.).  This implements it for Tonga.

v3: delete peci sub-module
v2: use cgs interface directly

Signed-off-by: Young Yang <Young.Yang@amd.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1060029fae7c351351d7c2e9e345b6c57f515668)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add header file for tonga smu and dpm
yanyang1 [Mon, 17 Aug 2015 06:15:20 +0000 (14:15 +0800)]
drm/amd/powerplay: add header file for tonga smu and dpm

BugLink: http://bugs.launchpad.net/bugs/1546572
These headers provide the SMU interface used by the driver.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: yanyang1 <young.yang@amd.com>
(cherry picked from commit 306d8db3e7b051814f4e022bb527391a1b425b47)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: Move smu7*.h from amdgpu to powerplay.
yanyang1 [Wed, 19 Aug 2015 04:22:34 +0000 (12:22 +0800)]
drm/amd/powerplay: Move smu7*.h from amdgpu to powerplay.

BugLink: http://bugs.launchpad.net/bugs/1546572
Move smu7.h, smu7_discrete.h and smu7_fusion.h from amdgpu to powerplay.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: yanyang1 <young.yang@amd.com>
(cherry picked from commit 7ff1d70a40f468e20a6cae5311800cd18e680865)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: Add ixSWRST_COMMAND_1 in bif_5_0_d.h
yanyang1 [Mon, 17 Aug 2015 06:15:20 +0000 (14:15 +0800)]
drm/amd/powerplay: Add ixSWRST_COMMAND_1 in bif_5_0_d.h

BugLink: http://bugs.launchpad.net/bugs/1546572
Add ixSWRST_COMMAND_1 in bif_5_0_d.h.  Required by
new powerplay code for tonga and fiji.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: yanyang1 <young.yang@amd.com>
(cherry picked from commit 3a287055aed6634d57d57da1977f1df3c9206945)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: implement functions of amd_powerplay_func
Rex Zhu [Fri, 28 Aug 2015 04:56:43 +0000 (12:56 +0800)]
drm/amd/powerplay: implement functions of amd_powerplay_func

BugLink: http://bugs.launchpad.net/bugs/1546572
This is the common interface for interacting with the powerplay
module.

v2: squash in fixes

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 577bbe01832285f6f5128ae570246e086e37f9d0)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add event manager sub-component
Rex Zhu [Wed, 23 Sep 2015 07:14:54 +0000 (15:14 +0800)]
drm/amd/powerplay: add event manager sub-component

BugLink: http://bugs.launchpad.net/bugs/1546572
The event manager handles power related driver events.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e92a0370575ab985bcdc3ba1520bf946521d62f1)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add CG and PG support for carrizo
Rex Zhu [Wed, 23 Sep 2015 07:14:38 +0000 (15:14 +0800)]
drm/amd/powerplay: add CG and PG support for carrizo

BugLink: http://bugs.launchpad.net/bugs/1546572
This adds clock and powergating support for CZ.

v2: squash in fixes

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 28a18bab2ed6e143a4671fec12ff3feeb0dc205e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add Carrizo dpm support
Jammy Zhou [Wed, 22 Jul 2015 02:41:30 +0000 (10:41 +0800)]
drm/amd/powerplay: add Carrizo dpm support

BugLink: http://bugs.launchpad.net/bugs/1546572
This patch enables basic DPM support for Carrizo.
DPM handles dynamic clock and voltage scaling.

v3: delete peci sub-module
v2: use cgs interface directly
    correct define SMU_EnabledFeatureScoreboard_SclkDpmOn

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit bdecc20a986bbe527cea0775f265d1927083410e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add Carrizo smu support
Jammy Zhou [Wed, 22 Jul 2015 01:54:16 +0000 (09:54 +0800)]
drm/amd/powerplay: add Carrizo smu support

BugLink: http://bugs.launchpad.net/bugs/1546572
This implements the SMU firmware manager interface for CZ.
Some header files are moved from amdgpu folder to powerplay as well.

v3: delete peci sub-module.
v2: use cgs interface directly
    add load_mec_firmware function

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4630f0faae80fd2252cc85accdbc8353b0444dd9)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: amd: Include errno.h
Tim Gardner [Fri, 4 Mar 2016 12:18:38 +0000 (05:18 -0700)]
UBUNTU: SAUCE: amd: Include errno.h

BugLink: http://bugs.launchpad.net/bugs/1546572
Fixes compile failure on non-amd64 arches:

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_thermal.c: In function 'tonga_fan_ctrl_get_fan_speed_percent':
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_thermal.c:80:11: error: 'EINVAL' undeclared (first use in this function)
   return -EINVAL;

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add hardware manager sub-component
Jammy Zhou [Tue, 21 Jul 2015 13:18:15 +0000 (21:18 +0800)]
drm/amd/powerplay: add hardware manager sub-component

BugLink: http://bugs.launchpad.net/bugs/1546572
The hwmgr handles all hardware related calls, including clock/power
gating control, DPM, read and parse PPTable, etc.

v5: squash in fixes
v4: implement acpi's atcs function use cgs interface
v3: fix code style error and add big-endian mode support.
v2: use cgs interface directly in hwmgr sub-module

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3bace359149391c6547cefe3bf729f365bcf3ef6)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add SMU manager sub-component
Jammy Zhou [Tue, 21 Jul 2015 09:43:02 +0000 (17:43 +0800)]
drm/amd/powerplay: add SMU manager sub-component

BugLink: http://bugs.launchpad.net/bugs/1546572
The SMUMGR is one sub-component of powerplay for SMU firmware support.
The SMU handles firmware loading for other IP blocks (GFX, SDMA, etc.)
on VI parts.  The adds the core powerplay infrastructure to handle that.

v3: direct use printk in powerplay module.
v2: direct use cgs_read/write_register functions in smu-modules

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit ac885b3a20e60f568fe856008d038d7bd01394e2)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: export amd_powerplay_func to amdgpu and other ip block
Rex Zhu [Tue, 10 Nov 2015 23:25:24 +0000 (18:25 -0500)]
drm/amdgpu: export amd_powerplay_func to amdgpu and other ip block

BugLink: http://bugs.launchpad.net/bugs/1546572
Update amdgpu to deal with the new powerplay module properly.

v2: squash in fixes
v3: squash in Rex's power state reporting fix

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1b5708ffb1032a2f24b4224320753532303c1ae4)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: disable legacy path of firmware check if powerplay is enabled
Rex Zhu [Sat, 7 Nov 2015 01:33:24 +0000 (20:33 -0500)]
drm/amdgpu: disable legacy path of firmware check if powerplay is enabled

BugLink: http://bugs.launchpad.net/bugs/1546572
Powerplay will use a different interface once it's integrated.  These
legacy pathes will be removed once powerplay is enabled by default.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit ba5c2a87b0c614013296901205ed693007964a59)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd/powerplay: add basic powerplay framework
Alex Deucher [Wed, 2 Dec 2015 22:46:21 +0000 (17:46 -0500)]
drm/amd/powerplay: add basic powerplay framework

BugLink: http://bugs.launchpad.net/bugs/1546572
amdgpu_pp_ip_funcs is introduced to handle the two code paths,
the legacy one and the new powerplay implementation.

CONFIG_DRM_AMD_POWERPLAY kernel configuration option is
introduced for the powerplay component.

v4: squash in fixes
v3: register debugfs file when powerplay module enable
v2: add amdgpu_ucode_init_bo in hw init when amdgpu_powerplay enable.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1f7371b2a5faf139465f0af386cccbb54b832534)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add new cgs interface to get display info (v2)
Rex Zhu [Thu, 17 Sep 2015 08:34:14 +0000 (16:34 +0800)]
drm/amdgpu: add new cgs interface to get display info (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
Add new CGS interfaces to query display info across modules.
This is nedded by the powerplay module for synchronizing with
the display module.

v2: (agd): fold in refresh rate fix, rebase

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 47bf18b5b257d5a385b7d447a29f97301f5b2282)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: implement cgs interface to query system info
Rex Zhu [Wed, 23 Sep 2015 12:11:54 +0000 (20:11 +0800)]
drm/amdgpu: implement cgs interface to query system info

BugLink: http://bugs.launchpad.net/bugs/1546572
Add a query to get the bus number and function of the
device.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit 5e6186991a75ea192d7dd88b9d3f7e166eaae801)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: implement new cgs interface for acpi function
Rex Zhu [Tue, 15 Sep 2015 06:44:44 +0000 (14:44 +0800)]
drm/amdgpu: implement new cgs interface for acpi function

BugLink: http://bugs.launchpad.net/bugs/1546572
Add a new driver internal interface for accessing ACPI
methods.  These will be used by various new components
including powerplay.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3f1d35a03b3cc7e0fb85c92f4ac6eafd1780d5dc)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: mv amdgpu_acpi.h to amd/include/amd_acpi.h
Rex Zhu [Fri, 18 Sep 2015 08:35:17 +0000 (16:35 +0800)]
drm/amdgpu: mv amdgpu_acpi.h to amd/include/amd_acpi.h

BugLink: http://bugs.launchpad.net/bugs/1546572
This will be shared with the new powerplay module.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 66dc0ddd02a1fdc6678e0b3ffcb257630462afaa)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: mv some definition from amdgpu_acpi.c to amdgpu_acpi.h
Rex Zhu [Mon, 21 Sep 2015 06:29:10 +0000 (14:29 +0800)]
drm/amdgpu: mv some definition from amdgpu_acpi.c to amdgpu_acpi.h

BugLink: http://bugs.launchpad.net/bugs/1546572
These will be shared with the new powerplay module.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7e85be994828b15014e4748e4b5eca015be6adce)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: share struct amdgpu_pm_state_type with powerplay module
Rex Zhu [Tue, 25 Aug 2015 07:57:43 +0000 (15:57 +0800)]
drm/amdgpu: share struct amdgpu_pm_state_type with powerplay module

BugLink: http://bugs.launchpad.net/bugs/1546572
rename amdgpu_pm_state_type to amd_pm_state_type

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3a2c788d95a24dc4cf720ddd19c1b115a03f41bf)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/radeon: fix dp link rate selection (v2)
Alex Deucher [Thu, 17 Dec 2015 15:23:34 +0000 (10:23 -0500)]
drm/radeon: fix dp link rate selection (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
Need to properly handle the max link rate in the dpcd.
This prevents some cases where 5.4 Ghz is selected when
it shouldn't be.

v2: simplify logic, add array bounds check

Reviewed-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 092c96a8ab9d1bd60ada2ed385cc364ce084180e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: fix dp link rate selection (v2)
Alex Deucher [Thu, 17 Dec 2015 14:57:49 +0000 (09:57 -0500)]
drm/amdgpu: fix dp link rate selection (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
Need to properly handle the max link rate in the dpcd.
This prevents some cases where 5.4 Ghz is selected when
it shouldn't be.

v2: simplify logic, add array bounds check

Reviewed-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 41869c1c7fe583dec932eb3d87de2e010b30a737)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/fb-helper: Use proper plane mask for fb cleanup
Matt Roper [Sat, 19 Dec 2015 01:27:01 +0000 (17:27 -0800)]
drm/fb-helper: Use proper plane mask for fb cleanup

BugLink: http://bugs.launchpad.net/bugs/1546572
pan_display_atomic() calls drm_atomic_clean_old_fb() to sanitize the
legacy FB fields (plane->fb and plane->old_fb).  However it was building
the plane mask to pass to this function incorrectly (the bitwise OR was
using plane indices rather than plane masks).  The end result was that
sometimes the legacy pointers would become out of sync with the atomic
pointers.  If another operation tried to re-set the same FB onto the
plane, we might end up with the pointers back in sync, but improper
reference counts, which would eventually lead to system crashes when we
accessed a pointer to a prematurely-destroyed FB.

The cause here was a very subtle bug introduced in commit:

        commit 07d3bad6c1210bd21e85d084807ef4ee4ac43a78
        Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
        Date:   Wed Nov 11 11:29:11 2015 +0100

            drm/core: Fix old_fb handling in pan_display_atomic.

I found the crashes were most easily reproduced (on i915 at least) by
starting X and then VT switching to a VT that wasn't running a console
instance...the sequence of vt/fbcon entries that happen in that case
trigger a reference count mismatch and crash the system.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93313
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 7118fd9bd975a9f3093239d4c0f4e15356b57fab)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/radeon: only increment sync_seq when a fence is really emitted
Nicolai Hähnle [Sat, 12 Dec 2015 16:42:25 +0000 (11:42 -0500)]
drm/radeon: only increment sync_seq when a fence is really emitted

BugLink: http://bugs.launchpad.net/bugs/1546572
In the rare situation where the kmalloc fails we're probably screwed anyway,
but let's try to be more robust about it.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Nicolai Hähnle <Nicolai.Haehnle@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b24c683af14bdc52b81899937ef2e52c15fe4768)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/radeon: Update radeon_get_vblank_counter_kms()
Thierry Reding [Wed, 16 Dec 2015 14:31:47 +0000 (15:31 +0100)]
drm/radeon: Update radeon_get_vblank_counter_kms()

BugLink: http://bugs.launchpad.net/bugs/1546572
Commit 88e72717c2de ("drm/irq: Use unsigned int pipe in public API")
updated the prototype of this function but not the implementation. This
wasn't noticed even through compile tests because the prototype is part
of the source file that uses it and hence the compiler won't know the
prototype when it compiles the implementation.

The right thing would've been to move the prototype to a header that's
included in radeon_kms.c so that the implementation signature could be
checked against it, but the closest thing would've been radeon_drv.h
and including that results in a lot of build errors, so we'll leave it
as is for now.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4e926d2db58244fca9845c78a5d6f873ac73795b)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: keep the PTs validation list in the VM v2
Christian König [Fri, 11 Dec 2015 20:01:23 +0000 (21:01 +0100)]
drm/amdgpu: keep the PTs validation list in the VM v2

BugLink: http://bugs.launchpad.net/bugs/1546572
This avoids allocating it on the fly.

v2: fix grammar in comment

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
(cherry picked from commit ee1782c3f27fec5462363af48f27811b049155ab)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: split VM PD and PT handling during CS
Christian König [Fri, 11 Dec 2015 14:16:32 +0000 (15:16 +0100)]
drm/amdgpu: split VM PD and PT handling during CS

BugLink: http://bugs.launchpad.net/bugs/1546572
This way we avoid the extra allocation for the page directory entry.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
(cherry picked from commit 56467ebfb254836dc30eb45d4ac8a46a400bfad6)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: put VM page tables directly into duplicates list
Christian König [Fri, 11 Dec 2015 13:39:05 +0000 (14:39 +0100)]
drm/amdgpu: put VM page tables directly into duplicates list

BugLink: http://bugs.launchpad.net/bugs/1546572
They share the reservation object with the page directory anyway.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
(cherry picked from commit 3c0eea6c35d932c4d25070868067dc9cd9ceab91)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: restrict the sched jobs number to power of two
Chunming Zhou [Thu, 10 Dec 2015 09:34:33 +0000 (17:34 +0800)]
drm/amdgpu: restrict the sched jobs number to power of two

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
CC: stable@vger.kernel.org
(cherry picked from commit 5b0112356cf9a735632b26ff5f3450e1716c8598)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: limit visible vram if it's smaller than the BAR
Alex Deucher [Wed, 9 Dec 2015 20:36:40 +0000 (15:36 -0500)]
drm/amdgpu: limit visible vram if it's smaller than the BAR

BugLink: http://bugs.launchpad.net/bugs/1546572
In some cases the amount of vram may be less than the BAR size,
if so, limit visible vram to the amount of actual vram, not the
BAR size.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a1493cd575678910f90d488069a8a2c41a144fda)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: change default sched jobs to 32
Chunming Zhou [Thu, 10 Dec 2015 07:46:50 +0000 (15:46 +0800)]
drm/amdgpu: change default sched jobs to 32

BugLink: http://bugs.launchpad.net/bugs/1546572
Change the default scheduler queue size from 16 to 32.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b70f014d58b976930b9e8337980954a958c01d7f)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: unify AMDGPU_CTX_MAX_CS_PENDING and amdgpu_sched_jobs
Chunming Zhou [Thu, 10 Dec 2015 07:45:11 +0000 (15:45 +0800)]
drm/amdgpu: unify AMDGPU_CTX_MAX_CS_PENDING and amdgpu_sched_jobs

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 37cd0ca204a55e123fca9ce411e6571ac49fa8f7)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: handle error case for ctx
Chunming Zhou [Thu, 10 Dec 2015 07:50:02 +0000 (15:50 +0800)]
drm/amdgpu: handle error case for ctx

BugLink: http://bugs.launchpad.net/bugs/1546572
Properly handle ctx init failure.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit c648ed7c5c7f0e3bb4ab11bf08bccf99b42a4cbb)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add entity only when first job come
Chunming Zhou [Fri, 11 Dec 2015 10:22:52 +0000 (18:22 +0800)]
drm/amdgpu: add entity only when first job come

BugLink: http://bugs.launchpad.net/bugs/1546572
umd somtimes will create a context for every ring,
that means some entities wouldn't be used at all.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e8deea2d4bb441751a4c1730495fa9810a208de5)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add more debugging output for driver failures
Alex Deucher [Mon, 7 Dec 2015 22:02:53 +0000 (17:02 -0500)]
drm/amdgpu: add more debugging output for driver failures

BugLink: http://bugs.launchpad.net/bugs/1546572
Add more fine grained debugging output for init/fini/suspend/
resume failures.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2c1a27840394428d8f44fe5d7509dd20574d0573)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: update rev id register for VI
Flora Cui [Fri, 20 Nov 2015 03:40:53 +0000 (11:40 +0800)]
drm/amdgpu: update rev id register for VI

BugLink: http://bugs.launchpad.net/bugs/1546572
Change-Id: I2ae9bb4a929f7c0c8783e0be563ae04be77596e2
Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit abdfb850ca99a27557564e4fcf4b137e209ebfef)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/gfx8: update PA_SC_RASTER_CONFIG:PKR_MAP only
Flora Cui [Tue, 8 Dec 2015 03:23:29 +0000 (11:23 +0800)]
drm/amdgpu/gfx8: update PA_SC_RASTER_CONFIG:PKR_MAP only

BugLink: http://bugs.launchpad.net/bugs/1546572
Use default value as a base.

Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit c27816a883575037ec67e7f92fbd214648a1c1cb)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu/gfx8: Enable interrupt on ME1_PIPE3
Flora Cui [Wed, 2 Dec 2015 01:56:06 +0000 (09:56 +0800)]
drm/amdgpu/gfx8: Enable interrupt on ME1_PIPE3

BugLink: http://bugs.launchpad.net/bugs/1546572
Otherwise FW cannot see the RLC ACK for the memory clean request
It's for Stoney.

Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
(cherry picked from commit 3b55ddadef631d8081cb2f73c6c7cb80c634ba2b)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd: abstract kernel rq and normal rq to priority of run queue
Chunming Zhou [Thu, 5 Nov 2015 07:23:09 +0000 (15:23 +0800)]
drm/amd: abstract kernel rq and normal rq to priority of run queue

BugLink: http://bugs.launchpad.net/bugs/1546572
Allows us to set priorities in the scheduler.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
(cherry picked from commit d033a6de80054139b4358db12cf6bb8d6cf58853)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add EDC support for CZ (v3)
Alex Deucher [Tue, 24 Nov 2015 22:43:42 +0000 (17:43 -0500)]
drm/amdgpu: add EDC support for CZ (v3)

BugLink: http://bugs.launchpad.net/bugs/1546572
This adds EDC support for CZ.
EDC = Error Correction and Detection
This code properly initializes the EDC hardware and
resets the error counts.  This is done in late_init
since it requires the IB pool which is not initialized
during hw_init.

v2: fix the IB size as noted by Felix, fix shader pgm
register programming
v3: use the IB for the shaders as suggested by Christian

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit ccba7691a580a0967f60a512473ce699b9edac0d)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amd: add new gfx8 register definitions for EDC
Alex Deucher [Tue, 24 Nov 2015 22:42:02 +0000 (17:42 -0500)]
drm/amd: add new gfx8 register definitions for EDC

BugLink: http://bugs.launchpad.net/bugs/1546572
EDC is a RAS feature for on chip memory.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit aa5e24e5f8a83b19b1b19964f35562c7a42636e2)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/radeon: Use unlocked gem unreferencing
Daniel Vetter [Mon, 23 Nov 2015 09:32:38 +0000 (10:32 +0100)]
drm/radeon: Use unlocked gem unreferencing

BugLink: http://bugs.launchpad.net/bugs/1546572
For drm_gem_object_unreference callers are required to hold
dev->struct_mutex, which these paths don't. Enforcing this requirement
has become a bit more strict with

commit ef4c6270bf2867e2f8032e9614d1a8cfc6c71663
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Oct 15 09:36:25 2015 +0200

    drm/gem: Check locking in drm_gem_object_unreference

Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 623fc3b7bdbfd64536576f71f87652385d4d88fc)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: Use unlocked gem unreferencing
Daniel Vetter [Mon, 23 Nov 2015 09:32:37 +0000 (10:32 +0100)]
drm/amdgpu: Use unlocked gem unreferencing

BugLink: http://bugs.launchpad.net/bugs/1546572
For drm_gem_object_unreference callers are required to hold
dev->struct_mutex, which these paths don't. Enforcing this requirement
has become a bit more strict with

commit ef4c6270bf2867e2f8032e9614d1a8cfc6c71663
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Oct 15 09:36:25 2015 +0200

    drm/gem: Check locking in drm_gem_object_unreference

Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a9906fde57b690c5e606daf8c5994850a5abfc84)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: Use new read bios from rom callback
monk.liu [Thu, 29 Oct 2015 07:33:06 +0000 (15:33 +0800)]
drm/amdgpu: Use new read bios from rom callback

BugLink: http://bugs.launchpad.net/bugs/1546572
Read the vbios directly from the rom.  In some cases,
e.g., virtualization, the rom is not available via
the BAR or other means.  Access it directly.

This is an updated version of Monks original patch which
uses family specific callbacks and unifies some of the
validation checking.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f930b2e8628f4e6e818ea69a426a2b732679e15b)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add read_bios_from_rom callback for VI parts
Alex Deucher [Tue, 24 Nov 2015 15:37:54 +0000 (10:37 -0500)]
drm/amdgpu: add read_bios_from_rom callback for VI parts

BugLink: http://bugs.launchpad.net/bugs/1546572
Read the vbios image directly from the rom.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 95addb2ae06f46cd13346ed87bbda3990438a69b)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add read_bios_from_rom callback for CI parts
Alex Deucher [Tue, 24 Nov 2015 15:34:45 +0000 (10:34 -0500)]
drm/amdgpu: add read_bios_from_rom callback for CI parts

BugLink: http://bugs.launchpad.net/bugs/1546572
Read the vbios image directly from the rom.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1eb22bd38ac58a1be6e7e0ae6dd4ab6d604a27d6)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: add a callback for reading the bios from the rom directly
Alex Deucher [Tue, 24 Nov 2015 15:14:28 +0000 (10:14 -0500)]
drm/amdgpu: add a callback for reading the bios from the rom directly

BugLink: http://bugs.launchpad.net/bugs/1546572
This is necessary when the vbios image is not directly accessible via
the rom BAR or legacy vga location.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7946b878038d5113262d6eae09ff22fb2956351f)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/radeon: constify radeon_asic_ring structures
Julia Lawall [Sun, 29 Nov 2015 16:12:41 +0000 (17:12 +0100)]
drm/radeon: constify radeon_asic_ring structures

BugLink: http://bugs.launchpad.net/bugs/1546572
The radeon_asic_ring structures are never modified, so declare them as
const.

Done with the help of Coccinelle.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d26678da532401bd9227c8d79e902e59439b0140)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agodrm/amdgpu: use $(src) in Makefile (v2)
Jammy Zhou [Tue, 24 Nov 2015 08:55:20 +0000 (16:55 +0800)]
drm/amdgpu: use $(src) in Makefile (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572
This can solve the path problem when compile amdgpu with DKMS.

v2: agd: rebase on current drm-next

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 288912cb95d156ad9fbb626b0b05d714c2ec8c8e)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Config] CONFIG_DRM_AMD_POWERPLAY=y
Alberto Milone [Mon, 29 Feb 2016 16:39:21 +0000 (17:39 +0100)]
UBUNTU: [Config] CONFIG_DRM_AMD_POWERPLAY=y

BugLink: http://bugs.launchpad.net/bugs/1546572
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx4_core: Set UAR page size to 4KB regardless of system page size
Huy Nguyen [Wed, 17 Feb 2016 15:24:26 +0000 (17:24 +0200)]
net/mlx4_core: Set UAR page size to 4KB regardless of system page size

BugLink: http://bugs.launchpad.net/bugs/1552632
problem description:

The current code sets UAR page size equal to system page size.
The ConnectX-3 and ConnectX-3 Pro HWs require minimum 128 UAR pages.
The mlx4 kernel drivers are not loaded if there is less than 128 UAR pages.

solution:

Always set UAR page to 4KB. This allows more UAR pages if the OS
has PAGE_SIZE larger than 4KB. For example, PowerPC kernel use 64KB
system page size, with 4MB uar region, there are 4MB/2/64KB = 32
uars (half for uar, half for blueflame). This does not meet minimum 128
UAR pages requirement. With 4KB UAR page, there are 4MB/2/4KB = 512 uars
which meet the minimum requirement.

Note that only codes in mlx4_core that deal with firmware know that uar
page size is 4KB. Codes that deal with usr page in cq and qp context
(mlx4_ib, mlx4_en and part of mlx4_core) still have the same assumption
that uar page size equals to system page size.

Note that with this implementation, on 64KB system page size kernel, there
are 16 uars per system page but only one uars is used. The other 15
uars are ignored because of the above assumption.

Regarding SR-IOV, mlx4_core in hypervisor will set the uar page size
to 4KB and mlx4_core code in virtual OS will obtain the uar page size from
firmware.

Regarding backward compatibility in SR-IOV, if hypervisor has this new code,
the virtual OS must be updated. If hypervisor has old code, and the virtual
OS has this new code, the new code will be backward compatible with the
old code. If the uar size is big enough, this new code in VF continues to
work with 64 KB uar page size (on PowerPc kernel). If the uar size does not
meet 128 uars requirement, this new code not loaded in VF and print the same
error message as the old code in Hypervisor.

Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 85743f1eb34548ba4b056d2f184a3d107a3b8917)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: Start new release
Tim Gardner [Mon, 7 Mar 2016 12:04:56 +0000 (05:04 -0700)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: Ubuntu-4.4.0-11.26
Tim Gardner [Fri, 4 Mar 2016 22:36:35 +0000 (15:36 -0700)]
UBUNTU: Ubuntu-4.4.0-11.26

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoLinux 4.4.4
Greg Kroah-Hartman [Thu, 3 Mar 2016 23:10:04 +0000 (15:10 -0800)]
Linux 4.4.4

BugLink: http://bugs.launchpad.net/bugs/1553179
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agobcache: prevent crash on changing writeback_running
Stefan Bader [Mon, 30 Nov 2015 02:44:49 +0000 (18:44 -0800)]
bcache: prevent crash on changing writeback_running

BugLink: http://bugs.launchpad.net/bugs/1553179
commit 8d16ce540c94c9d366eb36fc91b7154d92d6397b upstream.

Added a safeguard in the shutdown case. At least while not being
attached it is also possible to trigger a kernel bug by writing into
writeback_running. This change  adds the same check before trying to
wake up the thread for that case.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoRevert "UBUNTU: SAUCE: bcache: prevent crash on changing writeback_running"
Tim Gardner [Fri, 4 Mar 2016 12:55:27 +0000 (05:55 -0700)]
Revert "UBUNTU: SAUCE: bcache: prevent crash on changing writeback_running"

BugLink: http://bugs.launchpad.net/bugs/1553179
This reverts commit 6ac65b6e19d2d6f6e0b093ea0c039ca3116f8617.

Revert in favor of upstream stable.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoiwlwifi: mvm: don't allow sched scans without matches to be started
Luca Coelho [Tue, 2 Feb 2016 13:11:15 +0000 (15:11 +0200)]
iwlwifi: mvm: don't allow sched scans without matches to be started

BugLink: http://bugs.launchpad.net/bugs/1553179
commit 5e56276e7555b34550d51459a801ff75eca8b907 upstream.

The firmware can perform a scheduled scan with not matchsets passed,
but it can't send notification that results were found.  Since the
userspace then cannot know when we got new results and the firmware
wouldn't trigger a wake in case we are sleeping, it's better not to
allow scans without matchsets.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=110831

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoiwlwifi: update and fix 7265 series PCI IDs
Oren Givon [Thu, 17 Dec 2015 12:17:00 +0000 (14:17 +0200)]
iwlwifi: update and fix 7265 series PCI IDs

BugLink: http://bugs.launchpad.net/bugs/1553179
commit 006bda75d81fd27a583a3b310e9444fea2aa6ef2 upstream.

Update and fix some 7265 PCI IDs entries.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoiwlwifi: pcie: properly configure the debug buffer size for 8000
Emmanuel Grumbach [Tue, 5 Jan 2016 13:25:43 +0000 (15:25 +0200)]
iwlwifi: pcie: properly configure the debug buffer size for 8000

BugLink: http://bugs.launchpad.net/bugs/1553179
commit 62d7476d958ce06d7a10b02bdb30006870286fe2 upstream.

8000 device family has a new debug engine that needs to be
configured differently than 7000's.
The debug engine's DMA works in chunks of memory and the
size of the buffer really means the start of the last
chunk. Since one chunk is 256-byte long, we should
configure the device to write to buffer_size - 256.
This fixes a situation were the device would write to
memory it is not allowed to access.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoiwlwifi: dvm: fix WoWLAN
Emmanuel Grumbach [Sun, 20 Dec 2015 06:45:40 +0000 (08:45 +0200)]
iwlwifi: dvm: fix WoWLAN

BugLink: http://bugs.launchpad.net/bugs/1553179
commit a1cdb1c59c8c203de2731fc6910598ed19c97e41 upstream.

My commit below introduced a mutex in the transport to
prevent concurrent operations. To do so, it added a flag
(is_down) to make sure the transport is in the right state.
This uncoverred an bug that didn't cause any harm until
now: iwldvm calls stop_device and then starts the firmware
without calling start_hw in between. While this flow is
fine from the device configuration point of view (register,
etc...), it is now forbidden by the new is_down flag.
This led to this error to appear:
iwlwifi 0000:05:00.0: Can't start_fw since the HW hasn't been started
and the suspend would fail.

This fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=109591

Reported-by: Bogdan Bogush <bogdan.s.bogush@gmail.com>
Fixes=fa9f3281cbb1 ("iwlwifi: pcie: lock start_hw / start_fw / stop_device")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoIB/cma: Fix RDMA port validation for iWarp
Matan Barak [Thu, 7 Jan 2016 09:19:29 +0000 (11:19 +0200)]
IB/cma: Fix RDMA port validation for iWarp

BugLink: http://bugs.launchpad.net/bugs/1553179
commit 649367735ee5dedb128d9fac0b86ba7e0fe7ae3b upstream.

cma_validate_port wrongly assumed that Ethernet devices are RoCE
devices and thus their ndev should be matched in the GID table.
This broke the iWarp support. Fixing that matching the ndev only if
we work on a RoCE port.

Cc: <stable@vger.kernel.org> # 4.4.x-
Fixes: abae1b71dd37 ('IB/cma: cma_validate_port should verify the port
     and netdevice')
Reported-by: Hariprasad Shenai <hariprasad@chelsio.com>
Tested-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>