mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/3] fb & fbconsole misc fixes
@ 2015-11-06  5:52 Antony Pavlov
  2015-11-06  5:52 ` [PATCH 1/3] fbconsole: no need to copy extra line Antony Pavlov
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Antony Pavlov @ 2015-11-06  5:52 UTC (permalink / raw)
  To: barebox

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(-)

-- 
2.6.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] fbconsole: no need to copy extra line
  2015-11-06  5:52 [PATCH 0/3] fb & fbconsole misc fixes Antony Pavlov
@ 2015-11-06  5:52 ` Antony Pavlov
  2015-11-06  5:52 ` [PATCH 2/3] fb: satisfy semantics for shadowfb's alloc/free Antony Pavlov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Antony Pavlov @ 2015-11-06  5:52 UTC (permalink / raw)
  To: barebox; +Cc: Aleksey Kuleshov

From: Aleksey Kuleshov <rndfax@yandex.ru>

Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
---
 drivers/video/fbconsole.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbconsole.c b/drivers/video/fbconsole.c
index b10503e..c38d13c 100644
--- a/drivers/video/fbconsole.c
+++ b/drivers/video/fbconsole.c
@@ -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;
 	}
-- 
2.6.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/3] fb: satisfy semantics for shadowfb's alloc/free
  2015-11-06  5:52 [PATCH 0/3] fb & fbconsole misc fixes Antony Pavlov
  2015-11-06  5:52 ` [PATCH 1/3] fbconsole: no need to copy extra line Antony Pavlov
@ 2015-11-06  5:52 ` Antony Pavlov
  2015-11-06  5:52 ` [PATCH 3/3] fb: alloc or free shadowfb whether fb enabled or disabled Antony Pavlov
  2015-11-06  6:35 ` [PATCH 0/3] fb & fbconsole misc fixes Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Antony Pavlov @ 2015-11-06  5:52 UTC (permalink / raw)
  To: barebox; +Cc: Aleksey Kuleshov

From: Aleksey Kuleshov <rndfax@yandex.ru>

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

Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
---
 drivers/video/fb.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index 3672c44..bd8bab0 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -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;
-- 
2.6.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/3] fb: alloc or free shadowfb whether fb enabled or disabled
  2015-11-06  5:52 [PATCH 0/3] fb & fbconsole misc fixes Antony Pavlov
  2015-11-06  5:52 ` [PATCH 1/3] fbconsole: no need to copy extra line Antony Pavlov
  2015-11-06  5:52 ` [PATCH 2/3] fb: satisfy semantics for shadowfb's alloc/free Antony Pavlov
@ 2015-11-06  5:52 ` Antony Pavlov
  2015-11-06  6:35 ` [PATCH 0/3] fb & fbconsole misc fixes Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Antony Pavlov @ 2015-11-06  5:52 UTC (permalink / raw)
  To: barebox; +Cc: Aleksey Kuleshov

From: Aleksey Kuleshov <rndfax@yandex.ru>

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

Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
---
 drivers/video/fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index bd8bab0..d159d60 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -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;
 }
-- 
2.6.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] fb & fbconsole misc fixes
  2015-11-06  5:52 [PATCH 0/3] fb & fbconsole misc fixes Antony Pavlov
                   ` (2 preceding siblings ...)
  2015-11-06  5:52 ` [PATCH 3/3] fb: alloc or free shadowfb whether fb enabled or disabled Antony Pavlov
@ 2015-11-06  6:35 ` Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2015-11-06  6:35 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Fri, Nov 06, 2015 at 08:52:16AM +0300, Antony Pavlov wrote:
> 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

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

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-06  6:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-06  5:52 [PATCH 0/3] fb & fbconsole misc fixes Antony Pavlov
2015-11-06  5:52 ` [PATCH 1/3] fbconsole: no need to copy extra line Antony Pavlov
2015-11-06  5:52 ` [PATCH 2/3] fb: satisfy semantics for shadowfb's alloc/free Antony Pavlov
2015-11-06  5:52 ` [PATCH 3/3] fb: alloc or free shadowfb whether fb enabled or disabled Antony Pavlov
2015-11-06  6:35 ` [PATCH 0/3] fb & fbconsole misc fixes Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox