Skip to contentSkip to conversation

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

PATCH In review Aurabindo Pillai 2 participants 2 messages Oct 15, 2024 – Oct 16, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

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.

---
 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(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -0
index c5487bb7c6b8..bb0e9deebcc5 100644
@@ -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 */
drivers/gpu/drm/amd/include/amd_shared.h +5 -0
index 7eefcb0f5070..fba3f2f1327e 100644
@@ -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;
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Aurabindo Pillai

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.

---
  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(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index c5487bb7c6b8..bb0e9deebcc5 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 2017

Quoted 6 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
@@ -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;
+	}

Drop the braces around the single statement, with that change:

Quoted 20 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
+
  	adev->dm.dc->debug.visual_confirm = amdgpu_dc_visual_confirm;
 
  	/* TODO: Remove after DP2 receiver gets proper support of Cable ID feature */
drivers/gpu/drm/amd/include/amd_shared.h +5 -0
index 7eefcb0f5070..fba3f2f1327e 100644
@@ -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;