|
@@ -43,11 +43,11 @@ static struct fb_ops msm_fb_ops = {
|
|
/* Note: to properly handle manual update displays, we wrap the
|
|
/* Note: to properly handle manual update displays, we wrap the
|
|
* basic fbdev ops which write to the framebuffer
|
|
* basic fbdev ops which write to the framebuffer
|
|
*/
|
|
*/
|
|
- .fb_read = fb_sys_read,
|
|
|
|
- .fb_write = fb_sys_write,
|
|
|
|
- .fb_fillrect = sys_fillrect,
|
|
|
|
- .fb_copyarea = sys_copyarea,
|
|
|
|
- .fb_imageblit = sys_imageblit,
|
|
|
|
|
|
+ .fb_read = drm_fb_helper_sys_read,
|
|
|
|
+ .fb_write = drm_fb_helper_sys_write,
|
|
|
|
+ .fb_fillrect = drm_fb_helper_sys_fillrect,
|
|
|
|
+ .fb_copyarea = drm_fb_helper_sys_copyarea,
|
|
|
|
+ .fb_imageblit = drm_fb_helper_sys_imageblit,
|
|
.fb_mmap = msm_fbdev_mmap,
|
|
.fb_mmap = msm_fbdev_mmap,
|
|
|
|
|
|
.fb_check_var = drm_fb_helper_check_var,
|
|
.fb_check_var = drm_fb_helper_check_var,
|
|
@@ -144,10 +144,10 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
|
|
goto fail_unlock;
|
|
goto fail_unlock;
|
|
}
|
|
}
|
|
|
|
|
|
- fbi = framebuffer_alloc(0, dev->dev);
|
|
|
|
- if (!fbi) {
|
|
|
|
|
|
+ fbi = drm_fb_helper_alloc_fbi(helper);
|
|
|
|
+ if (IS_ERR(fbi)) {
|
|
dev_err(dev->dev, "failed to allocate fb info\n");
|
|
dev_err(dev->dev, "failed to allocate fb info\n");
|
|
- ret = -ENOMEM;
|
|
|
|
|
|
+ ret = PTR_ERR(fbi);
|
|
goto fail_unlock;
|
|
goto fail_unlock;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -155,7 +155,6 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
|
|
|
|
|
|
fbdev->fb = fb;
|
|
fbdev->fb = fb;
|
|
helper->fb = fb;
|
|
helper->fb = fb;
|
|
- helper->fbdev = fbi;
|
|
|
|
|
|
|
|
fbi->par = helper;
|
|
fbi->par = helper;
|
|
fbi->flags = FBINFO_DEFAULT;
|
|
fbi->flags = FBINFO_DEFAULT;
|
|
@@ -163,12 +162,6 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
|
|
|
|
|
|
strcpy(fbi->fix.id, "msm");
|
|
strcpy(fbi->fix.id, "msm");
|
|
|
|
|
|
- ret = fb_alloc_cmap(&fbi->cmap, 256, 0);
|
|
|
|
- if (ret) {
|
|
|
|
- ret = -ENOMEM;
|
|
|
|
- goto fail_unlock;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth);
|
|
drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth);
|
|
drm_fb_helper_fill_var(fbi, helper, sizes->fb_width, sizes->fb_height);
|
|
drm_fb_helper_fill_var(fbi, helper, sizes->fb_width, sizes->fb_height);
|
|
|
|
|
|
@@ -191,7 +184,6 @@ fail_unlock:
|
|
fail:
|
|
fail:
|
|
|
|
|
|
if (ret) {
|
|
if (ret) {
|
|
- framebuffer_release(fbi);
|
|
|
|
if (fb) {
|
|
if (fb) {
|
|
drm_framebuffer_unregister_private(fb);
|
|
drm_framebuffer_unregister_private(fb);
|
|
drm_framebuffer_remove(fb);
|
|
drm_framebuffer_remove(fb);
|
|
@@ -266,17 +258,11 @@ void msm_fbdev_free(struct drm_device *dev)
|
|
struct msm_drm_private *priv = dev->dev_private;
|
|
struct msm_drm_private *priv = dev->dev_private;
|
|
struct drm_fb_helper *helper = priv->fbdev;
|
|
struct drm_fb_helper *helper = priv->fbdev;
|
|
struct msm_fbdev *fbdev;
|
|
struct msm_fbdev *fbdev;
|
|
- struct fb_info *fbi;
|
|
|
|
|
|
|
|
DBG();
|
|
DBG();
|
|
|
|
|
|
- fbi = helper->fbdev;
|
|
|
|
-
|
|
|
|
- /* only cleanup framebuffer if it is present */
|
|
|
|
- if (fbi) {
|
|
|
|
- unregister_framebuffer(fbi);
|
|
|
|
- framebuffer_release(fbi);
|
|
|
|
- }
|
|
|
|
|
|
+ drm_fb_helper_unregister_fbi(helper);
|
|
|
|
+ drm_fb_helper_release_fbi(helper);
|
|
|
|
|
|
drm_fb_helper_fini(helper);
|
|
drm_fb_helper_fini(helper);
|
|
|
|
|