drm/amdgpu: Clear vce&uvd ring wptr for SRIOV
Subsystems (2)
PATCH 1/8 drm/amdgpu: Clear vce&uvd ring wptr for SRIOV
From: Frank Min <[email protected]>
MMSCH FW need to get the wptr from 0 after it get the mailbox request from driver, since every time kick the mailbox, mmsch thinks that it is the first time engine start to initialize.
--- drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 6 +++++- drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c +5 -1
@@ -685,6 +685,11 @@ static int uvd_v7_0_mmsch_start(struct amdgpu_device *adev,/* 4, set resp to zero */ WREG32_SOC15 (VCE ,0 , mmVCE_MMSCH_VF_MAILBOX_RESP,0 ); +WDOORBELL32 (adev->uvd.ring_enc[0 ].doorbell_index,0 ); + adev->wb.wb[adev->uvd.ring_enc[0 ].wptr_offs] =0 ; + adev->uvd.ring_enc[0 ].wptr =0 ; + adev->uvd.ring_enc[0 ].wptr_old =0 ; +/* 5, kick off the initialization and wait until VCE_MMSCH_VF_MAILBOX_RESP becomes non-zero */ WREG32_SOC15 (VCE ,0 , mmVCE_MMSCH_VF_MAILBOX_HOST,0x10000001 );
@@ -702,7 +707,6 @@ static int uvd_v7_0_mmsch_start(struct amdgpu_device *adev,dev_err (adev->dev,"failed to init MMSCH, mmVCE_MMSCH_VF_MAILBOX_RESP = %x\n" , data);return -EBUSY ; } -WDOORBELL32 (adev->uvd.ring_enc[0 ].doorbell_index,0 );return 0 ; }
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +5 -1
@@ -173,6 +173,11 @@ static int vce_v4_0_mmsch_start(struct amdgpu_device *adev,/* 4, set resp to zero */ WREG32 (SOC15_REG_OFFSET (VCE ,0 , mmVCE_MMSCH_VF_MAILBOX_RESP),0 ); +WDOORBELL32 (adev->vce.ring[0 ].doorbell_index,0 ); + adev->wb.wb[adev->vce.ring[0 ].wptr_offs] =0 ; + adev->vce.ring[0 ].wptr =0 ; + adev->vce.ring[0 ].wptr_old =0 ; +/* 5, kick off the initialization and wait until VCE_MMSCH_VF_MAILBOX_RESP becomes non-zero */ WREG32 (SOC15_REG_OFFSET (VCE ,0 , mmVCE_MMSCH_VF_MAILBOX_HOST),0x10000001 );
@@ -190,7 +195,6 @@ static int vce_v4_0_mmsch_start(struct amdgpu_device *adev,dev_err (adev->dev,"failed to init MMSCH, mmVCE_MMSCH_VF_MAILBOX_RESP = %x\n" , data);return -EBUSY ; } -WDOORBELL32 (adev->vce.ring[0 ].doorbell_index,0 );return 0 ; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1500974198-2385-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org
Alex Deucher
Acked-byQuoted 8 lines · Xiangliang.Yu
From: Frank Min <[email protected]>
MMSCH FW need to get the wptr from 0 after it get the mailbox request from driver, since every time kick the mailbox, mmsch thinks that it is the first time engine start to initialize.
Signed-off-by Frank Min <[email protected]>Signed-off-by Xiangliang.Yu <[email protected]>
Quoted 56 lines
--- drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 6 +++++- drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c +5
-1@@ -685,6 +685,11 @@ static int uvd_v7_0_mmsch_start(struct amdgpu_device *adev,/* 4, set resp to zero */ WREG32_SOC15 (VCE ,0 , mmVCE_MMSCH_VF_MAILBOX_RESP,0 ); +WDOORBELL32 (adev->uvd.ring_enc[0 ].doorbell_index,0 ); + adev->wb.wb[adev->uvd.ring_enc[0 ].wptr_offs] =0 ; + adev->uvd.ring_enc[0 ].wptr =0 ; + adev->uvd.ring_enc[0 ].wptr_old =0 ; +/* 5, kick off the initialization and wait until VCE_MMSCH_VF_MAILBOX_RESP becomes non-zero */ WREG32_SOC15 (VCE ,0 , mmVCE_MMSCH_VF_MAILBOX_HOST,0x10000001 );@@ -702,7 +707,6 @@ static int uvd_v7_0_mmsch_start(struct amdgpu_device *adev,dev_err (adev->dev,"failed to init MMSCH, mmVCE_MMSCH_VF_MAILBOX_RESP = %x\n" , data);return -EBUSY ; } -WDOORBELL32 (adev->uvd.ring_enc[0 ].doorbell_index,0 );return 0 ; }drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +5
-2@@ -173,6 +173,11 @@ static int vce_v4_0_mmsch_start(struct amdgpu_device *adev,/* 4, set resp to zero */ WREG32 (SOC15_REG_OFFSET (VCE ,0 , mmVCE_MMSCH_VF_MAILBOX_RESP),0 ); +WDOORBELL32 (adev->vce.ring[0 ].doorbell_index,0 ); + adev->wb.wb[adev->vce.ring[0 ].wptr_offs] =0 ; + adev->vce.ring[0 ].wptr =0 ; + adev->vce.ring[0 ].wptr_old =0 ; +/* 5, kick off the initialization and wait until VCE_MMSCH_VF_MAILBOX_RESP becomes non-zero */ WREG32 (SOC15_REG_OFFSET (VCE ,0 , mmVCE_MMSCH_VF_MAILBOX_HOST),0x10000001 );@@ -190,7 +195,6 @@ static int vce_v4_0_mmsch_start(struct amdgpu_device *adev,dev_err (adev->dev,"failed to init MMSCH, mmVCE_MMSCH_VF_MAILBOX_RESP = %x\n" , data);return -EBUSY ; } -WDOORBELL32 (adev->vce.ring[0 ].doorbell_index,0 );return 0 ; } --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx