Skip to contentSkip to conversation

fb & fbconsole misc fixes

PATCH Applied Antony Pavlov 2 participants 5 messages Nov 6, 2015 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

cover fb & fbconsole misc fixes

Aleksey Kuleshov (3):
fbconsole: no need to copy extra line
fb: satisfy semantics for shadowfb's alloc/free
fb: alloc or free shadowfb whether fb enabled or disabled

 drivers/video/fb.c        | 15 +++++++++++----
 drivers/video/fbconsole.c |  3 ++-
 2 files changed, 13 insertions(+), 5 deletions(-)
Signature · 7 lines
2.6.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 1/3 fbconsole: no need to copy extra line

From: Aleksey Kuleshov <[email protected]>

---
 drivers/video/fbconsole.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/fbconsole.c +2 -1
index b10503e..c38d13c 100644
@@ -192,8 +192,9 @@ static void printchar(struct fbc_priv *priv, int c)
 
 		buf = gui_screen_render_buffer(priv->sc);
 
-		memcpy(buf, buf + line_height, line_height * (priv->rows + 1));
+		memcpy(buf, buf + line_height, line_height * priv->rows);
 		memset(buf + line_height * priv->rows, 0, line_height);
+
 		gu_screen_blit(priv->sc);
 		priv->y = priv->rows;
 	}
Signature · 7 lines
2.6.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/3 fb: satisfy semantics for shadowfb's alloc/free

In reply to Antony Pavlov

From: Aleksey Kuleshov <[email protected]>

Console enable -> alloc shadowfb.
Console disable -> free shadowfb.
Otherwise, if resolution gets changed, shadowfb will not be affected.

---
 drivers/video/fb.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/video/fb.c +9 -2
index 3672c44..bd8bab0 100644
@@ -31,6 +31,12 @@ static int fb_ioctl(struct cdev* cdev, int req, void *data)
 	return 0;
 }
 
+static void fb_release_shadowfb(struct fb_info *info)
+{
+	free(info->screen_base_shadow);
+	info->screen_base_shadow = NULL;
+}
+
 static int fb_alloc_shadowfb(struct fb_info *info)
 {
 	if (info->screen_base_shadow && info->shadowfb)
@@ -47,8 +53,7 @@ static int fb_alloc_shadowfb(struct fb_info *info)
 		memcpy(info->screen_base_shadow, info->screen_base,
 				info->line_length * info->yres);
 	} else {
-		free(info->screen_base_shadow);
-		info->screen_base_shadow = NULL;
+		fb_release_shadowfb(info);
 	}
 
 	return 0;
@@ -79,6 +84,8 @@ int fb_disable(struct fb_info *info)
 
 	info->fbops->fb_disable(info);
 
+	fb_release_shadowfb(info);
+
 	info->enabled = false;
 
 	return 0;
Signature · 7 lines
2.6.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/3 fb: alloc or free shadowfb whether fb enabled or disabled

In reply to Antony Pavlov

From: Aleksey Kuleshov <[email protected]>

Resolution can't be changed anyway once fb_enable() has been called, since no corresponding fb_disable() call appears in the code.

---
 drivers/video/fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fb.c +2 -2
index bd8bab0..d159d60 100644
@@ -99,9 +99,9 @@ static int fb_enable_set(struct param_d *param, void *priv)
 	enable = info->p_enable;
 
 	if (enable)
-		info->fbops->fb_enable(info);
+		fb_enable(info);
 	else
-		info->fbops->fb_disable(info);
+		fb_disable(info);
 
 	return 0;
 }
Signature · 7 lines
2.6.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#4 lore raw
In reply to Antony Pavlov
Quoted 4 lines · Antony Pavlov

Aleksey Kuleshov (3):
fbconsole: no need to copy extra line
fb: satisfy semantics for shadowfb's alloc/free
fb: alloc or free shadowfb whether fb enabled or disabled

Applied, thanks

Sascha

Quoted 9 lines
 drivers/video/fb.c        | 15 +++++++++++----
 drivers/video/fbconsole.c |  3 ++-
 2 files changed, 13 insertions(+), 5 deletions(-)
Signature · 1 line
2.6.2
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox