Commit 50cbc132 authored by Eric Anholt's avatar Eric Anholt Committed by Daniel Vetter

drm: Use the driver's gem_object_free function from CMA helpers.

VC4 wraps the CMA objects in its own structures, so it needs to do its
own teardown (waiting for GPU to finish, updating bo_stats tracking).
The other CMA drivers are using drm_gem_cma_free_object as their
gem_free_object, so this should be a no-op for them.
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 6cecdf7a
...@@ -266,7 +266,7 @@ static int drm_fbdev_cma_create(struct drm_fb_helper *helper, ...@@ -266,7 +266,7 @@ static int drm_fbdev_cma_create(struct drm_fb_helper *helper,
fbi = drm_fb_helper_alloc_fbi(helper); fbi = drm_fb_helper_alloc_fbi(helper);
if (IS_ERR(fbi)) { if (IS_ERR(fbi)) {
ret = PTR_ERR(fbi); ret = PTR_ERR(fbi);
goto err_drm_gem_cma_free_object; goto err_gem_free_object;
} }
fbdev_cma->fb = drm_fb_cma_alloc(dev, &mode_cmd, &obj, 1); fbdev_cma->fb = drm_fb_cma_alloc(dev, &mode_cmd, &obj, 1);
...@@ -299,8 +299,8 @@ static int drm_fbdev_cma_create(struct drm_fb_helper *helper, ...@@ -299,8 +299,8 @@ static int drm_fbdev_cma_create(struct drm_fb_helper *helper,
err_fb_info_destroy: err_fb_info_destroy:
drm_fb_helper_release_fbi(helper); drm_fb_helper_release_fbi(helper);
err_drm_gem_cma_free_object: err_gem_free_object:
drm_gem_cma_free_object(&obj->base); dev->driver->gem_free_object(&obj->base);
return ret; return ret;
} }
......
...@@ -121,7 +121,7 @@ struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm, ...@@ -121,7 +121,7 @@ struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm,
return cma_obj; return cma_obj;
error: error:
drm_gem_cma_free_object(&cma_obj->base); drm->driver->gem_free_object(&cma_obj->base);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
EXPORT_SYMBOL_GPL(drm_gem_cma_create); EXPORT_SYMBOL_GPL(drm_gem_cma_create);
...@@ -171,7 +171,7 @@ drm_gem_cma_create_with_handle(struct drm_file *file_priv, ...@@ -171,7 +171,7 @@ drm_gem_cma_create_with_handle(struct drm_file *file_priv,
return cma_obj; return cma_obj;
err_handle_create: err_handle_create:
drm_gem_cma_free_object(gem_obj); drm->driver->gem_free_object(gem_obj);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
......
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