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: Set PG state to gating for vcn_v_5_0_1

For vcn_v_5_0_1, set power state to gating during hw fini. Also there may
be scenario where VCN engine hangs during a job execution, then it's not
safe to assume that set_pg_state works fine during hw_fini to put the state
to gated. After a reset, we can assume that it's in the default state,
therefore reset the driver maintained state. Put the default state as gated
during reset as per this assumption.

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Asad Kamal and committed by
Alex Deucher
8df5f03b 1092a4ea

+11 -1
+11 -1
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
··· 227 227 struct amdgpu_device *adev = ip_block->adev; 228 228 int i; 229 229 230 - for (i = 0; i < adev->vcn.num_vcn_inst; ++i) 230 + for (i = 0; i < adev->vcn.num_vcn_inst; ++i) { 231 + struct amdgpu_vcn_inst *vinst = &adev->vcn.inst[i]; 232 + 231 233 cancel_delayed_work_sync(&adev->vcn.inst[i].idle_work); 234 + if (vinst->cur_state != AMD_PG_STATE_GATE) 235 + vinst->set_pg_state(vinst, AMD_PG_STATE_GATE); 236 + } 232 237 233 238 return 0; 234 239 } ··· 276 271 int r, i; 277 272 278 273 for (i = 0; i < adev->vcn.num_vcn_inst; i++) { 274 + struct amdgpu_vcn_inst *vinst = &adev->vcn.inst[i]; 275 + 276 + if (amdgpu_in_reset(adev)) 277 + vinst->cur_state = AMD_PG_STATE_GATE; 278 + 279 279 r = amdgpu_vcn_resume(ip_block->adev, i); 280 280 if (r) 281 281 return r;