]> Git Repo - J-linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drm/amdgpu: use string choice helpers
[J-linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_gem.c
index 0e617dff8765e28469419720b0ea767c51c31457..1a5df8b9466161eda0007d74aa7c817c7b1e9b0c 100644 (file)
@@ -43,8 +43,6 @@
 #include "amdgpu_hmm.h"
 #include "amdgpu_xgmi.h"
 
-static const struct drm_gem_object_funcs amdgpu_gem_object_funcs;
-
 static vm_fault_t amdgpu_gem_fault(struct vm_fault *vmf)
 {
        struct ttm_buffer_object *bo = vmf->vma->vm_private_data;
@@ -87,11 +85,11 @@ static const struct vm_operations_struct amdgpu_gem_vm_ops = {
 
 static void amdgpu_gem_object_free(struct drm_gem_object *gobj)
 {
-       struct amdgpu_bo *robj = gem_to_amdgpu_bo(gobj);
+       struct amdgpu_bo *aobj = gem_to_amdgpu_bo(gobj);
 
-       if (robj) {
-               amdgpu_hmm_unregister(robj);
-               amdgpu_bo_unref(&robj);
+       if (aobj) {
+               amdgpu_hmm_unregister(aobj);
+               ttm_bo_put(&aobj->tbo);
        }
 }
 
@@ -126,7 +124,6 @@ int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size,
 
        bo = &ubo->bo;
        *obj = &bo->tbo.base;
-       (*obj)->funcs = &amdgpu_gem_object_funcs;
 
        return 0;
 }
@@ -295,7 +292,7 @@ static int amdgpu_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_str
        return drm_gem_ttm_mmap(obj, vma);
 }
 
-static const struct drm_gem_object_funcs amdgpu_gem_object_funcs = {
+const struct drm_gem_object_funcs amdgpu_gem_object_funcs = {
        .free = amdgpu_gem_object_free,
        .open = amdgpu_gem_object_open,
        .close = amdgpu_gem_object_close,
This page took 0.029049 seconds and 4 git commands to generate.