diff mbox

[U-Boot,09/11] video: Fix cfb_console for 4-bit wide font

Message ID 1375220281-11132-10-git-send-email-marex@denx.de
State Accepted
Delegated to: Anatolij Gustschin
Headers show

Commit Message

Marek Vasut July 30, 2013, 9:37 p.m. UTC
The cfb_console can't handle 4-bit wide font properly, since with
4-bit wide font, all 8 bits are drawn. Unbreak the video_drawchars()
function to correctly render 4-bits only on such fonts.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
---
 drivers/video/cfb_console.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

Anatolij Gustschin Aug. 10, 2013, 7:24 a.m. UTC | #1
On Tue, 30 Jul 2013 23:37:59 +0200
Marek Vasut <marex@denx.de> wrote:

> The cfb_console can't handle 4-bit wide font properly, since with
> 4-bit wide font, all 8 bits are drawn. Unbreak the video_drawchars()
> function to correctly render 4-bits only on such fonts.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Anatolij Gustschin <agust@denx.de>
> ---
>  drivers/video/cfb_console.c |   21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)

Applied to u-boot-video/master. Thanks!

Anatolij
diff mbox

Patch

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index edac91c..9110eb5 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -467,6 +467,10 @@  static void video_drawchars(int xx, int yy, unsigned char *s, int count)
 				((u32 *) dest)[0] =
 					(video_font_draw_table8[bits >> 4] &
 					 eorx) ^ bgx;
+
+				if (VIDEO_FONT_WIDTH == 4)
+					continue;
+
 				((u32 *) dest)[1] =
 					(video_font_draw_table8[bits & 15] &
 					 eorx) ^ bgx;
@@ -492,6 +496,10 @@  static void video_drawchars(int xx, int yy, unsigned char *s, int count)
 					SHORTSWAP32((video_font_draw_table15
 						     [bits >> 4 & 3] & eorx) ^
 						    bgx);
+
+				if (VIDEO_FONT_WIDTH == 4)
+					continue;
+
 				((u32 *) dest)[2] =
 					SHORTSWAP32((video_font_draw_table15
 						     [bits >> 2 & 3] & eorx) ^
@@ -522,6 +530,10 @@  static void video_drawchars(int xx, int yy, unsigned char *s, int count)
 					SHORTSWAP32((video_font_draw_table16
 						     [bits >> 4 & 3] & eorx) ^
 						    bgx);
+
+				if (VIDEO_FONT_WIDTH == 4)
+					continue;
+
 				((u32 *) dest)[2] =
 					SHORTSWAP32((video_font_draw_table16
 						     [bits >> 2 & 3] & eorx) ^
@@ -556,6 +568,11 @@  static void video_drawchars(int xx, int yy, unsigned char *s, int count)
 				((u32 *) dest)[3] =
 					SWAP32((video_font_draw_table32
 						[bits >> 4][3] & eorx) ^ bgx);
+
+
+				if (VIDEO_FONT_WIDTH == 4)
+					continue;
+
 				((u32 *) dest)[4] =
 					SWAP32((video_font_draw_table32
 						[bits & 15][0] & eorx) ^ bgx);
@@ -591,6 +608,10 @@  static void video_drawchars(int xx, int yy, unsigned char *s, int count)
 				((u32 *) dest)[2] =
 					(video_font_draw_table24[bits >> 4][2]
 					 & eorx) ^ bgx;
+
+				if (VIDEO_FONT_WIDTH == 4)
+					continue;
+
 				((u32 *) dest)[3] =
 					(video_font_draw_table24[bits & 15][0]
 					 & eorx) ^ bgx;