drm/msm: Replace gem_object deprecated functions
authorSteve Kowalik <steven@wedontsleep.org>
Fri, 26 Jan 2018 03:55:54 +0000 (14:55 +1100)
committerRob Clark <robdclark@gmail.com>
Tue, 20 Feb 2018 15:41:21 +0000 (10:41 -0500)
drm_gem_object_{reference,unreference,unreference_unlocked} are
deprecated functions, and merely alias to the get/put functions.
Switch to the new names.

Signed-off-by: Steve Kowalik <steven@wedontsleep.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/adreno/a5xx_gpu.c
drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_fb.c
drivers/gpu/drm/msm/msm_gem.c
drivers/gpu/drm/msm/msm_gpu.c
drivers/gpu/drm/msm/msm_ringbuffer.c

index fa08b48..795fe11 100644 (file)
@@ -858,19 +858,19 @@ static void a5xx_destroy(struct msm_gpu *gpu)
        if (a5xx_gpu->pm4_bo) {
                if (a5xx_gpu->pm4_iova)
                        msm_gem_put_iova(a5xx_gpu->pm4_bo, gpu->aspace);
-               drm_gem_object_unreference_unlocked(a5xx_gpu->pm4_bo);
+               drm_gem_object_put_unlocked(a5xx_gpu->pm4_bo);
        }
 
        if (a5xx_gpu->pfp_bo) {
                if (a5xx_gpu->pfp_iova)
                        msm_gem_put_iova(a5xx_gpu->pfp_bo, gpu->aspace);
-               drm_gem_object_unreference_unlocked(a5xx_gpu->pfp_bo);
+               drm_gem_object_put_unlocked(a5xx_gpu->pfp_bo);
        }
 
        if (a5xx_gpu->gpmu_bo) {
                if (a5xx_gpu->gpmu_iova)
                        msm_gem_put_iova(a5xx_gpu->gpmu_bo, gpu->aspace);
-               drm_gem_object_unreference_unlocked(a5xx_gpu->gpmu_bo);
+               drm_gem_object_put_unlocked(a5xx_gpu->gpmu_bo);
        }
 
        adreno_gpu_cleanup(adreno_gpu);
index 14bd3bd..6e5e1aa 100644 (file)
@@ -129,7 +129,7 @@ static void unref_cursor_worker(struct drm_flip_work *work, void *val)
        struct msm_kms *kms = &mdp4_kms->base.base;
 
        msm_gem_put_iova(val, kms->aspace);
-       drm_gem_object_unreference_unlocked(val);
+       drm_gem_object_put_unlocked(val);
 }
 
 static void mdp4_crtc_destroy(struct drm_crtc *crtc)
@@ -382,7 +382,7 @@ static void update_cursor(struct drm_crtc *crtc)
 
                if (next_bo) {
                        /* take a obj ref + iova ref when we start scanning out: */
-                       drm_gem_object_reference(next_bo);
+                       drm_gem_object_get(next_bo);
                        msm_gem_get_iova(next_bo, kms->aspace, &iova);
 
                        /* enable cursor: */
@@ -467,7 +467,7 @@ static int mdp4_crtc_cursor_set(struct drm_crtc *crtc,
        return 0;
 
 fail:
-       drm_gem_object_unreference_unlocked(cursor_bo);
+       drm_gem_object_put_unlocked(cursor_bo);
        return ret;
 }
 
index f7f0874..4b646bf 100644 (file)
@@ -164,7 +164,7 @@ static void mdp4_destroy(struct msm_kms *kms)
 
        if (mdp4_kms->blank_cursor_iova)
                msm_gem_put_iova(mdp4_kms->blank_cursor_bo, kms->aspace);
-       drm_gem_object_unreference_unlocked(mdp4_kms->blank_cursor_bo);
+       drm_gem_object_put_unlocked(mdp4_kms->blank_cursor_bo);
 
        if (aspace) {
                aspace->mmu->funcs->detach(aspace->mmu,
index e414850..8c5ed0b 100644 (file)
@@ -170,7 +170,7 @@ static void unref_cursor_worker(struct drm_flip_work *work, void *val)
        struct msm_kms *kms = &mdp5_kms->base.base;
 
        msm_gem_put_iova(val, kms->aspace);
-       drm_gem_object_unreference_unlocked(val);
+       drm_gem_object_put_unlocked(val);
 }
 
 static void mdp5_crtc_destroy(struct drm_crtc *crtc)
index d90ef1d..30cd514 100644 (file)
@@ -660,7 +660,7 @@ static int msm_ioctl_gem_cpu_prep(struct drm_device *dev, void *data,
 
        ret = msm_gem_cpu_prep(obj, args->op, &timeout);
 
-       drm_gem_object_unreference_unlocked(obj);
+       drm_gem_object_put_unlocked(obj);
 
        return ret;
 }
@@ -678,7 +678,7 @@ static int msm_ioctl_gem_cpu_fini(struct drm_device *dev, void *data,
 
        ret = msm_gem_cpu_fini(obj);
 
-       drm_gem_object_unreference_unlocked(obj);
+       drm_gem_object_put_unlocked(obj);
 
        return ret;
 }
@@ -718,7 +718,7 @@ static int msm_ioctl_gem_info(struct drm_device *dev, void *data,
                args->offset = msm_gem_mmap_offset(obj);
        }
 
-       drm_gem_object_unreference_unlocked(obj);
+       drm_gem_object_put_unlocked(obj);
 
        return ret;
 }
@@ -783,7 +783,7 @@ static int msm_ioctl_gem_madvise(struct drm_device *dev, void *data,
                ret = 0;
        }
 
-       drm_gem_object_unreference(obj);
+       drm_gem_object_put(obj);
 
 unlock:
        mutex_unlock(&dev->struct_mutex);
index fc175e7..0e0c872 100644 (file)
@@ -53,7 +53,7 @@ static void msm_framebuffer_destroy(struct drm_framebuffer *fb)
        for (i = 0; i < n; i++) {
                struct drm_gem_object *bo = msm_fb->planes[i];
 
-               drm_gem_object_unreference_unlocked(bo);
+               drm_gem_object_put_unlocked(bo);
        }
 
        kfree(msm_fb);
@@ -160,7 +160,7 @@ struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
 
 out_unref:
        for (i = 0; i < n; i++)
-               drm_gem_object_unreference_unlocked(bos[i]);
+               drm_gem_object_put_unlocked(bos[i]);
        return ERR_PTR(ret);
 }
 
@@ -274,7 +274,7 @@ msm_alloc_stolen_fb(struct drm_device *dev, int w, int h, int p, uint32_t format
                /* note: if fb creation failed, we can't rely on fb destroy
                 * to unref the bo:
                 */
-               drm_gem_object_unreference_unlocked(bo);
+               drm_gem_object_put_unlocked(bo);
                return ERR_CAST(fb);
        }
 
index 07376de..0e5073a 100644 (file)
@@ -470,7 +470,7 @@ int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
 
        *offset = msm_gem_mmap_offset(obj);
 
-       drm_gem_object_unreference_unlocked(obj);
+       drm_gem_object_put_unlocked(obj);
 
 fail:
        return ret;
@@ -854,7 +854,7 @@ int msm_gem_new_handle(struct drm_device *dev, struct drm_file *file,
        ret = drm_gem_handle_create(file, obj, handle);
 
        /* drop reference from allocate - handle holds it now */
-       drm_gem_object_unreference_unlocked(obj);
+       drm_gem_object_put_unlocked(obj);
 
        return ret;
 }
@@ -974,7 +974,7 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev,
        return obj;
 
 fail:
-       drm_gem_object_unreference_unlocked(obj);
+       drm_gem_object_put_unlocked(obj);
        return ERR_PTR(ret);
 }
 
@@ -1034,7 +1034,7 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev,
        return obj;
 
 fail:
-       drm_gem_object_unreference_unlocked(obj);
+       drm_gem_object_put_unlocked(obj);
        return ERR_PTR(ret);
 }
 
@@ -1052,7 +1052,7 @@ static void *_msm_gem_kernel_new(struct drm_device *dev, uint32_t size,
        if (iova) {
                ret = msm_gem_get_iova(obj, aspace, iova);
                if (ret) {
-                       drm_gem_object_unreference(obj);
+                       drm_gem_object_put(obj);
                        return ERR_PTR(ret);
                }
        }
@@ -1060,7 +1060,7 @@ static void *_msm_gem_kernel_new(struct drm_device *dev, uint32_t size,
        vaddr = msm_gem_get_vaddr(obj);
        if (IS_ERR(vaddr)) {
                msm_gem_put_iova(obj, aspace);
-               drm_gem_object_unreference(obj);
+               drm_gem_object_put(obj);
                return ERR_CAST(vaddr);
        }
 
index bd376f9..8078e4d 100644 (file)
@@ -552,7 +552,7 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
                /* move to inactive: */
                msm_gem_move_to_inactive(&msm_obj->base);
                msm_gem_put_iova(&msm_obj->base, gpu->aspace);
-               drm_gem_object_unreference(&msm_obj->base);
+               drm_gem_object_put(&msm_obj->base);
        }
 
        pm_runtime_mark_last_busy(&gpu->pdev->dev);
@@ -634,7 +634,7 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
                WARN_ON(is_active(msm_obj) && (msm_obj->gpu != gpu));
 
                /* submit takes a reference to the bo and iova until retired: */
-               drm_gem_object_reference(&msm_obj->base);
+               drm_gem_object_get(&msm_obj->base);
                msm_gem_get_iova(&msm_obj->base,
                                submit->gpu->aspace, &iova);
 
@@ -865,7 +865,7 @@ fail:
        if (gpu->memptrs_bo) {
                msm_gem_put_vaddr(gpu->memptrs_bo);
                msm_gem_put_iova(gpu->memptrs_bo, gpu->aspace);
-               drm_gem_object_unreference_unlocked(gpu->memptrs_bo);
+               drm_gem_object_put_unlocked(gpu->memptrs_bo);
        }
 
        platform_set_drvdata(pdev, NULL);
@@ -888,7 +888,7 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
        if (gpu->memptrs_bo) {
                msm_gem_put_vaddr(gpu->memptrs_bo);
                msm_gem_put_iova(gpu->memptrs_bo, gpu->aspace);
-               drm_gem_object_unreference_unlocked(gpu->memptrs_bo);
+               drm_gem_object_put_unlocked(gpu->memptrs_bo);
        }
 
        if (!IS_ERR_OR_NULL(gpu->aspace)) {
index 6ca98da..6f5295b 100644 (file)
@@ -76,7 +76,7 @@ void msm_ringbuffer_destroy(struct msm_ringbuffer *ring)
        if (ring->bo) {
                msm_gem_put_iova(ring->bo, ring->gpu->aspace);
                msm_gem_put_vaddr(ring->bo);
-               drm_gem_object_unreference_unlocked(ring->bo);
+               drm_gem_object_put_unlocked(ring->bo);
        }
        kfree(ring);
 }