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 fa08b4897a5602d5f07642e169348a10a4b8ded2..795fe11a93715e932088ff39dcfbe77ccb0c22c5 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 14bd3bd3e040076e2f6a5678e0c65ee4837eb7f4..6e5e1aa54ce19774340bd752785f25b8dcd20389 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 f7f087419ed8bc936df5d461f9d3e98a09a50ea0..4b646bf9c2146329fa8bde9763537d0186f82b07 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 e414850dbbdac72dbafae9277ad483ff000329ed..8c5ed0b59e46f89e73e255d14dbb0066b883de9f 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 d90ef1d78a1b3f4bbe9acb305c85d5ac1958a47a..30cd514d8f7c7ad697b3e3d52b45091375ea097d 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 fc175e724ad63c3dd602a2ef3e3ece254168077a..0e0c87252ab07c9777cd5f623e71d92c86ea0175 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 07376de9ff4cca630fb03cf1035e5be31b2ffbe8..0e5073af391344f681226020e8489c7a43a9944d 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 bd376f9e18a7791105f923a6ebe34cb2359e4a22..8078e4d52fe044d054c5f44120c6cd45b252245c 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 6ca98da35f633ea720488e43a01f10db62a74c46..6f5295b3f2f69b0afc47bdae9552cd3356246be5 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);
 }