[PATCH] drm/amd/display: Add debug option to disable idle optimizations

Aurabindo Pillai aurabindo.pillai at amd.com
Tue Oct 15 17:41:09 UTC 2024


For debugging purposes, add a runtime override to disable display scanout
from MALL cache (MALL Static Screen) by disallowing the driver from
triggering the idle power optimizations when desktop is idle.

Signed-off-by: Aurabindo Pillai <aurabindo.pillai at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++
 drivers/gpu/drm/amd/include/amd_shared.h          | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index c5487bb7c6b8..bb0e9deebcc5 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2012,6 +2012,10 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 		adev->dm.dc->debug.using_dml21 = true;
 	}
 
+	if (amdgpu_dc_debug_mask & DC_DISABLE_IDLE_POWER_OPTIMIZATIONS) {
+		adev->dm.dc->debug.disable_idle_power_optimizations = true;
+	}
+
 	adev->dm.dc->debug.visual_confirm = amdgpu_dc_visual_confirm;
 
 	/* TODO: Remove after DP2 receiver gets proper support of Cable ID feature */
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index 7eefcb0f5070..fba3f2f1327e 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -344,6 +344,11 @@ enum DC_DEBUG_MASK {
 	 * eDP display from ACPI _DDC method.
 	 */
 	DC_DISABLE_ACPI_EDID = 0x8000,
+	/**
+	 * @DC_DISABLE_IDLE_POWER_OPTIMISATION: Disables certain power
+	 * optimizations when desktop is in idle state
+	 */
+	DC_DISABLE_IDLE_POWER_OPTIMIZATIONS = 0x10000,
 };
 
 enum amd_dpm_forced_level;
-- 
2.39.5



More information about the amd-gfx mailing list