Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <boyuan.zhang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Boyuan Zhang and committed by
Alex Deucher
7d75ef37 ecfa23c8

+11 -3
+11 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
··· 389 389 for (i = 0; i < adev->vcn.num_enc_rings; ++i) 390 390 fence[j] += amdgpu_fence_count_emitted(&adev->vcn.inst[j].ring_enc[i]); 391 391 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) { 393 395 struct dpg_pause_state new_state; 394 396 395 397 if (fence[j] || ··· 437 435 amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN, 438 436 AMD_PG_STATE_UNGATE); 439 437 440 - if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) { 438 + /* Only set DPG pause for VCN3 or below, VCN4 and above will be handled by FW */ 439 + if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG && 440 + !adev->vcn.using_unified_queue) { 441 441 struct dpg_pause_state new_state; 442 442 443 443 if (ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC) { ··· 465 461 466 462 void amdgpu_vcn_ring_end_use(struct amdgpu_ring *ring) 467 463 { 464 + struct amdgpu_device *adev = ring->adev; 465 + 466 + /* Only set DPG pause for VCN3 or below, VCN4 and above will be handled by FW */ 468 467 if (ring->adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG && 469 - ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC) 468 + ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC && 469 + !adev->vcn.using_unified_queue) 470 470 atomic_dec(&ring->adev->vcn.inst[ring->me].dpg_enc_submission_cnt); 471 471 472 472 atomic_dec(&ring->adev->vcn.total_submission_cnt);