Skip to content

Commit f9070b0

Browse files
Lang Yualexdeucher
authored andcommitted
drm/amdgpu/vpe: add VPE 6.1.1 support
Add initial support for VPE 6.1.1. v2: squash in updates (Alex) Signed-off-by: Lang Yu <Lang.Yu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent d40f621 commit f9070b0

File tree

2 files changed

+207
-106
lines changed

2 files changed

+207
-106
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,19 @@ static int vpe_early_init(void *handle)
297297
case IP_VERSION(6, 1, 0):
298298
vpe_v6_1_set_funcs(vpe);
299299
break;
300+
case IP_VERSION(6, 1, 1):
301+
vpe_v6_1_set_funcs(vpe);
302+
vpe->collaborate_mode = true;
303+
break;
300304
default:
301305
return -EINVAL;
302306
}
303307

304308
vpe_set_ring_funcs(adev);
305309
vpe_set_regs(vpe);
306310

311+
dev_info(adev->dev, "VPE: collaborate mode %s", vpe->collaborate_mode ? "true" : "false");
312+
307313
return 0;
308314
}
309315

@@ -493,8 +499,6 @@ static void vpe_ring_emit_fence(struct amdgpu_ring *ring, uint64_t addr,
493499
{
494500
int i = 0;
495501

496-
vpe_ring_emit_pred_exec(ring, 0, 10);
497-
498502
do {
499503
/* write the fence */
500504
amdgpu_ring_write(ring, VPE_CMD_HEADER(VPE_CMD_OPCODE_FENCE, 0));
@@ -705,16 +709,22 @@ static void vpe_ring_set_wptr(struct amdgpu_ring *ring)
705709
upper_32_bits(ring->wptr << 2));
706710
atomic64_set((atomic64_t *)ring->wptr_cpu_addr, ring->wptr << 2);
707711
WDOORBELL64(ring->doorbell_index, ring->wptr << 2);
712+
if (vpe->collaborate_mode)
713+
WDOORBELL64(ring->doorbell_index + 4, ring->wptr << 2);
708714
} else {
709-
dev_dbg(adev->dev, "Not using doorbell, \
710-
regVPEC_QUEUE0_RB_WPTR == 0x%08x, \
711-
regVPEC_QUEUE0_RB_WPTR_HI == 0x%08x\n",
712-
lower_32_bits(ring->wptr << 2),
713-
upper_32_bits(ring->wptr << 2));
714-
WREG32(vpe_get_reg_offset(vpe, ring->me, vpe->regs.queue0_rb_wptr_lo),
715-
lower_32_bits(ring->wptr << 2));
716-
WREG32(vpe_get_reg_offset(vpe, ring->me, vpe->regs.queue0_rb_wptr_hi),
717-
upper_32_bits(ring->wptr << 2));
715+
int i;
716+
717+
for (i = 0; i < vpe->num_instances; i++) {
718+
dev_dbg(adev->dev, "Not using doorbell, \
719+
regVPEC_QUEUE0_RB_WPTR == 0x%08x, \
720+
regVPEC_QUEUE0_RB_WPTR_HI == 0x%08x\n",
721+
lower_32_bits(ring->wptr << 2),
722+
upper_32_bits(ring->wptr << 2));
723+
WREG32(vpe_get_reg_offset(vpe, i, vpe->regs.queue0_rb_wptr_lo),
724+
lower_32_bits(ring->wptr << 2));
725+
WREG32(vpe_get_reg_offset(vpe, i, vpe->regs.queue0_rb_wptr_hi),
726+
upper_32_bits(ring->wptr << 2));
727+
}
718728
}
719729
}
720730

0 commit comments

Comments
 (0)