[U-Boot] [PATCH] video: cfb_console: add weak default video_set_lut()
Anatolij Gustschin
agust at denx.de
Sat May 1 21:05:17 CEST 2010
Do not enforce drivers to provide empty video_set_lut()
if they do not implement indexed color (8 bpp) frame
buffer support. Add default function to the cfb_console
driver and remove empty video_set_lut() functions.
Signed-off-by: Anatolij Gustschin <agust at denx.de>
---
arch/powerpc/cpu/mpc512x/diu.c | 14 --------------
board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c | 9 ---------
drivers/video/cfb_console.c | 12 ++++++++++++
drivers/video/sm501.c | 13 -------------
4 files changed, 12 insertions(+), 36 deletions(-)
diff --git a/arch/powerpc/cpu/mpc512x/diu.c b/arch/powerpc/cpu/mpc512x/diu.c
index f8d19a0..1cce6a2 100644
--- a/arch/powerpc/cpu/mpc512x/diu.c
+++ b/arch/powerpc/cpu/mpc512x/diu.c
@@ -179,18 +179,4 @@ void *video_hw_init(void)
return (void *)pGD;
}
-/**
- * Set the LUT
- *
- * @index: color number
- * @r: red
- * @b: blue
- * @g: green
- */
-void video_set_lut
- (unsigned int index, unsigned char r, unsigned char g, unsigned char b)
-{
- return;
-}
-
#endif /* defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE) */
diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
index 94fb1eb..a7b7f45 100644
--- a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
+++ b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
@@ -183,15 +183,6 @@ void *video_hw_init(void)
return (void *)pGD;
}
-void video_set_lut (unsigned int index, /* color number */
- unsigned char r, /* red */
- unsigned char g, /* green */
- unsigned char b /* blue */
- )
-{
- return;
-}
-
#endif /* defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE) */
#endif /* CONFIG_FSL_DIU_FB */
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index dbc6d1d..e89b155 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -803,6 +803,18 @@ static void inline fill_555rgb_pswap(uchar *fb, int x,
#endif
/*
+ * Do not enforce drivers (or board code) to provide empty
+ * video_set_lut() if they do not support 8 bpp format.
+ * Implement weak default function instead.
+ */
+void __video_set_lut (unsigned int index, unsigned char r,
+ unsigned char g, unsigned char b)
+{
+}
+void video_set_lut (unsigned int, unsigned char, unsigned char, unsigned char)
+ __attribute__((weak, alias("__video_set_lut")));
+
+/*
* RLE8 bitmap support
*/
diff --git a/drivers/video/sm501.c b/drivers/video/sm501.c
index 283d2d9..8c96316 100644
--- a/drivers/video/sm501.c
+++ b/drivers/video/sm501.c
@@ -131,16 +131,3 @@ void *video_hw_init (void)
return (&sm501);
}
-
-/*-----------------------------------------------------------------------------
- * video_set_lut --
- *-----------------------------------------------------------------------------
- */
-void video_set_lut (
- unsigned int index, /* color number */
- unsigned char r, /* red */
- unsigned char g, /* green */
- unsigned char b /* blue */
- )
-{
-}
--
1.6.3.3
More information about the U-Boot
mailing list