.fb_destroy = exynos_drm_fb_destroy,
};
-static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
- struct drm_fb_helper_surface_size *sizes,
- struct exynos_drm_gem *exynos_gem)
-{
- struct fb_info *fbi = helper->info;
- struct drm_framebuffer *fb = helper->fb;
- unsigned int size = fb->width * fb->height * fb->format->cpp[0];
-
- fbi->fbops = &exynos_drm_fb_ops;
-
- drm_fb_helper_fill_info(fbi, helper, sizes);
-
- fbi->flags |= FBINFO_VIRTFB;
- fbi->screen_buffer = exynos_gem->kvaddr;
- fbi->screen_size = size;
- fbi->fix.smem_len = size;
-
- return 0;
-}
-
static const struct drm_fb_helper_funcs exynos_drm_fbdev_helper_funcs = {
};
{
struct exynos_drm_gem *exynos_gem;
struct drm_device *dev = helper->dev;
+ struct fb_info *info = helper->info;
struct drm_mode_fb_cmd2 mode_cmd = { 0 };
unsigned long size;
int ret;
}
helper->funcs = &exynos_drm_fbdev_helper_funcs;
- ret = exynos_drm_fbdev_update(helper, sizes, exynos_gem);
- if (ret < 0)
- goto err_destroy_framebuffer;
+ info->fbops = &exynos_drm_fb_ops;
+
+ drm_fb_helper_fill_info(info, helper, sizes);
+
+ info->flags |= FBINFO_VIRTFB;
+ info->screen_buffer = exynos_gem->kvaddr;
+ info->screen_size = size;
+ info->fix.smem_len = size;
return 0;
-err_destroy_framebuffer:
- drm_framebuffer_cleanup(helper->fb);
- helper->fb = NULL;
err_destroy_gem:
exynos_drm_gem_destroy(exynos_gem);
return ret;