Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/radeon: add bapm module parameter

Add a module paramter to enable bapm on APUs. It's disabled
by default on certain APUs due to stability issues. This
option makes it easier to test and to enable it on systems that
are stable.

bug:
https://bugzilla.kernel.org/show_bug.cgi?id=81021

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org

+24 -10
+4 -1
drivers/gpu/drm/radeon/kv_dpm.c
··· 2726 2726 pi->caps_sclk_ds = true; 2727 2727 pi->enable_auto_thermal_throttling = true; 2728 2728 pi->disable_nb_ps3_in_battery = false; 2729 - pi->bapm_enable = true; 2729 + if (radeon_bapm == 0) 2730 + pi->bapm_enable = false; 2731 + else 2732 + pi->bapm_enable = true; 2730 2733 pi->voltage_drop_t = 0; 2731 2734 pi->caps_sclk_throttle_low_notification = false; 2732 2735 pi->caps_fps = false; /* true? */
+1
drivers/gpu/drm/radeon/radeon.h
··· 105 105 extern int radeon_vm_block_size; 106 106 extern int radeon_deep_color; 107 107 extern int radeon_use_pflipirq; 108 + extern int radeon_bapm; 108 109 109 110 /* 110 111 * Copy from radeon_drv.h so we don't have to include both and have conflicting
+4
drivers/gpu/drm/radeon/radeon_drv.c
··· 180 180 int radeon_vm_block_size = -1; 181 181 int radeon_deep_color = 0; 182 182 int radeon_use_pflipirq = 2; 183 + int radeon_bapm = -1; 183 184 184 185 MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers"); 185 186 module_param_named(no_wb, radeon_no_wb, int, 0444); ··· 259 258 260 259 MODULE_PARM_DESC(use_pflipirq, "Pflip irqs for pageflip completion (0 = disable, 1 = as fallback, 2 = exclusive (default))"); 261 260 module_param_named(use_pflipirq, radeon_use_pflipirq, int, 0444); 261 + 262 + MODULE_PARM_DESC(bapm, "BAPM support (1 = enable, 0 = disable, -1 = auto)"); 263 + module_param_named(bapm, radeon_bapm, int, 0444); 262 264 263 265 static struct pci_device_id pciidlist[] = { 264 266 radeon_PCI_IDS
+15 -9
drivers/gpu/drm/radeon/trinity_dpm.c
··· 1874 1874 for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) 1875 1875 pi->at[i] = TRINITY_AT_DFLT; 1876 1876 1877 - /* There are stability issues reported on with 1878 - * bapm enabled when switching between AC and battery 1879 - * power. At the same time, some MSI boards hang 1880 - * if it's not enabled and dpm is enabled. Just enable 1881 - * it for MSI boards right now. 1882 - */ 1883 - if (rdev->pdev->subsystem_vendor == 0x1462) 1884 - pi->enable_bapm = true; 1885 - else 1877 + if (radeon_bapm == -1) { 1878 + /* There are stability issues reported on with 1879 + * bapm enabled when switching between AC and battery 1880 + * power. At the same time, some MSI boards hang 1881 + * if it's not enabled and dpm is enabled. Just enable 1882 + * it for MSI boards right now. 1883 + */ 1884 + if (rdev->pdev->subsystem_vendor == 0x1462) 1885 + pi->enable_bapm = true; 1886 + else 1887 + pi->enable_bapm = false; 1888 + } else if (radeon_bapm == 0) { 1886 1889 pi->enable_bapm = false; 1890 + } else { 1891 + pi->enable_bapm = true; 1892 + } 1887 1893 pi->enable_nbps_policy = true; 1888 1894 pi->enable_sclk_ds = true; 1889 1895 pi->enable_gfx_power_gating = true;