Skip to contentSkip to conversation

drm/amd: Add debug mask for subviewport mclk switch

PATCH In review Aurabindo Pillai 4 participants 8 messages Jun 28, 2022 – Jul 5, 2022

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

PATCH 1/1 drm/amd: Add debug mask for subviewport mclk switch

[Why&How]
Expose a new debugfs enum to force a subviewport memory clock switch to facilitate easy testing.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
 drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
index c9145864ed2b..7a034ca95be2 100644
@@ -1559,6 +1559,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 	if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
 		adev->dm.dc->debug.disable_clock_gate = true;
 
+	if (amdgpu_dc_debug_mask & DC_FORCE_SUBVP_MCLK_SWITCH)
+		adev->dm.dc->debug.force_subvp_mclk_switch = true;
+
 	r = dm_dmub_hw_init(adev);
 	if (r) {
 		DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
index bcdf7453a403..b1c55dd7b498 100644
@@ -247,6 +247,7 @@ enum DC_DEBUG_MASK {
 	DC_DISABLE_DSC = 0x4,
 	DC_DISABLE_CLOCK_GATING = 0x8,
 	DC_DISABLE_PSR = 0x10,
+	DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
 };
 
 enum amd_dpm_forced_level;
Signature · 1 line
2.36.1
#1 lore raw

Ping

Quoted 36 lines · Aurabindo Pillai

[Why&How]
Expose a new debugfs enum to force a subviewport memory clock switch to facilitate easy testing.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
  drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
  2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
index c9145864ed2b..7a034ca95be2 100644
@@ -1559,6 +1559,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
  	if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
  		adev->dm.dc->debug.disable_clock_gate = true;
 
+	if (amdgpu_dc_debug_mask & DC_FORCE_SUBVP_MCLK_SWITCH)
+		adev->dm.dc->debug.force_subvp_mclk_switch = true;
+
  	r = dm_dmub_hw_init(adev);
  	if (r) {
  		DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
index bcdf7453a403..b1c55dd7b498 100644
@@ -247,6 +247,7 @@ enum DC_DEBUG_MASK {
  	DC_DISABLE_DSC = 0x4,
  	DC_DISABLE_CLOCK_GATING = 0x8,
  	DC_DISABLE_PSR = 0x10,
+	DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
  };
 
  enum amd_dpm_forced_level;
#2 lore raw
In reply to Aurabindo Pillai
Quoted 5 lines · Aurabindo Pillai

[Why&How]
Expose a new debugfs enum to force a subviewport memory clock switch to facilitate easy testing.

Is the debugfs support already plumbed in and this just enables you to use it? If it's in debugfs, do we really need a module parameter to enable it or can it just be enabled by default and used via debugfs when needed?

Alex

Quoted 35 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
 drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
index c9145864ed2b..7a034ca95be2 100644
@@ -1559,6 +1559,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
        if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
                adev->dm.dc->debug.disable_clock_gate = true;
 
+       if (amdgpu_dc_debug_mask & DC_FORCE_SUBVP_MCLK_SWITCH)
+               adev->dm.dc->debug.force_subvp_mclk_switch = true;
+
        r = dm_dmub_hw_init(adev);
        if (r) {
                DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
drivers/gpu/drm/amd/include/amd_shared.h +1 -1
index bcdf7453a403..b1c55dd7b498 100644
@@ -247,6 +247,7 @@ enum DC_DEBUG_MASK {
        DC_DISABLE_DSC = 0x4,
        DC_DISABLE_CLOCK_GATING = 0x8,
        DC_DISABLE_PSR = 0x10,
+       DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
 };
 
 enum amd_dpm_forced_level;
--

2.36.1

#3 lore raw
Quoted 8 lines · Alex Deucher
Quoted 5 lines · Aurabindo Pillai

[Why&How]
Expose a new debugfs enum to force a subviewport memory clock switch to facilitate easy testing.

Quoted 4 lines

Is the debugfs support already plumbed in and this just enables you to use it? If it's in debugfs, do we really need a module parameter to enable it or can it just be enabled by default and used via debugfs when needed?

Sorry, I meant to put in debug mask, like in the title. Will fix that. There is no debugfs associated with this change. The change in DM is enough to enable this.

Quoted 38 lines

Alex

Quoted 35 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
  drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
  2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
index c9145864ed2b..7a034ca95be2 100644
@@ -1559,6 +1559,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
         if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
                 adev->dm.dc->debug.disable_clock_gate = true;
 
+       if (amdgpu_dc_debug_mask & DC_FORCE_SUBVP_MCLK_SWITCH)
+               adev->dm.dc->debug.force_subvp_mclk_switch = true;
+
         r = dm_dmub_hw_init(adev);
         if (r) {
                 DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
drivers/gpu/drm/amd/include/amd_shared.h +1 -1
index bcdf7453a403..b1c55dd7b498 100644
@@ -247,6 +247,7 @@ enum DC_DEBUG_MASK {
         DC_DISABLE_DSC = 0x4,
         DC_DISABLE_CLOCK_GATING = 0x8,
         DC_DISABLE_PSR = 0x10,
+       DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
  };
 
  enum amd_dpm_forced_level;
--

2.36.1

Acked-by
#4 lore raw
Quoted 12 lines · Aurabindo Pillai
Quoted 8 lines · Alex Deucher
Quoted 5 lines · Aurabindo Pillai

[Why&How]
Expose a new debugfs enum to force a subviewport memory clock switch to facilitate easy testing.

Quoted 9 lines
Quoted 4 lines

Is the debugfs support already plumbed in and this just enables you to use it? If it's in debugfs, do we really need a module parameter to enable it or can it just be enabled by default and used via debugfs when needed?

Sorry, I meant to put in debug mask, like in the title. Will fix that. There is no debugfs associated with this change. The change in DM is enough to enable this.

Quoted 1 line

Thanks. With that fixed,

Quoted 37 lines
Quoted 37 lines

Alex

Quoted 35 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
  drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
  2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
index c9145864ed2b..7a034ca95be2 100644
@@ -1559,6 +1559,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
         if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
                 adev->dm.dc->debug.disable_clock_gate = true;
 
+       if (amdgpu_dc_debug_mask & DC_FORCE_SUBVP_MCLK_SWITCH)
+               adev->dm.dc->debug.force_subvp_mclk_switch = true;
+
         r = dm_dmub_hw_init(adev);
         if (r) {
                 DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
drivers/gpu/drm/amd/include/amd_shared.h +1 -1
index bcdf7453a403..b1c55dd7b498 100644
@@ -247,6 +247,7 @@ enum DC_DEBUG_MASK {
         DC_DISABLE_DSC = 0x4,
         DC_DISABLE_CLOCK_GATING = 0x8,
         DC_DISABLE_PSR = 0x10,
+       DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
  };
 
  enum amd_dpm_forced_level;
--

2.36.1

maintainer Reviewed-by on v1 1/1
#5 lore raw
In reply to Aurabindo Pillai
Quoted 4 lines · Aurabindo Pillai

[Why&How]
Expose a new debugfs enum to force a subviewport memory clock switch to facilitate easy testing.

Does this force a single switch? Or at regular intervals?

It would be useful to describe a bit better what it does.

Quoted 1 line

Either way, since this is for debug purposes only this is

Harry

Quoted 31 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
 drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
index c9145864ed2b..7a034ca95be2 100644
@@ -1559,6 +1559,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 	if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
 		adev->dm.dc->debug.disable_clock_gate = true;
 
+	if (amdgpu_dc_debug_mask & DC_FORCE_SUBVP_MCLK_SWITCH)
+		adev->dm.dc->debug.force_subvp_mclk_switch = true;
+
 	r = dm_dmub_hw_init(adev);
 	if (r) {
 		DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
index bcdf7453a403..b1c55dd7b498 100644
@@ -247,6 +247,7 @@ enum DC_DEBUG_MASK {
 	DC_DISABLE_DSC = 0x4,
 	DC_DISABLE_CLOCK_GATING = 0x8,
 	DC_DISABLE_PSR = 0x10,
+	DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
 };
 
 enum amd_dpm_forced_level;
#6 lore raw
Quoted 9 lines · Harry Wentland
Quoted 4 lines · Aurabindo Pillai

[Why&How]
Expose a new debugfs enum to force a subviewport memory clock switch to facilitate easy testing.

Does this force a single switch? Or at regular intervals?

If this debug option is set, each time a MCLK switch happens, a SubVP sequences shall be initiated. That is, during the MCLK switch the scanout shall be from the Subviewport memory. Setting this option doesnt trigger an MCLK switch though.

Quoted 2 lines

It would be useful to describe a bit better what it does.

Will keep that in mind, thanks! Unfortunately I merged it already since I got the ack last week.

Quoted 40 lines
Quoted 2 lines

Either way, since this is for debug purposes only this is

Harry

Quoted 31 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
  drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
  2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
index c9145864ed2b..7a034ca95be2 100644
@@ -1559,6 +1559,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
  	if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
  		adev->dm.dc->debug.disable_clock_gate = true;
 
+	if (amdgpu_dc_debug_mask & DC_FORCE_SUBVP_MCLK_SWITCH)
+		adev->dm.dc->debug.force_subvp_mclk_switch = true;
+
  	r = dm_dmub_hw_init(adev);
  	if (r) {
  		DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
index bcdf7453a403..b1c55dd7b498 100644
@@ -247,6 +247,7 @@ enum DC_DEBUG_MASK {
  	DC_DISABLE_DSC = 0x4,
  	DC_DISABLE_CLOCK_GATING = 0x8,
  	DC_DISABLE_PSR = 0x10,
+	DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
  };
 
  enum amd_dpm_forced_level;
#7 lore raw
Quoted 13 lines · Aurabindo Pillai
Quoted 9 lines · Harry Wentland
Quoted 4 lines · Aurabindo Pillai

[Why&How]
Expose a new debugfs enum to force a subviewport memory clock switch to facilitate easy testing.

Does this force a single switch? Or at regular intervals?

Quoted 7 lines

If this debug option is set, each time a MCLK switch happens, a SubVP sequences shall be initiated. That is, during the MCLK switch the scanout shall be from the Subviewport memory. Setting this option doesnt trigger an MCLK switch though.

Quoted 2 lines

It would be useful to describe a bit better what it does.

Will keep that in mind, thanks! Unfortunately I merged it already since I got the ack last week. No worries :)

Harry

Quoted 38 lines
Quoted 38 lines
Quoted 2 lines

Either way, since this is for debug purposes only this is

Harry

Quoted 29 lines

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ drivers/gpu/drm/amd/include/amd_shared.h          | 1 +

  2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
index c9145864ed2b..7a034ca95be2 100644
@@ -1559,6 +1559,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
       if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
           adev->dm.dc->debug.disable_clock_gate = true;
   +    if (amdgpu_dc_debug_mask & DC_FORCE_SUBVP_MCLK_SWITCH)
+        adev->dm.dc->debug.force_subvp_mclk_switch = true;
+
       r = dm_dmub_hw_init(adev);
       if (r) {
           DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
index bcdf7453a403..b1c55dd7b498 100644
@@ -247,6 +247,7 @@ enum DC_DEBUG_MASK {
       DC_DISABLE_DSC = 0x4,
       DC_DISABLE_CLOCK_GATING = 0x8,
       DC_DISABLE_PSR = 0x10,
+    DC_FORCE_SUBVP_MCLK_SWITCH = 0x20,
   };
     enum amd_dpm_forced_level;