Commit dc9a9b32 authored by Steve Kowalik's avatar Steve Kowalik Committed by Rob Clark

drm/msm: Replace gem_object deprecated functions

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: default avatarSteve Kowalik <steven@wedontsleep.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent cccb9723
...@@ -858,19 +858,19 @@ static void a5xx_destroy(struct msm_gpu *gpu) ...@@ -858,19 +858,19 @@ static void a5xx_destroy(struct msm_gpu *gpu)
if (a5xx_gpu->pm4_bo) { if (a5xx_gpu->pm4_bo) {
if (a5xx_gpu->pm4_iova) if (a5xx_gpu->pm4_iova)
msm_gem_put_iova(a5xx_gpu->pm4_bo, gpu->aspace); 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_bo) {
if (a5xx_gpu->pfp_iova) if (a5xx_gpu->pfp_iova)
msm_gem_put_iova(a5xx_gpu->pfp_bo, gpu->aspace); 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_bo) {
if (a5xx_gpu->gpmu_iova) if (a5xx_gpu->gpmu_iova)
msm_gem_put_iova(a5xx_gpu->gpmu_bo, gpu->aspace); 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); adreno_gpu_cleanup(adreno_gpu);
......
...@@ -129,7 +129,7 @@ static void unref_cursor_worker(struct drm_flip_work *work, void *val) ...@@ -129,7 +129,7 @@ static void unref_cursor_worker(struct drm_flip_work *work, void *val)
struct msm_kms *kms = &mdp4_kms->base.base; struct msm_kms *kms = &mdp4_kms->base.base;
msm_gem_put_iova(val, kms->aspace); 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) static void mdp4_crtc_destroy(struct drm_crtc *crtc)
...@@ -382,7 +382,7 @@ static void update_cursor(struct drm_crtc *crtc) ...@@ -382,7 +382,7 @@ static void update_cursor(struct drm_crtc *crtc)
if (next_bo) { if (next_bo) {
/* take a obj ref + iova ref when we start scanning out: */ /* 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); msm_gem_get_iova(next_bo, kms->aspace, &iova);
/* enable cursor: */ /* enable cursor: */
...@@ -467,7 +467,7 @@ static int mdp4_crtc_cursor_set(struct drm_crtc *crtc, ...@@ -467,7 +467,7 @@ static int mdp4_crtc_cursor_set(struct drm_crtc *crtc,
return 0; return 0;
fail: fail:
drm_gem_object_unreference_unlocked(cursor_bo); drm_gem_object_put_unlocked(cursor_bo);
return ret; return ret;
} }
......
...@@ -164,7 +164,7 @@ static void mdp4_destroy(struct msm_kms *kms) ...@@ -164,7 +164,7 @@ static void mdp4_destroy(struct msm_kms *kms)
if (mdp4_kms->blank_cursor_iova) if (mdp4_kms->blank_cursor_iova)
msm_gem_put_iova(mdp4_kms->blank_cursor_bo, kms->aspace); 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) { if (aspace) {
aspace->mmu->funcs->detach(aspace->mmu, aspace->mmu->funcs->detach(aspace->mmu,
......
...@@ -170,7 +170,7 @@ static void unref_cursor_worker(struct drm_flip_work *work, void *val) ...@@ -170,7 +170,7 @@ static void unref_cursor_worker(struct drm_flip_work *work, void *val)
struct msm_kms *kms = &mdp5_kms->base.base; struct msm_kms *kms = &mdp5_kms->base.base;
msm_gem_put_iova(val, kms->aspace); 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) static void mdp5_crtc_destroy(struct drm_crtc *crtc)
......
...@@ -660,7 +660,7 @@ static int msm_ioctl_gem_cpu_prep(struct drm_device *dev, void *data, ...@@ -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); ret = msm_gem_cpu_prep(obj, args->op, &timeout);
drm_gem_object_unreference_unlocked(obj); drm_gem_object_put_unlocked(obj);
return ret; return ret;
} }
...@@ -678,7 +678,7 @@ static int msm_ioctl_gem_cpu_fini(struct drm_device *dev, void *data, ...@@ -678,7 +678,7 @@ static int msm_ioctl_gem_cpu_fini(struct drm_device *dev, void *data,
ret = msm_gem_cpu_fini(obj); ret = msm_gem_cpu_fini(obj);
drm_gem_object_unreference_unlocked(obj); drm_gem_object_put_unlocked(obj);
return ret; return ret;
} }
...@@ -718,7 +718,7 @@ static int msm_ioctl_gem_info(struct drm_device *dev, void *data, ...@@ -718,7 +718,7 @@ static int msm_ioctl_gem_info(struct drm_device *dev, void *data,
args->offset = msm_gem_mmap_offset(obj); args->offset = msm_gem_mmap_offset(obj);
} }
drm_gem_object_unreference_unlocked(obj); drm_gem_object_put_unlocked(obj);
return ret; return ret;
} }
...@@ -783,7 +783,7 @@ static int msm_ioctl_gem_madvise(struct drm_device *dev, void *data, ...@@ -783,7 +783,7 @@ static int msm_ioctl_gem_madvise(struct drm_device *dev, void *data,
ret = 0; ret = 0;
} }
drm_gem_object_unreference(obj); drm_gem_object_put(obj);
unlock: unlock:
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
......
...@@ -53,7 +53,7 @@ static void msm_framebuffer_destroy(struct drm_framebuffer *fb) ...@@ -53,7 +53,7 @@ static void msm_framebuffer_destroy(struct drm_framebuffer *fb)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
struct drm_gem_object *bo = msm_fb->planes[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); kfree(msm_fb);
...@@ -160,7 +160,7 @@ struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev, ...@@ -160,7 +160,7 @@ struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
out_unref: out_unref:
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
drm_gem_object_unreference_unlocked(bos[i]); drm_gem_object_put_unlocked(bos[i]);
return ERR_PTR(ret); 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 ...@@ -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 /* note: if fb creation failed, we can't rely on fb destroy
* to unref the bo: * to unref the bo:
*/ */
drm_gem_object_unreference_unlocked(bo); drm_gem_object_put_unlocked(bo);
return ERR_CAST(fb); return ERR_CAST(fb);
} }
......
...@@ -470,7 +470,7 @@ int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, ...@@ -470,7 +470,7 @@ int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
*offset = msm_gem_mmap_offset(obj); *offset = msm_gem_mmap_offset(obj);
drm_gem_object_unreference_unlocked(obj); drm_gem_object_put_unlocked(obj);
fail: fail:
return ret; return ret;
...@@ -854,7 +854,7 @@ int msm_gem_new_handle(struct drm_device *dev, struct drm_file *file, ...@@ -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); ret = drm_gem_handle_create(file, obj, handle);
/* drop reference from allocate - handle holds it now */ /* drop reference from allocate - handle holds it now */
drm_gem_object_unreference_unlocked(obj); drm_gem_object_put_unlocked(obj);
return ret; return ret;
} }
...@@ -974,7 +974,7 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev, ...@@ -974,7 +974,7 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev,
return obj; return obj;
fail: fail:
drm_gem_object_unreference_unlocked(obj); drm_gem_object_put_unlocked(obj);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
...@@ -1034,7 +1034,7 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev, ...@@ -1034,7 +1034,7 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev,
return obj; return obj;
fail: fail:
drm_gem_object_unreference_unlocked(obj); drm_gem_object_put_unlocked(obj);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
...@@ -1052,7 +1052,7 @@ static void *_msm_gem_kernel_new(struct drm_device *dev, uint32_t size, ...@@ -1052,7 +1052,7 @@ static void *_msm_gem_kernel_new(struct drm_device *dev, uint32_t size,
if (iova) { if (iova) {
ret = msm_gem_get_iova(obj, aspace, iova); ret = msm_gem_get_iova(obj, aspace, iova);
if (ret) { if (ret) {
drm_gem_object_unreference(obj); drm_gem_object_put(obj);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
} }
...@@ -1060,7 +1060,7 @@ static void *_msm_gem_kernel_new(struct drm_device *dev, uint32_t size, ...@@ -1060,7 +1060,7 @@ static void *_msm_gem_kernel_new(struct drm_device *dev, uint32_t size,
vaddr = msm_gem_get_vaddr(obj); vaddr = msm_gem_get_vaddr(obj);
if (IS_ERR(vaddr)) { if (IS_ERR(vaddr)) {
msm_gem_put_iova(obj, aspace); msm_gem_put_iova(obj, aspace);
drm_gem_object_unreference(obj); drm_gem_object_put(obj);
return ERR_CAST(vaddr); return ERR_CAST(vaddr);
} }
......
...@@ -552,7 +552,7 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) ...@@ -552,7 +552,7 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
/* move to inactive: */ /* move to inactive: */
msm_gem_move_to_inactive(&msm_obj->base); msm_gem_move_to_inactive(&msm_obj->base);
msm_gem_put_iova(&msm_obj->base, gpu->aspace); 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); 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, ...@@ -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)); WARN_ON(is_active(msm_obj) && (msm_obj->gpu != gpu));
/* submit takes a reference to the bo and iova until retired: */ /* 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, msm_gem_get_iova(&msm_obj->base,
submit->gpu->aspace, &iova); submit->gpu->aspace, &iova);
...@@ -865,7 +865,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, ...@@ -865,7 +865,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
if (gpu->memptrs_bo) { if (gpu->memptrs_bo) {
msm_gem_put_vaddr(gpu->memptrs_bo); msm_gem_put_vaddr(gpu->memptrs_bo);
msm_gem_put_iova(gpu->memptrs_bo, gpu->aspace); 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); platform_set_drvdata(pdev, NULL);
...@@ -888,7 +888,7 @@ void msm_gpu_cleanup(struct msm_gpu *gpu) ...@@ -888,7 +888,7 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
if (gpu->memptrs_bo) { if (gpu->memptrs_bo) {
msm_gem_put_vaddr(gpu->memptrs_bo); msm_gem_put_vaddr(gpu->memptrs_bo);
msm_gem_put_iova(gpu->memptrs_bo, gpu->aspace); 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)) { if (!IS_ERR_OR_NULL(gpu->aspace)) {
......
...@@ -76,7 +76,7 @@ void msm_ringbuffer_destroy(struct msm_ringbuffer *ring) ...@@ -76,7 +76,7 @@ void msm_ringbuffer_destroy(struct msm_ringbuffer *ring)
if (ring->bo) { if (ring->bo) {
msm_gem_put_iova(ring->bo, ring->gpu->aspace); msm_gem_put_iova(ring->bo, ring->gpu->aspace);
msm_gem_put_vaddr(ring->bo); msm_gem_put_vaddr(ring->bo);
drm_gem_object_unreference_unlocked(ring->bo); drm_gem_object_put_unlocked(ring->bo);
} }
kfree(ring); kfree(ring);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment