Commit 57778075 authored by Jani Nikula's avatar Jani Nikula

drm/fb-helper: don't preserve fb_ops across deferred IO use

Deferred IO now preserves the fb_ops.

v2: Remove the no-op vfree, drop a local var  (Noralf)

Cc: Noralf Trønnes <noralf@tronnes.org>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1eae0b23d4724d5702b886b6a061ec8219eb9284.1575022735.git.jani.nikula@intel.com
parent 12281c8d
...@@ -1954,7 +1954,6 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user) ...@@ -1954,7 +1954,6 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user)
static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper) static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)
{ {
struct fb_info *fbi = fb_helper->fbdev; struct fb_info *fbi = fb_helper->fbdev;
struct fb_ops *fbops = NULL;
void *shadow = NULL; void *shadow = NULL;
if (!fb_helper->dev) if (!fb_helper->dev)
...@@ -1963,15 +1962,11 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper) ...@@ -1963,15 +1962,11 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)
if (fbi && fbi->fbdefio) { if (fbi && fbi->fbdefio) {
fb_deferred_io_cleanup(fbi); fb_deferred_io_cleanup(fbi);
shadow = fbi->screen_buffer; shadow = fbi->screen_buffer;
fbops = fbi->fbops;
} }
drm_fb_helper_fini(fb_helper); drm_fb_helper_fini(fb_helper);
if (shadow) { vfree(shadow);
vfree(shadow);
kfree(fbops);
}
drm_client_framebuffer_delete(fb_helper->buffer); drm_client_framebuffer_delete(fb_helper->buffer);
} }
...@@ -2062,24 +2057,10 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, ...@@ -2062,24 +2057,10 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,
drm_fb_helper_fill_info(fbi, fb_helper, sizes); drm_fb_helper_fill_info(fbi, fb_helper, sizes);
if (drm_fbdev_use_shadow_fb(fb_helper)) { if (drm_fbdev_use_shadow_fb(fb_helper)) {
struct fb_ops *fbops; fbi->screen_buffer = vzalloc(fbi->screen_size);
void *shadow; if (!fbi->screen_buffer)
/*
* fb_deferred_io_cleanup() clears &fbops->fb_mmap so a per
* instance version is necessary.
*/
fbops = kzalloc(sizeof(*fbops), GFP_KERNEL);
shadow = vzalloc(fbi->screen_size);
if (!fbops || !shadow) {
kfree(fbops);
vfree(shadow);
return -ENOMEM; return -ENOMEM;
}
*fbops = *fbi->fbops;
fbi->fbops = fbops;
fbi->screen_buffer = shadow;
fbi->fbdefio = &drm_fbdev_defio; fbi->fbdefio = &drm_fbdev_defio;
fb_deferred_io_init(fbi); fb_deferred_io_init(fbi);
......
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