]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu/vcn: remove JPEG related code from idle handler and begin use
authorLeo Liu <leo.liu@amd.com>
Thu, 12 Dec 2019 15:52:34 +0000 (10:52 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Dec 2019 21:09:07 +0000 (16:09 -0500)
For VCN2.0 and above, VCN has been separated from JPEG

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

index 717f0a218c5decb9306c2f0e01a40b0e6b157a68..e522025430c761c0cd3631d2623a75e761884917 100644 (file)
@@ -291,6 +291,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
        for (j = 0; j < adev->vcn.num_vcn_inst; ++j) {
                if (adev->vcn.harvest_config & (1 << j))
                        continue;
+
                for (i = 0; i < adev->vcn.num_enc_rings; ++i) {
                        fence[j] += amdgpu_fence_count_emitted(&adev->vcn.inst[j].ring_enc[i]);
                }
@@ -303,26 +304,17 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
                        else
                                new_state.fw_based = VCN_DPG_STATE__UNPAUSE;
 
-                       if (amdgpu_fence_count_emitted(&adev->jpeg.inst[j].ring_dec))
-                               new_state.jpeg = VCN_DPG_STATE__PAUSE;
-                       else
-                               new_state.jpeg = VCN_DPG_STATE__UNPAUSE;
-
                        adev->vcn.pause_dpg_mode(adev, &new_state);
                }
 
-               fence[j] += amdgpu_fence_count_emitted(&adev->jpeg.inst[j].ring_dec);
                fence[j] += amdgpu_fence_count_emitted(&adev->vcn.inst[j].ring_dec);
                fences += fence[j];
        }
 
        if (fences == 0) {
                amdgpu_gfx_off_ctrl(adev, true);
-               if (adev->asic_type < CHIP_ARCTURUS && adev->pm.dpm_enabled)
-                       amdgpu_dpm_enable_uvd(adev, false);
-               else
-                       amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
-                                                              AMD_PG_STATE_GATE);
+               amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
+                      AMD_PG_STATE_GATE);
        } else {
                schedule_delayed_work(&adev->vcn.idle_work, VCN_IDLE_TIMEOUT);
        }
@@ -335,11 +327,8 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
 
        if (set_clocks) {
                amdgpu_gfx_off_ctrl(adev, false);
-               if (adev->asic_type < CHIP_ARCTURUS && adev->pm.dpm_enabled)
-                       amdgpu_dpm_enable_uvd(adev, true);
-               else
-                       amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
-                                                              AMD_PG_STATE_UNGATE);
+               amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
+                      AMD_PG_STATE_UNGATE);
        }
 
        if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)    {
@@ -355,15 +344,8 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
                else
                        new_state.fw_based = VCN_DPG_STATE__UNPAUSE;
 
-               if (amdgpu_fence_count_emitted(&adev->jpeg.inst[ring->me].ring_dec))
-                       new_state.jpeg = VCN_DPG_STATE__PAUSE;
-               else
-                       new_state.jpeg = VCN_DPG_STATE__UNPAUSE;
-
                if (ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC)
                        new_state.fw_based = VCN_DPG_STATE__PAUSE;
-               else if (ring->funcs->type == AMDGPU_RING_TYPE_VCN_JPEG)
-                       new_state.jpeg = VCN_DPG_STATE__PAUSE;
 
                adev->vcn.pause_dpg_mode(adev, &new_state);
        }