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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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:
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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.
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
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>