drm/amdgpu/vce4: workaround multi vce engine encoding hang issue
Subsystems (2)
PATCH 3/5 drm/amdgpu/vce4: workaround multi vce engine encoding hang issue
For SRIOV, multi vce engine will hang when encoding. Add VMHUB flush to workaround it, will continue to find the root cause later.
--- drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +11 -0
@@ -31,6 +31,7 @@#include "soc15d.h" #include "soc15_common.h" #include "mmsch_v1_0.h" +#include "gmc_v9_0.h" #include "vega10/soc15ip.h" #include "vega10/VCE/vce_4_0_offset.h"
@@ -971,6 +972,7 @@ static void vce_v4_0_emit_vm_flush(struct amdgpu_ring *ring,uint32_t req = ring->adev->gart.gart_funcs->get_invalidate_req (vm_id);unsigned eng = ring->idx;unsigned i; +struct amdgpu_device *adev = ring->adev; pd_addr = pd_addr |0x1 ;/* valid bit */ /* now only use physical base address of PDE and valid */
@@ -979,6 +981,15 @@ static void vce_v4_0_emit_vm_flush(struct amdgpu_ring *ring,for (i =0 ; i <AMDGPU_MAX_VMHUBS ; ++i) {struct amdgpu_vmhub *hub = &ring->adev->vmhub[i]; +/* Workaround multi vce engine encoding hang issue */ +if (i &&amdgpu_sriov_vf (adev)) { +WREG32_NO_KIQ (hub->ctx0_ptb_addr_lo32 + vm_id *2 , +lower_32_bits (pd_addr)); +WREG32_NO_KIQ (hub->ctx0_ptb_addr_hi32 + vm_id *2 , +upper_32_bits (pd_addr)); +gmc_v9_0_flush_vmhub (adev, hub, eng, vm_id); + } +amdgpu_ring_write (ring,VCE_CMD_REG_WRITE );amdgpu_ring_write (ring, (hub->ctx0_ptb_addr_hi32 + vm_id *2 ) <<2 );
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): 1491741075-23827-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org
Christian König
NAKAm 09.04.2017 um 14:31 schrieb Xiangliang Yu:
Quoted 2 lines
For SRIOV, multi vce engine will hang when encoding. Add VMHUB flush to workaround it, will continue to find the root cause later.
NAK, that won't work and can cause hangs as well.
The hang you experience could be a known issue with old libdrm, do you have updated to the latest version?
Regards,
Christian.
Quoted 33 lines
Signed-off-by Xiangliang Yu <[email protected]>Signed-off-by Frank Min <[email protected]>--- drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +4
-0@@ -31,6 +31,7 @@#include "soc15d.h" #include "soc15_common.h" #include "mmsch_v1_0.h" +#include "gmc_v9_0.h" #include "vega10/soc15ip.h" #include "vega10/VCE/vce_4_0_offset.h" @@ -971,6 +972,7 @@ static void vce_v4_0_emit_vm_flush(struct amdgpu_ring *ring,uint32_t req = ring->adev->gart.gart_funcs->get_invalidate_req (vm_id);unsigned eng = ring->idx;unsigned i; +struct amdgpu_device *adev = ring->adev; pd_addr = pd_addr |0x1 ;/* valid bit */ /* now only use physical base address of PDE and valid */ @@ -979,6 +981,15 @@ static void vce_v4_0_emit_vm_flush(struct amdgpu_ring *ring,for (i =0 ; i <AMDGPU_MAX_VMHUBS ; ++i) {struct amdgpu_vmhub *hub = &ring->adev->vmhub[i]; +/* Workaround multi vce engine encoding hang issue */ +if (i &&amdgpu_sriov_vf (adev)) {
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c static void vce_v4_0_emit_vm_flush(struct amdgpu_ring *ring, · line 995
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +7
-0+WREG32_NO_KIQ (hub->ctx0_ptb_addr_lo32 + vm_id *2 , +lower_32_bits (pd_addr)); +WREG32_NO_KIQ (hub->ctx0_ptb_addr_hi32 + vm_id *2 , +upper_32_bits (pd_addr)); +gmc_v9_0_flush_vmhub (adev, hub, eng, vm_id); + } +amdgpu_ring_write (ring,VCE_CMD_REG_WRITE );amdgpu_ring_write (ring, (hub->ctx0_ptb_addr_hi32 + vm_id *2 ) <<2 );
_______________________________________________
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): 32fa467d-5df0-947a-f251-7636c3ae7235-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Quoted 8 lines
Am 09.04.2017 um 14:31 schrieb Xiangliang Yu:
Quoted 2 lines
For SRIOV, multi vce engine will hang when encoding. Add VMHUB flush to workaround it, will continue to find the root cause later.
NAK, that won't work and can cause hangs as well.
The hang you experience could be a known issue with old libdrm, do you have updated to the latest version?
Ok, I'll try it later.
Quoted 43 lines
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c static void vce_v4_0_emit_vm_flush(struct
Quoted 22 lines
Signed-off-by Xiangliang Yu <[email protected]>Signed-off-by Frank Min <[email protected]>--- drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +1
-0@@ -31,6 +31,7 @@#include "soc15d.h" #include "soc15_common.h" #include "mmsch_v1_0.h" +#include "gmc_v9_0.h" #include "vega10/soc15ip.h" #include "vega10/VCE/vce_4_0_offset.h" @@ -971,6 +972,7 @@ static void vce_v4_0_emit_vm_flush(struct
amdgpu_ring*ring,Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +1
-0uint32_t req = ring->adev->gart.gart_funcs-get_invalidate_req (vm_id);unsigned eng = ring->idx;unsigned i; +struct amdgpu_device *adev = ring->adev; pd_addr = pd_addr |0x1 ;/* valid bit */ /* now only use physical base address of PDE and valid */ @@ -979,6
+981,15 @@ static void vce_v4_0_emit_vm_flush(structamdgpu_ring*ring,
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c static void vce_v4_0_emit_vm_flush(struct amdgpu_ring *ring,
Quoted 6 lines
for (i = 0; i < AMDGPU_MAX_VMHUBS; ++i) { struct amdgpu_vmhub *hub = &ring->adev->vmhub[i];drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +3
-0+/* Workaround multi vce engine encoding hang issue */ +if (i &&amdgpu_sriov_vf (adev)) { + WREG32_NO_KIQ(hub->ctx0_ptb_addr_lo32 +
vm_id* 2,drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +2
-0+ lower_32_bits(pd_addr)); + WREG32_NO_KIQ(hub->ctx0_ptb_addr_hi32 +
vm_id* 2,
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c static void vce_v4_0_emit_vm_flush(struct amdgpu_ring *ring, · line 995
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +4
-0+ upper_32_bits(pd_addr)); +gmc_v9_0_flush_vmhub (adev, hub, eng, vm_id); + } +amdgpu_ring_write (ring,VCE_CMD_REG_WRITE );amdgpu_ring_write (ring, (hub->ctx0_ptb_addr_hi32 + vm_id *2 ) <<2 );
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx