drm/amdgpu: implement IRQ_STATE_ENABLE for SDMA v4.4.2
Subsystems (2)
PATCH 1/1 drm/amdgpu: implement IRQ_STATE_ENABLE for SDMA v4.4.2
SDMA_CNTL is not set in some cases, driver configures it by itself.
v2: simplify code
Signed-off-by Tao Zhou <[email protected]>
Reviewed-by Hawking Zhang <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +3 -13
@@ -1602,19 +1602,9 @@ static int sdma_v4_4_2_set_ecc_irq_state(struct amdgpu_device *adev,u32 sdma_cntl; sdma_cntl =RREG32_SDMA (type, regSDMA_CNTL); -switch (state) { -case AMDGPU_IRQ_STATE_DISABLE : - sdma_cntl =REG_SET_FIELD (sdma_cntl,SDMA_CNTL , -DRAM_ECC_INT_ENABLE ,0 ); -WREG32_SDMA (type, regSDMA_CNTL, sdma_cntl); -break ; -/* sdma ecc interrupt is enabled by default -* driver doesn't need to do anything to -* enable the interrupt */ -case AMDGPU_IRQ_STATE_ENABLE : -default : -break ; - } + sdma_cntl =REG_SET_FIELD (sdma_cntl,SDMA_CNTL ,DRAM_ECC_INT_ENABLE , + state ==AMDGPU_IRQ_STATE_ENABLE ?1 :0 ); +WREG32_SDMA (type, regSDMA_CNTL, sdma_cntl);return 0 ; }
Signature · 1 line
2.34.1
[AMD Official Use Only - General]
Reviewed-by Hawking Zhang <[email protected]>
Regards,
Hawking
-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Friday, March 29, 2024 11:10
To: [email protected]
Cc: Zhou1, Tao <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu: implement IRQ_STATE_ENABLE for SDMA v4.4.2
SDMA_CNTL is not set in some cases, driver configures it by itself.
v2: simplify code
Signed-off-by Tao Zhou <[email protected]>
Reviewed-by Hawking Zhang <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +3 -13
@@ -1602,19 +1602,9 @@ static int sdma_v4_4_2_set_ecc_irq_state(struct amdgpu_device *adev,u32 sdma_cntl; sdma_cntl =RREG32_SDMA (type, regSDMA_CNTL); -switch (state) { -case AMDGPU_IRQ_STATE_DISABLE : - sdma_cntl =REG_SET_FIELD (sdma_cntl,SDMA_CNTL , -DRAM_ECC_INT_ENABLE ,0 ); -WREG32_SDMA (type, regSDMA_CNTL, sdma_cntl); -break ; -/* sdma ecc interrupt is enabled by default -* driver doesn't need to do anything to -* enable the interrupt */ -case AMDGPU_IRQ_STATE_ENABLE : -default : -break ; - } + sdma_cntl =REG_SET_FIELD (sdma_cntl,SDMA_CNTL ,DRAM_ECC_INT_ENABLE , + state ==AMDGPU_IRQ_STATE_ENABLE ?1 :0 ); +WREG32_SDMA (type, regSDMA_CNTL, sdma_cntl);return 0 ; }
--
2.34.1