Skip to contentSkip to conversation

drm/amdgpu: free handles after fini the context

PATCH In review Leo Liu 2 participants 2 messages Jul 25, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Leo Liu

author
#0 lore raw

PATCH 1/1 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'

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -4
index 29bfd4c..0fb5488 100644
@@ -578,6 +578,9 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
 
 	amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr);
 
+	amdgpu_uvd_free_handles(adev, file_priv);
+	amdgpu_vce_free_handles(adev, file_priv);
+
 	amdgpu_vm_fini(adev, &fpriv->vm);
 
 	idr_for_each_entry(&fpriv->bo_list_handles, list, handle)
@@ -602,10 +605,6 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
 void amdgpu_driver_preclose_kms(struct drm_device *dev,
 				struct drm_file *file_priv)
 {
-	struct amdgpu_device *adev = dev->dev_private;
-
-	amdgpu_uvd_free_handles(adev, file_priv);
-	amdgpu_vce_free_handles(adev, file_priv);
 }
 
 /*
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1469454055-3634-1-git-send-email-leo.liu-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

Am 25.07.2016 um 15:40 schrieb Leo Liu:

Quoted 7 lines

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'

Quoted 19 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
index 29bfd4c..0fb5488 100644
@@ -578,6 +578,9 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
 
  	amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr);
 
+	amdgpu_uvd_free_handles(adev, file_priv);
+	amdgpu_vce_free_handles(adev, file_priv);
+
  	amdgpu_vm_fini(adev, &fpriv->vm);
 
  	idr_for_each_entry(&fpriv->bo_list_handles, list, handle)

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c void amdgpu_driver_postclose_kms(struct drm_device *dev, · line 610

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -4
@@ -602,10 +605,6 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
  void amdgpu_driver_preclose_kms(struct drm_device *dev,
  				struct drm_file *file_priv)
  {
-	struct amdgpu_device *adev = dev->dev_private;
-
-	amdgpu_uvd_free_handles(adev, file_priv);
-	amdgpu_vce_free_handles(adev, file_priv);
  }
 
  /*

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx