Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/armada: Use new drm_fb_helper functions

Use the newly created wrapper drm_fb_helper functions instead of calling
core fbdev functions directly. They also simplify the fb_info creation.

Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

authored by

Archit Taneja and committed by
Daniel Vetter
e8b70e4d df3b031c

+10 -23
+10 -23
drivers/gpu/drm/armada/armada_fbdev.c
··· 22 22 .owner = THIS_MODULE, 23 23 .fb_check_var = drm_fb_helper_check_var, 24 24 .fb_set_par = drm_fb_helper_set_par, 25 - .fb_fillrect = cfb_fillrect, 26 - .fb_copyarea = cfb_copyarea, 27 - .fb_imageblit = cfb_imageblit, 25 + .fb_fillrect = drm_fb_helper_cfb_fillrect, 26 + .fb_copyarea = drm_fb_helper_cfb_copyarea, 27 + .fb_imageblit = drm_fb_helper_cfb_imageblit, 28 28 .fb_pan_display = drm_fb_helper_pan_display, 29 29 .fb_blank = drm_fb_helper_blank, 30 30 .fb_setcmap = drm_fb_helper_setcmap, ··· 80 80 if (IS_ERR(dfb)) 81 81 return PTR_ERR(dfb); 82 82 83 - info = framebuffer_alloc(0, dev->dev); 84 - if (!info) { 85 - ret = -ENOMEM; 83 + info = drm_fb_helper_alloc_fbi(fbh); 84 + if (IS_ERR(info)) { 85 + ret = PTR_ERR(info); 86 86 goto err_fballoc; 87 - } 88 - 89 - ret = fb_alloc_cmap(&info->cmap, 256, 0); 90 - if (ret) { 91 - ret = -ENOMEM; 92 - goto err_fbcmap; 93 87 } 94 88 95 89 strlcpy(info->fix.id, "armada-drmfb", sizeof(info->fix.id)); ··· 95 101 info->screen_size = obj->obj.size; 96 102 info->screen_base = ptr; 97 103 fbh->fb = &dfb->fb; 98 - fbh->fbdev = info; 104 + 99 105 drm_fb_helper_fill_fix(info, dfb->fb.pitches[0], dfb->fb.depth); 100 106 drm_fb_helper_fill_var(info, fbh, sizes->fb_width, sizes->fb_height); 101 107 ··· 105 111 106 112 return 0; 107 113 108 - err_fbcmap: 109 - framebuffer_release(info); 110 114 err_fballoc: 111 115 dfb->fb.funcs->destroy(&dfb->fb); 112 116 return ret; ··· 163 171 164 172 return 0; 165 173 err_fb_setup: 174 + drm_fb_helper_release_fbi(fbh); 166 175 drm_fb_helper_fini(fbh); 167 176 err_fb_helper: 168 177 priv->fbdev = NULL; ··· 184 191 struct drm_fb_helper *fbh = priv->fbdev; 185 192 186 193 if (fbh) { 187 - struct fb_info *info = fbh->fbdev; 188 - 189 - if (info) { 190 - unregister_framebuffer(info); 191 - if (info->cmap.len) 192 - fb_dealloc_cmap(&info->cmap); 193 - framebuffer_release(info); 194 - } 194 + drm_fb_helper_unregister_fbi(fbh); 195 + drm_fb_helper_release_fbi(fbh); 195 196 196 197 drm_fb_helper_fini(fbh); 197 198