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

drm/amdgpu: free handles after fini the context

This will make sure all the submissions from different contexts gets
finished, and then we close the session and free up the handles.

This will fix the issue that session clean-up is not get done properly,
when with the command `kill -9'

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Leo Liu and committed by
Alex Deucher
cd437e37 2ff2bf1e

+3 -4
+3 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
··· 584 584 585 585 amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr); 586 586 587 + amdgpu_uvd_free_handles(adev, file_priv); 588 + amdgpu_vce_free_handles(adev, file_priv); 589 + 587 590 amdgpu_vm_fini(adev, &fpriv->vm); 588 591 589 592 idr_for_each_entry(&fpriv->bo_list_handles, list, handle) ··· 611 608 void amdgpu_driver_preclose_kms(struct drm_device *dev, 612 609 struct drm_file *file_priv) 613 610 { 614 - struct amdgpu_device *adev = dev->dev_private; 615 - 616 - amdgpu_uvd_free_handles(adev, file_priv); 617 - amdgpu_vce_free_handles(adev, file_priv); 618 611 } 619 612 620 613 /*