Skip to content

Commit 7d75ef3

Browse files
Boyz-Radeonalexdeucher
authored andcommitted
drm/amdgpu/vcn: not pause dpg for unified queue
For unified queue, DPG pause for encoding is done inside VCN firmware, so there is no need to pause dpg based on ring type in kernel. For VCN3 and below, pausing DPG for encoding in kernel is still needed. v2: add more comments v3: update commit message Signed-off-by: Boyuan Zhang <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Ruijing Dong <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent ecfa23c commit 7d75ef3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
389389
for (i = 0; i < adev->vcn.num_enc_rings; ++i)
390390
fence[j] += amdgpu_fence_count_emitted(&adev->vcn.inst[j].ring_enc[i]);
391391

392-
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) {
392+
/* Only set DPG pause for VCN3 or below, VCN4 and above will be handled by FW */
393+
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG &&
394+
!adev->vcn.using_unified_queue) {
393395
struct dpg_pause_state new_state;
394396

395397
if (fence[j] ||
@@ -435,7 +437,9 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
435437
amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
436438
AMD_PG_STATE_UNGATE);
437439

438-
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) {
440+
/* Only set DPG pause for VCN3 or below, VCN4 and above will be handled by FW */
441+
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG &&
442+
!adev->vcn.using_unified_queue) {
439443
struct dpg_pause_state new_state;
440444

441445
if (ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC) {
@@ -461,8 +465,12 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
461465

462466
void amdgpu_vcn_ring_end_use(struct amdgpu_ring *ring)
463467
{
468+
struct amdgpu_device *adev = ring->adev;
469+
470+
/* Only set DPG pause for VCN3 or below, VCN4 and above will be handled by FW */
464471
if (ring->adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG &&
465-
ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC)
472+
ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC &&
473+
!adev->vcn.using_unified_queue)
466474
atomic_dec(&ring->adev->vcn.inst[ring->me].dpg_enc_submission_cnt);
467475

468476
atomic_dec(&ring->adev->vcn.total_submission_cnt);

0 commit comments

Comments
 (0)