Skip to contentSkip to conversation

efifb: fix framebuffer handoff

PATCH In review Marcin Slusarz 2 participants 2 messages Feb 13, 2010 – Feb 15, 2010 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efifb: fix framebuffer handoff

Commit 4410f3910947dcea8672280b3adecd53cec4e85e
(fbdev: add support for handoff from firmware to hw framebuffers) didn't add fb_destroy operation to efifb. Fix it and change aperture_size to match size passed to request_mem_region.

See: http://bugzilla.kernel.org/show_bug.cgi?id151

---
 drivers/video/efifb.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
drivers/video/efifb.c +10 -1
index eb12182..d25df51 100644
@@ -161,8 +161,17 @@ static int efifb_setcolreg(unsigned regno, unsigned red, unsigned green,
 	return 0;
 }
 
+static void efifb_destroy(struct fb_info *info)
+{
+	if (info->screen_base)
+		iounmap(info->screen_base);
+	release_mem_region(info->aperture_base, info->aperture_size);
+	framebuffer_release(info);
+}
+
 static struct fb_ops efifb_ops = {
 	.owner		= THIS_MODULE,
+	.fb_destroy	= efifb_destroy,
 	.fb_setcolreg	= efifb_setcolreg,
 	.fb_fillrect	= cfb_fillrect,
 	.fb_copyarea	= cfb_copyarea,
@@ -281,7 +290,7 @@ static int __init efifb_probe(struct platform_device *dev)
 	info->par = NULL;
 
 	info->aperture_base = efifb_fix.smem_start;
-	info->aperture_size = size_total;
+	info->aperture_size = size_remap;
 
 	info->screen_base = ioremap(efifb_fix.smem_start, efifb_fix.smem_len);
 	if (!info->screen_base) {
Signature · 1 line
1.6.6
#1 lore raw
Quoted 7 lines · Marcin Slusarz

Commit 4410f3910947dcea8672280b3adecd53cec4e85e
(fbdev: add support for handoff from firmware to hw framebuffers) didn't add fb_destroy operation to efifb. Fix it and change aperture_size to match size passed to request_mem_region.

See: http://bugzilla.kernel.org/show_bug.cgi?id151

Quoted 7 lines

Looks good.

Acked by: Peter Jones <[email protected]>

Quoted 35 lines
---
 drivers/video/efifb.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
drivers/video/efifb.c +10 -1
index eb12182..d25df51 100644
@@ -161,8 +161,17 @@ static int efifb_setcolreg(unsigned regno, unsigned red, unsigned green,
 	return 0;
 }
 
+static void efifb_destroy(struct fb_info *info)
+{
+	if (info->screen_base)
+		iounmap(info->screen_base);
+	release_mem_region(info->aperture_base, info->aperture_size);
+	framebuffer_release(info);
+}
+
 static struct fb_ops efifb_ops = {
 	.owner		= THIS_MODULE,
+	.fb_destroy	= efifb_destroy,
 	.fb_setcolreg	= efifb_setcolreg,
 	.fb_fillrect	= cfb_fillrect,
 	.fb_copyarea	= cfb_copyarea,
@@ -281,7 +290,7 @@ static int __init efifb_probe(struct platform_device *dev)
 	info->par = NULL;
 
 	info->aperture_base = efifb_fix.smem_start;
-	info->aperture_size = size_total;
+	info->aperture_size = size_remap;
 
 	info->screen_base = ioremap(efifb_fix.smem_start, efifb_fix.smem_len);
 	if (!info->screen_base) {
Signature · 6 lines
        Peter

Computer games don't affect kids; I mean if Pac-Man affected us as
kids, we'd all be running around in darkened rooms, munching magic
pills and listening to repetitive electronic music.
		-- Not actually Kristian Wilson, Nintendo, Inc, 1989