All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V3 0/4] common/lcd cleanup
@ 2012-08-09 10:14 Nikita Kiryanov
  2012-08-09 10:14 ` [U-Boot] [PATCH V3 1/4] common lcd: simplify lcd_logo Nikita Kiryanov
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Nikita Kiryanov @ 2012-08-09 10:14 UTC (permalink / raw)
  To: u-boot

This patch series attempts to simplify #ifdef complexity in common/lcd.c.

It was compile tested on Arm and PowerPC using MAKEALL

Changes in V3:
	- Rebased on latest u-boot-video
	- Removed volatile qualifiers in patch 3 since the use of volatile is
	discouraged and it looks like it is safe to remove them.

Changes in V2:
	- Rebased on u-boot-video
	- patches 2 and 3 of original patchset dropped because I'm not sure
	what to do about them
	- simplify lcd_logo: used bitmap_display() to further simplify code
	- simplify lcd_display_bitmap: fixed pointer increment error
	- simplify lcd_display_bitmap: change to simplify lcd_logo breaks
	MCC200 board because it does not #define CONFIG_CMD_BMP. Added a local
	implementation of bitmap_display().

Nikita Kiryanov (4):
  common lcd: simplify lcd_logo
  common lcd: simplify lcd_display
  common lcd: simplify core functions
  common lcd: simplify lcd_display_bitmap

 board/mcc200/lcd.c |   20 +++++++
 common/lcd.c       |  145 +++++++++++++++++++++++++++-------------------------
 2 files changed, 96 insertions(+), 69 deletions(-)

-- 
1.7.5.4

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

* [U-Boot] [PATCH V3 1/4] common lcd: simplify lcd_logo
  2012-08-09 10:14 [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
@ 2012-08-09 10:14 ` Nikita Kiryanov
  2012-08-09 10:14 ` [U-Boot] [PATCH V3 2/4] common lcd: simplify lcd_display Nikita Kiryanov
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Nikita Kiryanov @ 2012-08-09 10:14 UTC (permalink / raw)
  To: u-boot

Simplify lcd_logo by extracting bmp unzip into its own function.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---

Changes in V2:
	- used bitmap_display() to further simplify code

 common/lcd.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 506a138..8890635 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -842,17 +842,7 @@ static void *lcd_logo(void)
 		}
 #endif /* CONFIG_SPLASH_SCREEN_ALIGN */
 
-#ifdef CONFIG_VIDEO_BMP_GZIP
-		bmp_image_t *bmp = (bmp_image_t *)addr;
-		unsigned long len;
-
-		if (!((bmp->header.signature[0] == 'B') &&
-			(bmp->header.signature[1] == 'M'))) {
-			addr = (ulong)gunzip_bmp(addr, &len);
-		}
-#endif
-
-		if (lcd_display_bitmap(addr, x, y) == 0)
+		if (bmp_display(addr, x, y) == 0)
 			return (void *)lcd_base;
 	}
 #endif /* CONFIG_SPLASH_SCREEN */
-- 
1.7.5.4

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

* [U-Boot] [PATCH V3 2/4] common lcd: simplify lcd_display
  2012-08-09 10:14 [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
  2012-08-09 10:14 ` [U-Boot] [PATCH V3 1/4] common lcd: simplify lcd_logo Nikita Kiryanov
@ 2012-08-09 10:14 ` Nikita Kiryanov
  2012-08-09 10:14 ` [U-Boot] [PATCH V3 3/4] common lcd: simplify core functions Nikita Kiryanov
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Nikita Kiryanov @ 2012-08-09 10:14 UTC (permalink / raw)
  To: u-boot

Simplify lcd_display by centralizing code into a funciton

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 common/lcd.c |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 8890635..4a5c8d5 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -607,6 +607,22 @@ static inline void bitmap_plot(int x, int y) {}
 
 #ifdef CONFIG_SPLASH_SCREEN_ALIGN
 #define BMP_ALIGN_CENTER	0x7FFF
+
+static void splash_align_axis(int *axis, unsigned long panel_size,
+					unsigned long picture_size)
+{
+	unsigned long panel_picture_delta = panel_size - picture_size;
+	unsigned long axis_alignment;
+
+	if (*axis == BMP_ALIGN_CENTER)
+		axis_alignment = panel_picture_delta / 2;
+	else if (*axis < 0)
+		axis_alignment = panel_picture_delta + *axis + 1;
+	else
+		return;
+
+	*axis = max(0, axis_alignment);
+}
 #endif
 
 int lcd_display_bitmap(ulong bmp_image, int x, int y)
@@ -722,15 +738,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 	padded_line = (width&0x3) ? ((width&~0x3)+4) : (width);
 
 #ifdef CONFIG_SPLASH_SCREEN_ALIGN
-	if (x == BMP_ALIGN_CENTER)
-		x = max(0, (pwidth - width) / 2);
-	else if (x < 0)
-		x = max(0, pwidth - width + x + 1);
-
-	if (y == BMP_ALIGN_CENTER)
-		y = max(0, (panel_info.vl_row - height) / 2);
-	else if (y < 0)
-		y = max(0, panel_info.vl_row - height + y + 1);
+	splash_align_axis(&x, pwidth, width);
+	splash_align_axis(&y, panel_info.vl_row, height);
 #endif /* CONFIG_SPLASH_SCREEN_ALIGN */
 
 	if ((x + width) > pwidth)
-- 
1.7.5.4

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

* [U-Boot] [PATCH V3 3/4] common lcd: simplify core functions
  2012-08-09 10:14 [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
  2012-08-09 10:14 ` [U-Boot] [PATCH V3 1/4] common lcd: simplify lcd_logo Nikita Kiryanov
  2012-08-09 10:14 ` [U-Boot] [PATCH V3 2/4] common lcd: simplify lcd_display Nikita Kiryanov
@ 2012-08-09 10:14 ` Nikita Kiryanov
  2012-08-09 10:14 ` [U-Boot] [PATCH V3 4/4] common lcd: simplify lcd_display_bitmap Nikita Kiryanov
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Nikita Kiryanov @ 2012-08-09 10:14 UTC (permalink / raw)
  To: u-boot

Move highly platform dependant code into its own function to reduce the
number of #ifdefs in the bigger functions

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---

Changes in V3:
	- Removed volatile qualifiers in patch 3 since the use of volatile is
	discouraged and it looks like it is safe to remove them.

 common/lcd.c |   62 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 4a5c8d5..0f93eae 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -498,23 +498,37 @@ static int lcd_getbgcolor(void)
 /************************************************************************/
 /* ** Chipset depending Bitmap / Logo stuff...                          */
 /************************************************************************/
+static inline ushort *configuration_get_cmap(void)
+{
+#if defined CONFIG_CPU_PXA
+	struct pxafb_info *fbi = &panel_info.pxa;
+	return (ushort *)fbi->palette;
+#elif defined(CONFIG_MPC823)
+	immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
+	cpm8xx_t *cp = &(immr->im_cpm);
+	return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
+#elif defined(CONFIG_ATMEL_LCD)
+	return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
+#else
+	return (ushort *)panel_info.cmap;
+#endif
+}
+
 #ifdef CONFIG_LCD_LOGO
 void bitmap_plot(int x, int y)
 {
 #ifdef CONFIG_ATMEL_LCD
-	uint *cmap;
+	uint *cmap = (uint *)bmp_logo_palette;
 #else
-	ushort *cmap;
+	ushort *cmap = (ushort *)bmp_logo_palette;
 #endif
 	ushort i, j;
 	uchar *bmap;
 	uchar *fb;
 	ushort *fb16;
-#if defined(CONFIG_CPU_PXA)
-	struct pxafb_info *fbi = &panel_info.pxa;
-#elif defined(CONFIG_MPC823)
-	volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-	volatile cpm8xx_t *cp = &(immr->im_cpm);
+#if defined(CONFIG_MPC823)
+	immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
+	cpm8xx_t *cp = &(immr->im_cpm);
 #endif
 
 	debug("Logo: width %d  height %d  colors %d  cmap %d\n",
@@ -525,20 +539,17 @@ void bitmap_plot(int x, int y)
 	fb   = (uchar *)(lcd_base + y * lcd_line_length + x);
 
 	if (NBITS(panel_info.vl_bpix) < 12) {
-		/* Leave room for default color map */
-#if defined(CONFIG_CPU_PXA)
-		cmap = (ushort *) fbi->palette;
-#elif defined(CONFIG_MPC823)
+		/* Leave room for default color map
+		 * default case: generic system with no cmap (most likely 16bpp)
+		 * cmap was set to the source palette, so no change is done.
+		 * This avoids even more ifdefs in the next stanza
+		 */
+#if defined(CONFIG_MPC823)
 		cmap = (ushort *) &(cp->lcd_cmap[BMP_LOGO_OFFSET * sizeof(ushort)]);
 #elif defined(CONFIG_ATMEL_LCD)
-		cmap = (uint *) (panel_info.mmio + ATMEL_LCDC_LUT(0));
+		cmap = (uint *)configuration_get_cmap();
 #else
-		/*
-		 * default case: generic system with no cmap (most likely 16bpp)
-		 * We set cmap to the source palette, so no change is done.
-		 * This avoids even more ifdef in the next stanza
-		 */
-		cmap = bmp_logo_palette;
+		cmap = configuration_get_cmap();
 #endif
 
 		WATCHDOG_RESET();
@@ -639,12 +650,6 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 	unsigned long width, height, byte_width;
 	unsigned long pwidth = panel_info.vl_col;
 	unsigned colors, bpix, bmp_bpix;
-#if defined(CONFIG_CPU_PXA)
-	struct pxafb_info *fbi = &panel_info.pxa;
-#elif defined(CONFIG_MPC823)
-	volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-	volatile cpm8xx_t *cp = &(immr->im_cpm);
-#endif
 
 	if (!((bmp->header.signature[0] == 'B') &&
 		(bmp->header.signature[1] == 'M'))) {
@@ -682,14 +687,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 #if !defined(CONFIG_MCC200)
 	/* MCC200 LCD doesn't need CMAP, supports 1bpp b&w only */
 	if (bmp_bpix == 8) {
-#if defined(CONFIG_CPU_PXA)
-		cmap = (ushort *)fbi->palette;
-#elif defined(CONFIG_MPC823)
-		cmap = (ushort *)&(cp->lcd_cmap[255*sizeof(ushort)]);
-#elif !defined(CONFIG_ATMEL_LCD) && !defined(CONFIG_EXYNOS_FB)
-		cmap = panel_info.cmap;
-#endif
-
+		cmap = configuration_get_cmap();
 		cmap_base = cmap;
 
 		/* Set color map */
-- 
1.7.5.4

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

* [U-Boot] [PATCH V3 4/4] common lcd: simplify lcd_display_bitmap
  2012-08-09 10:14 [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
                   ` (2 preceding siblings ...)
  2012-08-09 10:14 ` [U-Boot] [PATCH V3 3/4] common lcd: simplify core functions Nikita Kiryanov
@ 2012-08-09 10:14 ` Nikita Kiryanov
  2012-08-20  6:15 ` [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Nikita Kiryanov @ 2012-08-09 10:14 UTC (permalink / raw)
  To: u-boot

Move highly platform dependant code into its own functions to reduce the
number of #ifdefs in lcd_display_bitmap

To avoid breaking the mcc200 board which does not #define
CONFIG_CMD_BMP, this patch also implements bmp_display() for mcc200.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---

Changes in V2:
	- fixed pointer increment error
	- change to simplify lcd_logo breaks MCC200 board because it does not
	#define CONFIG_CMD_BMP. Added a local implementation of bitmap_display().

 board/mcc200/lcd.c |   20 ++++++++++++++++++++
 common/lcd.c       |   44 +++++++++++++++++++++++++++-----------------
 2 files changed, 47 insertions(+), 17 deletions(-)

diff --git a/board/mcc200/lcd.c b/board/mcc200/lcd.c
index d8f754c..893f4b7 100644
--- a/board/mcc200/lcd.c
+++ b/board/mcc200/lcd.c
@@ -21,6 +21,7 @@
 #include <common.h>
 #include <lcd.h>
 #include <mpc5xxx.h>
+#include <malloc.h>
 
 #ifdef CONFIG_LCD
 
@@ -210,4 +211,23 @@ void show_progress (int size, int tot)
 }
 
 #endif
+
+int bmp_display(ulong addr, int x, int y)
+{
+	int ret;
+	bmp_image_t *bmp = (bmp_image_t *)addr;
+
+	if (!bmp) {
+		printf("There is no valid bmp file at the given address\n");
+		return 1;
+	}
+
+	ret = lcd_display_bitmap((ulong)bmp, x, y);
+
+	if ((unsigned long)bmp != addr)
+		free(bmp);
+
+	return ret;
+}
+
 #endif /* CONFIG_LCD */
diff --git a/common/lcd.c b/common/lcd.c
index 0f93eae..88dfa51 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -636,6 +636,29 @@ static void splash_align_axis(int *axis, unsigned long panel_size,
 }
 #endif
 
+#if defined CONFIG_CPU_PXA || defined(CONFIG_ATMEL_LCD)
+#define FB_PUT_BYTE(fb, from) *(fb)++ = *(from)++
+#elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
+#define FB_PUT_BYTE(fb, from) *(fb)++ = (255 - *(from)++)
+#endif
+
+#if defined(CONFIG_BMP_16BPP)
+#if defined(CONFIG_ATMEL_LCD_BGR555)
+static inline void fb_put_word(uchar **fb, uchar **from)
+{
+	*(*fb)++ = (((*from)[0] & 0x1f) << 2) | ((*from)[1] & 0x03);
+	*(*fb)++ = ((*from)[0] & 0xe0) | (((*from)[1] & 0x7c) >> 2);
+	*from += 2;
+}
+#else
+static inline void fb_put_word(uchar **fb, uchar **from)
+{
+	*(*fb)++ = *(*from)++;
+	*(*fb)++ = *(*from)++;
+}
+#endif
+#endif /* CONFIG_BMP_16BPP */
+
 int lcd_display_bitmap(ulong bmp_image, int x, int y)
 {
 #if !defined(CONFIG_MCC200)
@@ -761,11 +784,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 			WATCHDOG_RESET();
 			for (j = 0; j < width; j++) {
 				if (bpix != 16) {
-#if defined(CONFIG_CPU_PXA) || defined(CONFIG_ATMEL_LCD)
-					*(fb++) = *(bmap++);
-#elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
-					*(fb++) = 255 - *(bmap++);
-#endif
+					FB_PUT_BYTE(fb, bmap);
 				} else {
 					*(uint16_t *)fb = cmap_base[*(bmap++)];
 					fb += sizeof(uint16_t) / sizeof(*fb);
@@ -780,18 +799,9 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 	case 16:
 		for (i = 0; i < height; ++i) {
 			WATCHDOG_RESET();
-			for (j = 0; j < width; j++) {
-#if defined(CONFIG_ATMEL_LCD_BGR555)
-				*(fb++) = ((bmap[0] & 0x1f) << 2) |
-					(bmap[1] & 0x03);
-				*(fb++) = (bmap[0] & 0xe0) |
-					((bmap[1] & 0x7c) >> 2);
-				bmap += 2;
-#else
-				*(fb++) = *(bmap++);
-				*(fb++) = *(bmap++);
-#endif
-			}
+			for (j = 0; j < width; j++)
+				fb_put_word(&fb, &bmap);
+
 			bmap += (padded_line - width) * 2;
 			fb   -= (width * 2 + lcd_line_length);
 		}
-- 
1.7.5.4

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

* [U-Boot] [PATCH V3 0/4] common/lcd cleanup
  2012-08-09 10:14 [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
                   ` (3 preceding siblings ...)
  2012-08-09 10:14 ` [U-Boot] [PATCH V3 4/4] common lcd: simplify lcd_display_bitmap Nikita Kiryanov
@ 2012-08-20  6:15 ` Nikita Kiryanov
  2012-08-28 19:28   ` Nikita Kiryanov
  2012-09-05  6:51 ` Igor Grinberg
  2012-09-22 16:55 ` [U-Boot] [PATCH] common/lcd: fix build breakage for at91sam9x5ek and trats boards Anatolij Gustschin
  6 siblings, 1 reply; 13+ messages in thread
From: Nikita Kiryanov @ 2012-08-20  6:15 UTC (permalink / raw)
  To: u-boot

Gentle ping.

On 08/09/2012 01:14 PM, Nikita Kiryanov wrote:
> This patch series attempts to simplify #ifdef complexity in common/lcd.c.
>
> It was compile tested on Arm and PowerPC using MAKEALL
>
> Changes in V3:
> 	- Rebased on latest u-boot-video
> 	- Removed volatile qualifiers in patch 3 since the use of volatile is
> 	discouraged and it looks like it is safe to remove them.
>
> Changes in V2:
> 	- Rebased on u-boot-video
> 	- patches 2 and 3 of original patchset dropped because I'm not sure
> 	what to do about them
> 	- simplify lcd_logo: used bitmap_display() to further simplify code
> 	- simplify lcd_display_bitmap: fixed pointer increment error
> 	- simplify lcd_display_bitmap: change to simplify lcd_logo breaks
> 	MCC200 board because it does not #define CONFIG_CMD_BMP. Added a local
> 	implementation of bitmap_display().
>
> Nikita Kiryanov (4):
>    common lcd: simplify lcd_logo
>    common lcd: simplify lcd_display
>    common lcd: simplify core functions
>    common lcd: simplify lcd_display_bitmap
>
>   board/mcc200/lcd.c |   20 +++++++
>   common/lcd.c       |  145 +++++++++++++++++++++++++++-------------------------
>   2 files changed, 96 insertions(+), 69 deletions(-)
>

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

* [U-Boot] [PATCH V3 0/4] common/lcd cleanup
  2012-08-20  6:15 ` [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
@ 2012-08-28 19:28   ` Nikita Kiryanov
  0 siblings, 0 replies; 13+ messages in thread
From: Nikita Kiryanov @ 2012-08-28 19:28 UTC (permalink / raw)
  To: u-boot

Gentle ping.

-----Original Message-----
From: u-boot-bounces@lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On
Behalf Of Nikita Kiryanov
Sent: Monday, August 20, 2012 9:16 AM
To: Nikita Kiryanov
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH V3 0/4] common/lcd cleanup

Gentle ping.

On 08/09/2012 01:14 PM, Nikita Kiryanov wrote:
> This patch series attempts to simplify #ifdef complexity in common/lcd.c.
>
> It was compile tested on Arm and PowerPC using MAKEALL
>
> Changes in V3:
> 	- Rebased on latest u-boot-video
> 	- Removed volatile qualifiers in patch 3 since the use of volatile
is
> 	discouraged and it looks like it is safe to remove them.
>
> Changes in V2:
> 	- Rebased on u-boot-video
> 	- patches 2 and 3 of original patchset dropped because I'm not sure
> 	what to do about them
> 	- simplify lcd_logo: used bitmap_display() to further simplify code
> 	- simplify lcd_display_bitmap: fixed pointer increment error
> 	- simplify lcd_display_bitmap: change to simplify lcd_logo breaks
> 	MCC200 board because it does not #define CONFIG_CMD_BMP. Added a
local
> 	implementation of bitmap_display().
>
> Nikita Kiryanov (4):
>    common lcd: simplify lcd_logo
>    common lcd: simplify lcd_display
>    common lcd: simplify core functions
>    common lcd: simplify lcd_display_bitmap
>
>   board/mcc200/lcd.c |   20 +++++++
>   common/lcd.c       |  145
+++++++++++++++++++++++++++-------------------------
>   2 files changed, 96 insertions(+), 69 deletions(-)
>

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

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

* [U-Boot] [PATCH V3 0/4] common/lcd cleanup
  2012-08-09 10:14 [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
                   ` (4 preceding siblings ...)
  2012-08-20  6:15 ` [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
@ 2012-09-05  6:51 ` Igor Grinberg
  2012-09-05  6:56   ` Marek Vasut
  2012-09-05  8:49   ` Anatolij Gustschin
  2012-09-22 16:55 ` [U-Boot] [PATCH] common/lcd: fix build breakage for at91sam9x5ek and trats boards Anatolij Gustschin
  6 siblings, 2 replies; 13+ messages in thread
From: Igor Grinberg @ 2012-09-05  6:51 UTC (permalink / raw)
  To: u-boot

Hi guys,

This series is waiting for several month already.
Only the V3 is one month old and hasn't got any comments so far.
So, if Anatolij for some reason cannot deal with it,
please merge it via a staging tree of yours.

Thanks

On 08/09/12 13:14, Nikita Kiryanov wrote:
> This patch series attempts to simplify #ifdef complexity in common/lcd.c.
> 
> It was compile tested on Arm and PowerPC using MAKEALL
> 
> Changes in V3:
> 	- Rebased on latest u-boot-video
> 	- Removed volatile qualifiers in patch 3 since the use of volatile is
> 	discouraged and it looks like it is safe to remove them.
> 
> Changes in V2:
> 	- Rebased on u-boot-video
> 	- patches 2 and 3 of original patchset dropped because I'm not sure
> 	what to do about them
> 	- simplify lcd_logo: used bitmap_display() to further simplify code
> 	- simplify lcd_display_bitmap: fixed pointer increment error
> 	- simplify lcd_display_bitmap: change to simplify lcd_logo breaks
> 	MCC200 board because it does not #define CONFIG_CMD_BMP. Added a local
> 	implementation of bitmap_display().
> 
> Nikita Kiryanov (4):
>   common lcd: simplify lcd_logo
>   common lcd: simplify lcd_display
>   common lcd: simplify core functions
>   common lcd: simplify lcd_display_bitmap
> 
>  board/mcc200/lcd.c |   20 +++++++
>  common/lcd.c       |  145 +++++++++++++++++++++++++++-------------------------
>  2 files changed, 96 insertions(+), 69 deletions(-)
> 

-- 
Regards,
Igor.

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

* [U-Boot] [PATCH V3 0/4] common/lcd cleanup
  2012-09-05  6:51 ` Igor Grinberg
@ 2012-09-05  6:56   ` Marek Vasut
  2012-09-05  8:49   ` Anatolij Gustschin
  1 sibling, 0 replies; 13+ messages in thread
From: Marek Vasut @ 2012-09-05  6:56 UTC (permalink / raw)
  To: u-boot

Dear Igor Grinberg,

> Hi guys,
> 
> This series is waiting for several month already.
> Only the V3 is one month old and hasn't got any comments so far.
> So, if Anatolij for some reason cannot deal with it,
> please merge it via a staging tree of yours.

Anatolij, poke?

It was probably forgotten, simple bump would suffice. Sorry for the delay.

> Thanks
> 
> On 08/09/12 13:14, Nikita Kiryanov wrote:
> > This patch series attempts to simplify #ifdef complexity in common/lcd.c.
> > 
> > It was compile tested on Arm and PowerPC using MAKEALL
> > 
> > Changes in V3:
> > 	- Rebased on latest u-boot-video
> > 	- Removed volatile qualifiers in patch 3 since the use of volatile is
> > 	discouraged and it looks like it is safe to remove them.
> > 
> > Changes in V2:
> > 	- Rebased on u-boot-video
> > 	- patches 2 and 3 of original patchset dropped because I'm not sure
> > 	what to do about them
> > 	- simplify lcd_logo: used bitmap_display() to further simplify code
> > 	- simplify lcd_display_bitmap: fixed pointer increment error
> > 	- simplify lcd_display_bitmap: change to simplify lcd_logo breaks
> > 	MCC200 board because it does not #define CONFIG_CMD_BMP. Added a local
> > 	implementation of bitmap_display().
> > 
> > Nikita Kiryanov (4):
> >   common lcd: simplify lcd_logo
> >   common lcd: simplify lcd_display
> >   common lcd: simplify core functions
> >   common lcd: simplify lcd_display_bitmap
> >  
> >  board/mcc200/lcd.c |   20 +++++++
> >  common/lcd.c       |  145
> >  +++++++++++++++++++++++++++------------------------- 2 files changed,
> >  96 insertions(+), 69 deletions(-)

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH V3 0/4] common/lcd cleanup
  2012-09-05  6:51 ` Igor Grinberg
  2012-09-05  6:56   ` Marek Vasut
@ 2012-09-05  8:49   ` Anatolij Gustschin
  1 sibling, 0 replies; 13+ messages in thread
From: Anatolij Gustschin @ 2012-09-05  8:49 UTC (permalink / raw)
  To: u-boot

Hi,

On Wed, 05 Sep 2012 09:51:12 +0300
Igor Grinberg <grinberg@compulab.co.il> wrote:

> Hi guys,
> 
> This series is waiting for several month already.
> Only the V3 is one month old and hasn't got any comments so far.
> So, if Anatolij for some reason cannot deal with it,
> please merge it via a staging tree of yours.

Sorry for the delay, I'm really busy with other projects and have
only very limitted capacity to process U-Boot patches. These are
not lost, and assigned to me at patchwork. For now I've applied
this series, hope it will not break anything for all these affected
platforms. But please do not expect me pushing to u-boot/master this
week, Wolfgang won't pull this week anyway, I'm afraid.

Thanks for the patience, and sorry again

Anatolij

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

* [U-Boot] [PATCH] common/lcd: fix build breakage for at91sam9x5ek and trats boards
  2012-08-09 10:14 [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
                   ` (5 preceding siblings ...)
  2012-09-05  6:51 ` Igor Grinberg
@ 2012-09-22 16:55 ` Anatolij Gustschin
  2012-09-24 12:54   ` Nikita Kiryanov
  2012-09-24 22:04   ` Anatolij Gustschin
  6 siblings, 2 replies; 13+ messages in thread
From: Anatolij Gustschin @ 2012-09-22 16:55 UTC (permalink / raw)
  To: u-boot

Commit 203c37b8c5556aad1901ce4954792afd718c7d42
(common lcd: simplify core functions)

and commit bfdcc65e1163b4891643c2a670570c478b9af2a4
(common lcd: simplify lcd_display_bitmap)

caused build breakage for at91sam9x5ek board configurations
and for trats board. Fix these build errors.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 common/lcd.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index fcc09ac..b6be800 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -509,8 +509,14 @@ static inline ushort *configuration_get_cmap(void)
 	return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
 #elif defined(CONFIG_ATMEL_LCD)
 	return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
+#elif !defined(CONFIG_ATMEL_HLCD) && !defined(CONFIG_EXYNOS_FB)
+	return panel_info.cmap;
 #else
-	return (ushort *)panel_info.cmap;
+#if defined(CONFIG_LCD_LOGO)
+	return bmp_logo_palette;
+#else
+	return NULL;
+#endif
 #endif
 }
 
@@ -636,10 +642,10 @@ static void splash_align_axis(int *axis, unsigned long panel_size,
 }
 #endif
 
-#if defined CONFIG_CPU_PXA || defined(CONFIG_ATMEL_LCD)
-#define FB_PUT_BYTE(fb, from) *(fb)++ = *(from)++
-#elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
+#if defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
 #define FB_PUT_BYTE(fb, from) *(fb)++ = (255 - *(from)++)
+#else
+#define FB_PUT_BYTE(fb, from) *(fb)++ = *(from)++
 #endif
 
 #if defined(CONFIG_BMP_16BPP)
-- 
1.7.7.6

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

* [U-Boot] [PATCH] common/lcd: fix build breakage for at91sam9x5ek and trats boards
  2012-09-22 16:55 ` [U-Boot] [PATCH] common/lcd: fix build breakage for at91sam9x5ek and trats boards Anatolij Gustschin
@ 2012-09-24 12:54   ` Nikita Kiryanov
  2012-09-24 22:04   ` Anatolij Gustschin
  1 sibling, 0 replies; 13+ messages in thread
From: Nikita Kiryanov @ 2012-09-24 12:54 UTC (permalink / raw)
  To: u-boot

Acked-by: Nikita Kiryanov <nikita@compulab.co.il>

On 09/22/2012 07:55 PM, Anatolij Gustschin wrote:
> Commit 203c37b8c5556aad1901ce4954792afd718c7d42
> (common lcd: simplify core functions)
>
> and commit bfdcc65e1163b4891643c2a670570c478b9af2a4
> (common lcd: simplify lcd_display_bitmap)
>
> caused build breakage for at91sam9x5ek board configurations
> and for trats board. Fix these build errors.
>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>   common/lcd.c |   14 ++++++++++----
>   1 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/common/lcd.c b/common/lcd.c
> index fcc09ac..b6be800 100644
> --- a/common/lcd.c
> +++ b/common/lcd.c
> @@ -509,8 +509,14 @@ static inline ushort *configuration_get_cmap(void)
>   	return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
>   #elif defined(CONFIG_ATMEL_LCD)
>   	return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
> +#elif !defined(CONFIG_ATMEL_HLCD) && !defined(CONFIG_EXYNOS_FB)
> +	return panel_info.cmap;
>   #else
> -	return (ushort *)panel_info.cmap;
> +#if defined(CONFIG_LCD_LOGO)
> +	return bmp_logo_palette;
> +#else
> +	return NULL;
> +#endif
>   #endif
>   }
>
> @@ -636,10 +642,10 @@ static void splash_align_axis(int *axis, unsigned long panel_size,
>   }
>   #endif
>
> -#if defined CONFIG_CPU_PXA || defined(CONFIG_ATMEL_LCD)
> -#define FB_PUT_BYTE(fb, from) *(fb)++ = *(from)++
> -#elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
> +#if defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
>   #define FB_PUT_BYTE(fb, from) *(fb)++ = (255 - *(from)++)
> +#else
> +#define FB_PUT_BYTE(fb, from) *(fb)++ = *(from)++
>   #endif
>
>   #if defined(CONFIG_BMP_16BPP)
>

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

* [U-Boot] [PATCH] common/lcd: fix build breakage for at91sam9x5ek and trats boards
  2012-09-22 16:55 ` [U-Boot] [PATCH] common/lcd: fix build breakage for at91sam9x5ek and trats boards Anatolij Gustschin
  2012-09-24 12:54   ` Nikita Kiryanov
@ 2012-09-24 22:04   ` Anatolij Gustschin
  1 sibling, 0 replies; 13+ messages in thread
From: Anatolij Gustschin @ 2012-09-24 22:04 UTC (permalink / raw)
  To: u-boot

On Sat, 22 Sep 2012 18:55:53 +0200
Anatolij Gustschin <agust@denx.de> wrote:

> Commit 203c37b8c5556aad1901ce4954792afd718c7d42
> (common lcd: simplify core functions)
> 
> and commit bfdcc65e1163b4891643c2a670570c478b9af2a4
> (common lcd: simplify lcd_display_bitmap)
> 
> caused build breakage for at91sam9x5ek board configurations
> and for trats board. Fix these build errors.
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  common/lcd.c |   14 ++++++++++----
>  1 files changed, 10 insertions(+), 4 deletions(-)

Applied to u-boot-video/master.

Anatolij

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

end of thread, other threads:[~2012-09-24 22:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-09 10:14 [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
2012-08-09 10:14 ` [U-Boot] [PATCH V3 1/4] common lcd: simplify lcd_logo Nikita Kiryanov
2012-08-09 10:14 ` [U-Boot] [PATCH V3 2/4] common lcd: simplify lcd_display Nikita Kiryanov
2012-08-09 10:14 ` [U-Boot] [PATCH V3 3/4] common lcd: simplify core functions Nikita Kiryanov
2012-08-09 10:14 ` [U-Boot] [PATCH V3 4/4] common lcd: simplify lcd_display_bitmap Nikita Kiryanov
2012-08-20  6:15 ` [U-Boot] [PATCH V3 0/4] common/lcd cleanup Nikita Kiryanov
2012-08-28 19:28   ` Nikita Kiryanov
2012-09-05  6:51 ` Igor Grinberg
2012-09-05  6:56   ` Marek Vasut
2012-09-05  8:49   ` Anatolij Gustschin
2012-09-22 16:55 ` [U-Boot] [PATCH] common/lcd: fix build breakage for at91sam9x5ek and trats boards Anatolij Gustschin
2012-09-24 12:54   ` Nikita Kiryanov
2012-09-24 22:04   ` Anatolij Gustschin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.