Skip to content

Commit 5032f94

Browse files
Boyz-Radeongregkh
authored andcommitted
drm/amdgpu/vcn: not pause dpg for unified queue
commit 7d75ef3 upstream. 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> Cc: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 66e126d commit 5032f94

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

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

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

396-
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) {
396+
/* Only set DPG pause for VCN3 or below, VCN4 and above will be handled by FW */
397+
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG &&
398+
!adev->vcn.using_unified_queue) {
397399
struct dpg_pause_state new_state;
398400

399401
if (fence[j] ||
@@ -439,7 +441,9 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
439441
amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
440442
AMD_PG_STATE_UNGATE);
441443

442-
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) {
444+
/* Only set DPG pause for VCN3 or below, VCN4 and above will be handled by FW */
445+
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG &&
446+
!adev->vcn.using_unified_queue) {
443447
struct dpg_pause_state new_state;
444448

445449
if (ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC) {
@@ -465,8 +469,12 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
465469

466470
void amdgpu_vcn_ring_end_use(struct amdgpu_ring *ring)
467471
{
472+
struct amdgpu_device *adev = ring->adev;
473+
474+
/* Only set DPG pause for VCN3 or below, VCN4 and above will be handled by FW */
468475
if (ring->adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG &&
469-
ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC)
476+
ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC &&
477+
!adev->vcn.using_unified_queue)
470478
atomic_dec(&ring->adev->vcn.inst[ring->me].dpg_enc_submission_cnt);
471479

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

0 commit comments

Comments
 (0)