Skip to contentSkip to conversation

drm/amdgpu: Fix VCE 3 ring align_mask

PATCH In review David Rosca 2 participants 3 messages Aug 20

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix VCE 3 ring align_mask

The largest frame is 20 dwords, so 0xf mask is too small. This was always wrong, but we were lucky with the VCE_CMD_END commands inserted after fence and vm_flush.

Fixes 7591335141a0 ("drm/amdgpu: Implement insert_end for VCE 3")
---
 drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +1 -1
index 9809a23fa521..d5adccd3e689 100644
@@ -890,7 +890,7 @@ static const struct amdgpu_ring_funcs vce_v3_0_ring_phys_funcs = {
 
 static const struct amdgpu_ring_funcs vce_v3_0_ring_vm_funcs = {
 	.type = AMDGPU_RING_TYPE_VCE,
-	.align_mask = 0xf,
+	.align_mask = 0x1f,
 	.nop = VCE_CMD_NO_OP,
 	.support_64bit_ptrs = false,
 	.no_user_fence = true,
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · David Rosca

The largest frame is 20 dwords, so 0xf mask is too small. This was always wrong, but we were lucky with the VCE_CMD_END commands inserted after fence and vm_flush.

Fixes 7591335141a0 ("drm/amdgpu: Implement insert_end for VCE 3")

Do any other VCE versions need their masks fixed?

Quoted 20 lines
---
 drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +1 -2
index 9809a23fa521..d5adccd3e689 100644
@@ -890,7 +890,7 @@ static const struct amdgpu_ring_funcs vce_v3_0_ring_phys_funcs = {
 
 static const struct amdgpu_ring_funcs vce_v3_0_ring_vm_funcs = {
        .type = AMDGPU_RING_TYPE_VCE,
-       .align_mask = 0xf,
+       .align_mask = 0x1f,
        .nop = VCE_CMD_NO_OP,
        .support_64bit_ptrs = false,
        .no_user_fence = true,
--

2.43.0

#2 lore raw
Quoted 8 lines · Alex Deucher
Quoted 6 lines · David Rosca

The largest frame is 20 dwords, so 0xf mask is too small. This was always wrong, but we were lucky with the VCE_CMD_END commands inserted after fence and vm_flush.

Fixes 7591335141a0 ("drm/amdgpu: Implement insert_end for VCE 3")

Do any other VCE versions need their masks fixed?

No, only VCE 3 was wrong.

David

Quoted 23 lines
Quoted 20 lines
---
  drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +1 -2
index 9809a23fa521..d5adccd3e689 100644
@@ -890,7 +890,7 @@ static const struct amdgpu_ring_funcs vce_v3_0_ring_phys_funcs = {
 
  static const struct amdgpu_ring_funcs vce_v3_0_ring_vm_funcs = {
         .type = AMDGPU_RING_TYPE_VCE,
-       .align_mask = 0xf,
+       .align_mask = 0x1f,
         .nop = VCE_CMD_NO_OP,
         .support_64bit_ptrs = false,
         .no_user_fence = true,
--

2.43.0