Commit 57c7f581 authored by Daniel Stone's avatar Daniel Stone Committed by CK Hu

drm/mtk: mtk_drm_fb -> drm_framebuffer

Now that mtk_drm_fb is an empty wrapper around drm_framebuffer, we can
just delete it.
Signed-off-by: default avatarDaniel Stone <daniels@collabora.com>
Signed-off-by: default avatarCK Hu <ck.hu@mediatek.com>
Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
parent 548cb825
...@@ -23,49 +23,37 @@ ...@@ -23,49 +23,37 @@
#include "mtk_drm_fb.h" #include "mtk_drm_fb.h"
#include "mtk_drm_gem.h" #include "mtk_drm_gem.h"
/*
* mtk specific framebuffer structure.
*
* @fb: drm framebuffer object.
* @gem_obj: array of gem objects.
*/
struct mtk_drm_fb {
struct drm_framebuffer base;
};
#define to_mtk_fb(x) container_of(x, struct mtk_drm_fb, base)
static const struct drm_framebuffer_funcs mtk_drm_fb_funcs = { static const struct drm_framebuffer_funcs mtk_drm_fb_funcs = {
.create_handle = drm_gem_fb_create_handle, .create_handle = drm_gem_fb_create_handle,
.destroy = drm_gem_fb_destroy, .destroy = drm_gem_fb_destroy,
}; };
static struct mtk_drm_fb *mtk_drm_framebuffer_init(struct drm_device *dev, static struct drm_framebuffer *mtk_drm_framebuffer_init(struct drm_device *dev,
const struct drm_mode_fb_cmd2 *mode, const struct drm_mode_fb_cmd2 *mode,
struct drm_gem_object *obj) struct drm_gem_object *obj)
{ {
struct mtk_drm_fb *mtk_fb; struct drm_framebuffer *fb;
int ret; int ret;
if (drm_format_num_planes(mode->pixel_format) != 1) if (drm_format_num_planes(mode->pixel_format) != 1)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
mtk_fb = kzalloc(sizeof(*mtk_fb), GFP_KERNEL); fb = kzalloc(sizeof(*fb), GFP_KERNEL);
if (!mtk_fb) if (!fb)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
drm_helper_mode_fill_fb_struct(dev, &mtk_fb->base, mode); drm_helper_mode_fill_fb_struct(dev, fb, mode);
mtk_fb->base.obj[0] = obj; fb->obj[0] = obj;
ret = drm_framebuffer_init(dev, &mtk_fb->base, &mtk_drm_fb_funcs); ret = drm_framebuffer_init(dev, fb, &mtk_drm_fb_funcs);
if (ret) { if (ret) {
DRM_ERROR("failed to initialize framebuffer\n"); DRM_ERROR("failed to initialize framebuffer\n");
kfree(mtk_fb); kfree(fb);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
return mtk_fb; return fb;
} }
/* /*
...@@ -100,7 +88,7 @@ struct drm_framebuffer *mtk_drm_mode_fb_create(struct drm_device *dev, ...@@ -100,7 +88,7 @@ struct drm_framebuffer *mtk_drm_mode_fb_create(struct drm_device *dev,
struct drm_file *file, struct drm_file *file,
const struct drm_mode_fb_cmd2 *cmd) const struct drm_mode_fb_cmd2 *cmd)
{ {
struct mtk_drm_fb *mtk_fb; struct drm_framebuffer *fb;
struct drm_gem_object *gem; struct drm_gem_object *gem;
unsigned int width = cmd->width; unsigned int width = cmd->width;
unsigned int height = cmd->height; unsigned int height = cmd->height;
...@@ -123,13 +111,13 @@ struct drm_framebuffer *mtk_drm_mode_fb_create(struct drm_device *dev, ...@@ -123,13 +111,13 @@ struct drm_framebuffer *mtk_drm_mode_fb_create(struct drm_device *dev,
goto unreference; goto unreference;
} }
mtk_fb = mtk_drm_framebuffer_init(dev, cmd, gem); fb = mtk_drm_framebuffer_init(dev, cmd, gem);
if (IS_ERR(mtk_fb)) { if (IS_ERR(fb)) {
ret = PTR_ERR(mtk_fb); ret = PTR_ERR(fb);
goto unreference; goto unreference;
} }
return &mtk_fb->base; return fb;
unreference: unreference:
drm_gem_object_put_unlocked(gem); drm_gem_object_put_unlocked(gem);
......
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