Commit 4d6fc55a authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: expand runpm parameter

Allow the user to specify -2 as auto enabled with displays.

By default we don't enter runtime suspend when there are
displays attached because it does not work well in some
desktop environments due to the driver sending hotplug
events on resume in case any new displays were attached
while the GPU was powered down.  Some users still want
this functionality though, so this lets you enable it.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2428Reviewed-by: default avatarGuchun Chen <guchun.chen@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 47f1724d
...@@ -347,8 +347,9 @@ module_param_named(aspm, amdgpu_aspm, int, 0444); ...@@ -347,8 +347,9 @@ module_param_named(aspm, amdgpu_aspm, int, 0444);
* Override for runtime power management control for dGPUs. The amdgpu driver can dynamically power down * Override for runtime power management control for dGPUs. The amdgpu driver can dynamically power down
* the dGPUs when they are idle if supported. The default is -1 (auto enable). * the dGPUs when they are idle if supported. The default is -1 (auto enable).
* Setting the value to 0 disables this functionality. * Setting the value to 0 disables this functionality.
* Setting the value to -2 is auto enabled with power down when displays are attached.
*/ */
MODULE_PARM_DESC(runpm, "PX runtime pm (2 = force enable with BAMACO, 1 = force enable with BACO, 0 = disable, -1 = auto)"); MODULE_PARM_DESC(runpm, "PX runtime pm (2 = force enable with BAMACO, 1 = force enable with BACO, 0 = disable, -1 = auto, -2 = autowith displays)");
module_param_named(runpm, amdgpu_runtime_pm, int, 0444); module_param_named(runpm, amdgpu_runtime_pm, int, 0444);
/** /**
...@@ -2496,6 +2497,7 @@ static int amdgpu_runtime_idle_check_display(struct device *dev) ...@@ -2496,6 +2497,7 @@ static int amdgpu_runtime_idle_check_display(struct device *dev)
struct drm_connector_list_iter iter; struct drm_connector_list_iter iter;
int ret = 0; int ret = 0;
if (amdgpu_runtime_pm != -2) {
/* XXX: Return busy if any displays are connected to avoid /* XXX: Return busy if any displays are connected to avoid
* possible display wakeups after runtime resume due to * possible display wakeups after runtime resume due to
* hotplug events in case any displays were connected while * hotplug events in case any displays were connected while
...@@ -2514,6 +2516,7 @@ static int amdgpu_runtime_idle_check_display(struct device *dev) ...@@ -2514,6 +2516,7 @@ static int amdgpu_runtime_idle_check_display(struct device *dev)
if (ret) if (ret)
return ret; return ret;
}
if (adev->dc_enabled) { if (adev->dc_enabled) {
struct drm_crtc *crtc; struct drm_crtc *crtc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment