drm/amdgpu/nbio: update vcn doorbell range
Subsystems (2)
Alex Deucher
maintainerPATCH 1/4 drm/amdgpu/nbio: update vcn doorbell range
From: James Zhu <[email protected]>
VCN4.0.3 used up to 16 doorbells per partition.
Signed-off-by James Zhu <[email protected]>
Reviewed-by Leo Liu <[email protected]>
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c +2 -2
@@ -161,7 +161,7 @@ static void nbio_v7_9_vcn_doorbell_range(struct amdgpu_device *adev, bool use_do doorbell_range =REG_SET_FIELD (doorbell_range,DOORBELL0_CTRL_ENTRY_0 ,BIF_DOORBELL0_RANGE_SIZE_ENTRY , -0x8 ); +0x10 ); doorbell_ctrl = REG_SET_FIELD(doorbell_ctrl, S2A_DOORBELL_ENTRY_1_CTRL,
@@ -174,7 +174,7 @@ static void nbio_v7_9_vcn_doorbell_range(struct amdgpu_device *adev, bool use_do S2A_DOORBELL_PORT1_RANGE_OFFSET, 0x4); doorbell_ctrl =REG_SET_FIELD (doorbell_ctrl,S2A_DOORBELL_ENTRY_1_CTRL , -S2A_DOORBELL_PORT1_RANGE_SIZE ,0x8 ); +S2A_DOORBELL_PORT1_RANGE_SIZE ,0x10 ); doorbell_ctrl =REG_SET_FIELD (doorbell_ctrl,S2A_DOORBELL_ENTRY_1_CTRL ,S2A_DOORBELL_PORT1_AWADDR_31_28_VALUE ,0x4 );
Signature · 1 line
2.39.2
Alex Deucher
maintainerPATCH 2/4 drm/amdgpu/vcn: enable vcn doorbell for vcn4.0.3
From: James Zhu <[email protected]>
Enable vcn doorbell for vcn4.0.3.
Signed-off-by James Zhu <[email protected]>
Reviewed-by Leo Liu <[email protected]>
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +9 -1
@@ -109,7 +109,8 @@ static int vcn_v4_0_3_sw_init(void *handle)return r; ring = &adev->vcn.inst->ring_dec; - ring->use_doorbell = false; + ring->use_doorbell = true; + ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 <<1 ) +5 ; ring->vm_hub =AMDGPU_MMHUB0 (0 );sprintf (ring->name,"vcn_dec" ); r = amdgpu_ring_init(adev, ring, 512, &adev->vcn.inst->irq, 0,
@@ -174,6 +175,13 @@ static int vcn_v4_0_3_hw_init(void *handle)struct amdgpu_ring *ring = &adev->vcn.inst->ring_dec;int r; + adev->nbio.funcs->vcn_doorbell_range (adev, ring->use_doorbell, + ring->doorbell_index, ring->me); +if (ring->use_doorbell) +WREG32_SOC15 (VCN , ring->me, regVCN_RB4_DB_CTRL, + ring->doorbell_index <<VCN_RB4_DB_CTRL__OFFSET__SHIFT | +VCN_RB4_DB_CTRL__EN_MASK ); + r =amdgpu_ring_test_helper (ring);if (!r)
Signature · 1 line
2.39.2
Alex Deucher
maintainerPATCH 3/4 drm/amdgpu/jpeg: enable jpeg doorbell for jpeg4.0.3
In reply to Alex DeucherFrom: James Zhu <[email protected]>
Enable jpeg doorbell for jpeg4.0.3.
Signed-off-by James Zhu <[email protected]>
Reviewed-by Leo Liu <[email protected]>
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c +11 -2
@@ -100,8 +100,9 @@ static int jpeg_v4_0_3_sw_init(void *handle)for (i =0 ; i < adev->jpeg.num_jpeg_rings; ++i) { ring = &adev->jpeg.inst->ring_dec[i]; - ring->use_doorbell = false; + ring->use_doorbell = true; ring->vm_hub =AMDGPU_MMHUB0 (0 ); + ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 <<1 ) + (i?8 :1 ) + i;sprintf (ring->name,"jpeg_dec_%d" , i); r =amdgpu_ring_init (adev, ring,512 , &adev->jpeg.inst->irq,0 ,AMDGPU_RING_PRIO_DEFAULT ,NULL );
@@ -148,11 +149,19 @@ static int jpeg_v4_0_3_sw_fini(void *handle)static int jpeg_v4_0_3_hw_init (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; -struct amdgpu_ring *ring; +struct amdgpu_ring *ring = adev->jpeg.inst->ring_dec;int i, r; + adev->nbio.funcs->vcn_doorbell_range (adev, ring->use_doorbell, + (adev->doorbell_index.vcn.vcn_ring0_1 <<1 ),0 ); +for (i =0 ; i < adev->jpeg.num_jpeg_rings; ++i) { ring = &adev->jpeg.inst->ring_dec[i]; +if (ring->use_doorbell) +WREG32_SOC15_OFFSET (VCN ,0 , regVCN_JPEG_DB_CTRL, + (ring->pipe?(ring->pipe -0x15 ):0 ), + ring->doorbell_index <<VCN_JPEG_DB_CTRL__OFFSET__SHIFT | +VCN_JPEG_DB_CTRL__EN_MASK ); r =amdgpu_ring_test_helper (ring);if (r)return r;
Signature · 1 line
2.39.2
Alex Deucher
maintainerPATCH 4/4 drm/amdgpu: fix vcn doorbell range setting
In reply to Alex DeucherFrom: James Zhu <[email protected]>
Should use vcn_ring0_1 instead of doorbell index to set nbio doorbell range.
Signed-off-by James Zhu <[email protected]>
Reviewed-by Sonny Jiang <[email protected]>
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +1 -1
@@ -176,7 +176,7 @@ static int vcn_v4_0_3_hw_init(void *handle)int r; adev->nbio.funcs->vcn_doorbell_range (adev, ring->use_doorbell, - ring->doorbell_index, ring->me); + (adev->doorbell_index.vcn.vcn_ring0_1 <<1 ), ring->me);if (ring->use_doorbell) WREG32_SOC15(VCN, ring->me, regVCN_RB4_DB_CTRL, ring->doorbell_index << VCN_RB4_DB_CTRL__OFFSET__SHIFT |
Signature · 1 line
2.39.2