drm/amd/display: Disable ips before dc interrupt setting
Subsystems (3)
PATCH 1/3 drm/amd/display: Disable ips before dc interrupt setting
From: Roman Li <[email protected]>
[Why]
While in IPS2 an access to dcn registers is not allowed. If interrupt results in dc call, we should disable IPS.
[How]
Safeguard register access in IPS2 by disabling idle optimization before calling dc interrupt setting api.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +4 -1
@@ -711,7 +711,7 @@ static inline int dm_irq_state(struct amdgpu_device *adev, {bool st;enum dc_irq_source irq_source; - +struct dc *dc = adev->dm.dc;struct amdgpu_crtc *acrtc = adev->mode_info.crtcs[crtc_id];if (!acrtc) {
@@ -729,6 +729,9 @@ static inline int dm_irq_state(struct amdgpu_device *adev, st = (state ==AMDGPU_IRQ_STATE_ENABLE ); +if (dc && dc->caps.ips_support && dc->idle_optimizations_allowed) +dc_allow_idle_optimizations (dc, false); +dc_interrupt_set (adev->dm.dc, irq_source, st);return 0 ; }
Signature · 1 line
2.34.1
PATCH 2/3 drm/amd: Add a DC debug mask for IPS
From: Roman Li <[email protected]>
For debugging IPS-related issues, expose a new debug mask that allows to disable IPS.
Usage:
amdgpu.dcdebugmask=0x800
--- drivers/gpu/drm/amd/include/amd_shared.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
@@ -259,6 +259,7 @@ enum DC_DEBUG_MASK {DC_ENABLE_DML2 =0x100 ,DC_DISABLE_PSR_SU =0x200 ,DC_DISABLE_REPLAY =0x400 , + DC_DISABLE_IPS = 0x800, };enum amd_dpm_forced_level ;
Signature · 1 line
2.34.1
Re: [PATCH 2/3] drm/amd: Add a DC debug mask for IPS
Quoted 9 lines · On 1/24/2024 11:09, [email protected] wrote:
From: Roman Li <[email protected]>
For debugging IPS-related issues, expose a new debug mask that allows to disable IPS.
Usage:
amdgpu.dcdebugmask=0x800Signed-off-by Roman Li <[email protected]>Tested-by Mark Broadworth <[email protected]>
Quoted 16 lines
--- drivers/gpu/drm/amd/include/amd_shared.h | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/include/amd_shared.h +1
-0@@ -259,6 +259,7 @@ enum DC_DEBUG_MASK {DC_ENABLE_DML2 =0x100 ,DC_DISABLE_PSR_SU =0x200 ,DC_DISABLE_REPLAY =0x400 , + DC_DISABLE_IPS = 0x800, };enum amd_dpm_forced_level ;
PATCH 3/3 drm/amd/display: "Enable IPS by default"
In reply to [email protected]From: Roman Li <[email protected]>
[Why]
IPS was temporary disabled due to instability.
It was fixed in dmub firmware and with:
- "drm/amd/display: Add IPS checks before dcn register access"
- "drm/amd/display: Disable ips before dc interrupt setting"
[How]
Enable IPS by default.
Disable IPS if 0x800 bit set in amdgpu.dcdebugmask module params
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -1719,7 +1719,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.nbio_reg_offsets = adev->reg_offset[NBIO_HWIP ][0 ]; init_data.clk_reg_offsets = adev->reg_offset[CLK_HWIP ][0 ]; - init_data.flags.disable_ips =DMUB_IPS_DISABLE_ALL ; +if (amdgpu_dc_debug_mask &DC_DISABLE_IPS ) + init_data.flags.disable_ips =DMUB_IPS_DISABLE_ALL ; init_data.flags.disable_ips_in_vpb =1 ;
Signature · 1 line
2.34.1
Re: [PATCH 3/3] drm/amd/display: "Enable IPS by default"
Quoted 8 lines · On 1/24/2024 11:09, [email protected] wrote:
From: Roman Li <[email protected]>
[Why]
IPS was temporary disabled due to instability.
It was fixed in dmub firmware and with:
- "drm/amd/display: Add IPS checks before dcn register access"
- "drm/amd/display: Disable ips before dc interrupt setting"
Quoted 6 lines
[How]
Enable IPS by default.
Disable IPS if0x800bit set in amdgpu.dcdebugmask module paramsSigned-off-by Roman Li <[email protected]>Tested-by Mark Broadworth <[email protected]>
Quoted 18 lines
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-1@@ -1719,7 +1719,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.nbio_reg_offsets = adev->reg_offset[NBIO_HWIP ][0 ]; init_data.clk_reg_offsets = adev->reg_offset[CLK_HWIP ][0 ]; - init_data.flags.disable_ips =DMUB_IPS_DISABLE_ALL ; +if (amdgpu_dc_debug_mask &DC_DISABLE_IPS ) + init_data.flags.disable_ips =DMUB_IPS_DISABLE_ALL ; init_data.flags.disable_ips_in_vpb =1 ;
Quoted 6 lines · On 1/24/2024 11:09, [email protected] wrote:
From: Roman Li <[email protected]>
[Why]
While in IPS2 an access to dcn registers is not allowed. If interrupt results in dc call, we should disable IPS.
Quoted 6 lines
[How]
Safeguard register access in IPS2 by disabling idle optimization before calling dc interrupt setting api.Signed-off-by Roman Li <[email protected]>Tested-by Mark Broadworth <[email protected]>
Quoted 27 lines
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +4
-1@@ -711,7 +711,7 @@ static inline int dm_irq_state(struct amdgpu_device *adev, {bool st;enum dc_irq_source irq_source; - +struct dc *dc = adev->dm.dc;struct amdgpu_crtc *acrtc = adev->mode_info.crtcs[crtc_id];if (!acrtc) {@@ -729,6 +729,9 @@ static inline int dm_irq_state(struct amdgpu_device *adev, st = (state ==AMDGPU_IRQ_STATE_ENABLE ); +if (dc && dc->caps.ips_support && dc->idle_optimizations_allowed) +dc_allow_idle_optimizations (dc, false); +dc_interrupt_set (adev->dm.dc, irq_source, st);return 0 ; }