Re: [PATCH v4] Frame Buffer driver for TI DA8xx/OMAP-L1xx
From: Krzysztof Helt <hidden>
Date: 2009-07-02 19:56:59
On Tue, 30 Jun 2009 01:50:13 -0400 "Rajashekhara, Sudhakar" [off-list ref] wrote:
Adds LCD controller (LCDC) driver for TI's DA8xx/OMAP-L1xx architecture. LCDC specifications can be found at http://www.ti.com/litv/pdf/sprufm0a. LCDC on DA8xx consists of two independent controllers, the Raster Controller and the LCD Interface Display Driver (LIDD) controller. LIDD further supports character and graphic displays. This patch adds support for the graphic display (Sharp LQ035Q3DG01) found on the DA830 based EVM. The EVM details can be found at: http://support.spectrumdigital.com/boards/dskda830/revc/. Signed-off-by: Sudhakar Rajashekhara <redacted> Signed-off-by: Pavel Kiryukhin <redacted> Signed-off-by: Steve Chen <redacted> --- Since the previous version, fb_setcolreg function has been modified for 8 and 16 bit modes. drivers/video/Kconfig | 11 + drivers/video/Makefile | 1 + drivers/video/da8xx-fb.c | 897 ++++++++++++++++++++++++++++++++++++++++++++++ include/video/da8xx-fb.h | 106 ++++++ 4 files changed, 1015 insertions(+), 0 deletions(-) create mode 100644 drivers/video/da8xx-fb.c create mode 100644 include/video/da8xx-fb.h
quoted hunk ↗ jump to hunk
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c new file mode 100644 index 0000000..3135234 --- /dev/null +++ b/drivers/video/da8xx-fb.c@@ -0,0 +1,897 @@
(...)
+
+static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
+ unsigned blue, unsigned transp,
+ struct fb_info *info)
+{
+ struct da8xx_fb_par *par = info->par;
+ unsigned short *palette = (unsigned short *)par->v_palette_base;
+ u_short pal;
+
+ if (regno > 255)
+ return 1;
+
+ if (info->fix.visual == FB_VISUAL_DIRECTCOLOR)
+ return 1;
+
+ if (info->var.bits_per_pixel == 8) {
+ red >>= 4;
+ green >>= 4;
+ blue >>= 4;
+
+ pal = (red & 0x0f00);
+ pal |= (green & 0x00f0);
+ pal |= (blue & 0x000f);
+
+ palette[regno] = pal;
+I am losing my patience. The shift value for the red component is right (probably as I do not know the format of this palette registers). It is however almost surely wrong for other componets. Just put this simple example value to get almost white color: red = 0xf000; green = 0xf000; blue = 0xf000; The resulting palette value would be 0xf00. Is it close to white on your controller? Another example: blue red = 0; green = 0; blue = 0xff00; The result : 0x0. It does not differ from the value for black colour (rgb = 0/0/0).
+ } else if ((info->var.bits_per_pixel == 16) && regno < 16) {
+ red >>= (16 - info->var.red.length);
+ red <<= info->var.red.offset;
+
+ green >>= (16 - info->var.green.length);
+ green <<= info->var.green.offset;
+
+ blue >>= (16 - info->var.blue.length);
+ blue <<= info->var.blue.offset;
+
+ par->pseudo_palette[regno] = red | green | blue;
+
+ palette[0] = 0x4000;
+ }This one is OK. Regards, Krzysztof ---------------------------------------------------------------------- Wybierz najlepsze ubezpieczenie komunikacyjne w Ergo Hestia http://link.interia.pl/f222a ------------------------------------------------------------------------------