You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
(1) |
Apr
(104) |
May
(81) |
Jun
(248) |
Jul
(133) |
Aug
(33) |
Sep
(53) |
Oct
(82) |
Nov
(166) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(121) |
Feb
(42) |
Mar
(39) |
Apr
(84) |
May
(87) |
Jun
(58) |
Jul
(97) |
Aug
(130) |
Sep
(32) |
Oct
(139) |
Nov
(108) |
Dec
(216) |
2003 |
Jan
(299) |
Feb
(136) |
Mar
(392) |
Apr
(141) |
May
(137) |
Jun
(107) |
Jul
(94) |
Aug
(262) |
Sep
(300) |
Oct
(216) |
Nov
(72) |
Dec
(94) |
2004 |
Jan
(174) |
Feb
(192) |
Mar
(215) |
Apr
(314) |
May
(319) |
Jun
(293) |
Jul
(205) |
Aug
(161) |
Sep
(192) |
Oct
(226) |
Nov
(308) |
Dec
(89) |
2005 |
Jan
(127) |
Feb
(269) |
Mar
(588) |
Apr
(106) |
May
(77) |
Jun
(77) |
Jul
(161) |
Aug
(239) |
Sep
(86) |
Oct
(112) |
Nov
(153) |
Dec
(145) |
2006 |
Jan
(87) |
Feb
(57) |
Mar
(129) |
Apr
(109) |
May
(102) |
Jun
(232) |
Jul
(97) |
Aug
(69) |
Sep
(67) |
Oct
(69) |
Nov
(214) |
Dec
(82) |
2007 |
Jan
(133) |
Feb
(307) |
Mar
(121) |
Apr
(171) |
May
(229) |
Jun
(156) |
Jul
(185) |
Aug
(160) |
Sep
(122) |
Oct
(130) |
Nov
(78) |
Dec
(27) |
2008 |
Jan
(105) |
Feb
(137) |
Mar
(146) |
Apr
(148) |
May
(239) |
Jun
(208) |
Jul
(157) |
Aug
(244) |
Sep
(119) |
Oct
(125) |
Nov
(189) |
Dec
(225) |
2009 |
Jan
(157) |
Feb
(139) |
Mar
(106) |
Apr
(130) |
May
(246) |
Jun
(189) |
Jul
(128) |
Aug
(127) |
Sep
(88) |
Oct
(86) |
Nov
(216) |
Dec
(9) |
2010 |
Jan
(5) |
Feb
|
Mar
(11) |
Apr
(31) |
May
(3) |
Jun
|
Jul
(7) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Roel K. <roe...@gm...> - 2009-10-16 18:14:15
|
Only if the test is signed negative values can be spotted. Signed-off-by: Roel Kluin <roe...@gm...> --- Is this correct? please review. diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c index 0d0c8c8..cc7dd93 100644 --- a/drivers/video/omap/omapfb_main.c +++ b/drivers/video/omap/omapfb_main.c @@ -286,7 +286,7 @@ static int _setcolreg(struct fb_info *info, u_int regno, u_int red, u_int green, if (r != 0) break; - if (regno < 0) { + if ((int)regno < 0) { r = -EINVAL; break; } |
From: Jiri K. <jk...@su...> - 2009-10-16 13:22:41
|
On Thu, 15 Oct 2009, Thadeu Lima de Souza Cascardo wrote: > Signed-off-by: Thadeu Lima de Souza Cascardo <cas...@ho...> > --- > drivers/video/fb_defio.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c > index c27ab1e..e59c083 100644 > --- a/drivers/video/fb_defio.c > +++ b/drivers/video/fb_defio.c > @@ -71,7 +71,7 @@ int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int datasync) > { > struct fb_info *info = file->private_data; > > - /* Skip if deferred io is complied-in but disabled on this fbdev */ > + /* Skip if deferred io is compiled-in but disabled on this fbdev */ > if (!info->fbdefio) > return 0; Hi, as patches 2-8 from your series only fix typos/grammar in code comments, I have merged them together into one patch and applied to trivial queue. Thanks, -- Jiri Kosina SUSE Labs, Novell Inc. |
From: Chaithrika U S <cha...@ti...> - 2009-10-16 11:08:38
|
All, Please ignore this patch, will post an updated version soon. Regards, Chaithrika On Fri, Oct 16, 2009 at 15:57:02, Chaithrika U S wrote: > The clock divider value can be calculated from the pixel clock > value for the panel. This gives more flexiblity to the driver > to change the divider value on the fly as in the case of cpufreq > feature- support for which will be added shortly. > > Signed-off-by: Chaithrika U S <cha...@ti...> > --- > This patch applies to Linus' kernel tree > > drivers/video/da8xx-fb.c | 29 +++++++++++++++++++++-------- > 1 files changed, 21 insertions(+), 8 deletions(-) > > diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c > index d065894..7615939 100644 > --- a/drivers/video/da8xx-fb.c > +++ b/drivers/video/da8xx-fb.c > @@ -113,6 +113,7 @@ struct da8xx_fb_par { > unsigned short pseudo_palette[16]; > unsigned int databuf_sz; > unsigned int palette_sz; > + unsigned int pxl_clk; > }; > > /* Variable Screen Information */ > @@ -155,7 +156,7 @@ struct da8xx_panel { > int vfp; /* Vertical front porch */ > int vbp; /* Vertical back porch */ > int vsw; /* Vertical Sync Pulse Width */ > - int pxl_clk; /* Pixel clock */ > + unsigned int pxl_clk; /* Pixel clock */ > unsigned char invert_pxl_clk; /* Invert Pixel clock */ > }; > > @@ -171,7 +172,7 @@ static struct da8xx_panel known_lcd_panels[] = { > .vfp = 2, > .vbp = 2, > .vsw = 0, > - .pxl_clk = 0x10, > + .pxl_clk = 4608000, > .invert_pxl_clk = 1, > }, > /* Sharp LK043T1DG01 */ > @@ -185,7 +186,7 @@ static struct da8xx_panel known_lcd_panels[] = { > .vfp = 2, > .vbp = 2, > .vsw = 10, > - .pxl_clk = 0x12, > + .pxl_clk = 7833600, > .invert_pxl_clk = 0, > }, > }; > @@ -451,17 +452,29 @@ static void lcd_reset(struct da8xx_fb_par *par) > lcdc_write(0, LCD_RASTER_CTRL_REG); > } > > +static void lcd_calc_clk_divider(struct da8xx_fb_par *par) > +{ > + unsigned int lcd_clk, div; > + > + lcd_clk = clk_get_rate(par->lcdc_clk); > + div = lcd_clk / par->pxl_clk; > + > + /* Configure the LCD clock divisor. */ > + lcdc_write(LCD_CLK_DIVISOR(div) | > + (LCD_RASTER_MODE & 0x1), LCD_CTRL_REG); > +} > + > static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, > struct da8xx_panel *panel) > { > u32 bpp; > int ret = 0; > + unsigned int lcd_clk, div; > > lcd_reset(par); > > - /* Configure the LCD clock divisor. */ > - lcdc_write(LCD_CLK_DIVISOR(panel->pxl_clk) | > - (LCD_RASTER_MODE & 0x1), LCD_CTRL_REG); > + /* Calculate the divider */ > + lcd_calc_clk_divider(par); > > if (panel->invert_pxl_clk) > lcdc_write((lcdc_read(LCD_RASTER_TIMING_2_REG) | > @@ -721,6 +734,8 @@ static int __init fb_probe(struct platform_device *device) > } > > par = da8xx_fb_info->par; > + par->lcdc_clk = fb_clk; > + par->pxl_clk = lcdc_info->pxl_clk; > > if (lcd_init(par, lcd_cfg, lcdc_info) < 0) { > dev_err(&device->dev, "lcd_init failed\n"); > @@ -753,8 +768,6 @@ static int __init fb_probe(struct platform_device *device) > da8xx_fb_fix.smem_len = par->databuf_sz - par->palette_sz; > da8xx_fb_fix.line_length = (lcdc_info->width * lcd_cfg->bpp) / 8; > > - par->lcdc_clk = fb_clk; > - > par->irq = platform_get_irq(device, 0); > if (par->irq < 0) { > ret = -ENOENT; > -- > 1.5.6 > |
From: Chaithrika U S <cha...@ti...> - 2009-10-16 10:32:10
|
The clock divider value can be calculated from the pixel clock value for the panel. This gives more flexiblity to the driver to change the divider value on the fly as in the case of cpufreq feature- support for which will be added shortly. Signed-off-by: Chaithrika U S <cha...@ti...> --- This patch applies to Linus' kernel tree drivers/video/da8xx-fb.c | 29 +++++++++++++++++++++-------- 1 files changed, 21 insertions(+), 8 deletions(-) diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index d065894..7615939 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -113,6 +113,7 @@ struct da8xx_fb_par { unsigned short pseudo_palette[16]; unsigned int databuf_sz; unsigned int palette_sz; + unsigned int pxl_clk; }; /* Variable Screen Information */ @@ -155,7 +156,7 @@ struct da8xx_panel { int vfp; /* Vertical front porch */ int vbp; /* Vertical back porch */ int vsw; /* Vertical Sync Pulse Width */ - int pxl_clk; /* Pixel clock */ + unsigned int pxl_clk; /* Pixel clock */ unsigned char invert_pxl_clk; /* Invert Pixel clock */ }; @@ -171,7 +172,7 @@ static struct da8xx_panel known_lcd_panels[] = { .vfp = 2, .vbp = 2, .vsw = 0, - .pxl_clk = 0x10, + .pxl_clk = 4608000, .invert_pxl_clk = 1, }, /* Sharp LK043T1DG01 */ @@ -185,7 +186,7 @@ static struct da8xx_panel known_lcd_panels[] = { .vfp = 2, .vbp = 2, .vsw = 10, - .pxl_clk = 0x12, + .pxl_clk = 7833600, .invert_pxl_clk = 0, }, }; @@ -451,17 +452,29 @@ static void lcd_reset(struct da8xx_fb_par *par) lcdc_write(0, LCD_RASTER_CTRL_REG); } +static void lcd_calc_clk_divider(struct da8xx_fb_par *par) +{ + unsigned int lcd_clk, div; + + lcd_clk = clk_get_rate(par->lcdc_clk); + div = lcd_clk / par->pxl_clk; + + /* Configure the LCD clock divisor. */ + lcdc_write(LCD_CLK_DIVISOR(div) | + (LCD_RASTER_MODE & 0x1), LCD_CTRL_REG); +} + static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, struct da8xx_panel *panel) { u32 bpp; int ret = 0; + unsigned int lcd_clk, div; lcd_reset(par); - /* Configure the LCD clock divisor. */ - lcdc_write(LCD_CLK_DIVISOR(panel->pxl_clk) | - (LCD_RASTER_MODE & 0x1), LCD_CTRL_REG); + /* Calculate the divider */ + lcd_calc_clk_divider(par); if (panel->invert_pxl_clk) lcdc_write((lcdc_read(LCD_RASTER_TIMING_2_REG) | @@ -721,6 +734,8 @@ static int __init fb_probe(struct platform_device *device) } par = da8xx_fb_info->par; + par->lcdc_clk = fb_clk; + par->pxl_clk = lcdc_info->pxl_clk; if (lcd_init(par, lcd_cfg, lcdc_info) < 0) { dev_err(&device->dev, "lcd_init failed\n"); @@ -753,8 +768,6 @@ static int __init fb_probe(struct platform_device *device) da8xx_fb_fix.smem_len = par->databuf_sz - par->palette_sz; da8xx_fb_fix.line_length = (lcdc_info->width * lcd_cfg->bpp) / 8; - par->lcdc_clk = fb_clk; - par->irq = platform_get_irq(device, 0); if (par->irq < 0) { ret = -ENOENT; -- 1.5.6 |
From: Ralf B. <ra...@li...> - 2009-10-14 13:42:34
|
On Mon, Oct 12, 2009 at 02:29:07AM +0200, Ralf Baechle wrote: > Any reason this still hasn't been applied? So applied then. Ralf |
From: Ralf B. <ra...@li...> - 2009-10-12 00:43:32
|
On Sun, Aug 09, 2009 at 11:42:32AM +0200, Julia Lawall wrote: > From: Julia Lawall <ju...@di...> > > request_region should be used with release_region, not request_mem_region. > > Geert Uytterhoeven pointed out that in the case of drivers/video/gbefb.c, > the problem is actually the other way around; request_mem_region should be > used instead of request_region. > > The semantic patch that finds/fixes this problem is as follows: > (http://coccinelle.lip6.fr/) > > // <smpl> > @r1@ > expression start; > @@ > > request_region(start,...) > > @b1@ > expression r1.start; > @@ > > request_mem_region(start,...) > > @depends on !b1@ > expression r1.start; > expression E; > @@ > > - release_mem_region > + release_region > (start,E) > // </smpl> > > Signed-off-by: Julia Lawall <ju...@di...> Any reason this still hasn't been applied? Ralf |
From: Greg KH <gr...@kr...> - 2009-10-09 22:38:16
|
On Fri, Oct 02, 2009 at 02:40:03PM +0200, Philipp Reisner wrote: > Affected: All code that uses connector, in kernel and out of mainline > > The connector, as it is today, does not allow the in kernel receiving > parts to do any checks on privileges of a message's sender. > > I know, there are not many out there that like connector, but as > long as it is in the kernel, we have to fix the security issues it has! > > Please either drop connector, or someone who feels a bit responsible > and has our beloved dictator's blessing, PLEASE PLEASE PLEASE take > this into your tree, and send the pull request to Linus. > > Patches 1 to 4 are already Acked-by Evgeny, the connector's maintainer. > Patches 5 to 7 are the obvious fixes to the connector user's code. These don't apply to the 2.6.31-stable tree at all. Could you provide them backported to that tree if you want to see them go into a .31-stable release? thanks, greg k-h |
From: Claudio S. <cl...@ev...> - 2009-10-08 09:25:22
|
Hi Nicolas, this patch fixes a type mismatch when calling dev_info() in the atmel_lcdfb.c driver. Please commit. Best regards, Claudio |
From: Mikulas P. <mpa...@re...> - 2009-10-07 12:40:32
|
On Wed, 7 Oct 2009, Paul Mackerras wrote: > Mikulas Patocka writes: > > > In the previous kernel cycle I sent you this patch, you acknowledged it > > but didn't put it to the kernel. > > > > Did you forget it? Do you want to add it in this cycle? > > > > The patch fixes mach64 fill rect routine for 15 and 16-bit modes. > > Huh? Are you talking to me? Why did you think I was responsible for > this driver? > > Paul. There's a line in the MAINTAINERS file: RAGE128 FRAMEBUFFER DISPLAY DRIVER M: Paul Mackerras <pa...@sa...> L: lin...@li... (moderated for non-subscribers) S: Maintained F: drivers/video/aty/aty128fb.c This patch is for aty/mach64.c but you're closest to that, there is no entry for aty/mach64.c in Maintainers. Mikulas |
From: Alex D. <ale...@gm...> - 2009-10-07 04:59:11
|
On Wed, Oct 7, 2009 at 12:25 AM, <thu...@xs...> wrote: > From: Alex Deucher <ale...@gm...> > Date: Tue, Oct 06, 2009 at 10:27:01AM -0400 >> >> radeonfb doesn't support any avivo-based radeons and never will. If >> you want hi-res consoles, use the the new radeon drm with modesetting. >> It's available in 2.6.31 and supports all r1xx-r5xx radeons. Support >> for r6xx-r7xx is available in 2.6.32. >> > Thanks! > > It works, but I find the lack of documentation disturbing. As it is, > adding radeon.modeset=1 to the commandline switches my screen to the > correct resolution. This is partly because I have a TFT screen on this > laptop. I've not been able to find anything about changing the > resolution, so with a CRT monitor I don't know how you would go about > that. > > Also, a hint or two somewhere in linux-2.6.23-rc3/Documentation/ would > be nice. At the moment, the word 'KMS' is not used in any file there. No > wonder I couldn't find it when I configured my kernel. > > So far, I've seen 5 good boots and one with a hang (garbage on screen, > hanging laptop) - there's room for improvement yet. DRM modesetting support is still a bit in flux (that's why it's in staging). Support for changing the console fb mode was only recently added. It could probably use more documentation though. Alex |
From: <thu...@xs...> - 2009-10-07 04:25:36
|
From: Alex Deucher <ale...@gm...> Date: Tue, Oct 06, 2009 at 10:27:01AM -0400 > > radeonfb doesn't support any avivo-based radeons and never will. If > you want hi-res consoles, use the the new radeon drm with modesetting. > It's available in 2.6.31 and supports all r1xx-r5xx radeons. Support > for r6xx-r7xx is available in 2.6.32. > Thanks! It works, but I find the lack of documentation disturbing. As it is, adding radeon.modeset=1 to the commandline switches my screen to the correct resolution. This is partly because I have a TFT screen on this laptop. I've not been able to find anything about changing the resolution, so with a CRT monitor I don't know how you would go about that. Also, a hint or two somewhere in linux-2.6.23-rc3/Documentation/ would be nice. At the moment, the word 'KMS' is not used in any file there. No wonder I couldn't find it when I configured my kernel. So far, I've seen 5 good boots and one with a hang (garbage on screen, hanging laptop) - there's room for improvement yet. Kind regards, Jurriaan -- It has a name, among the Voyani. Lumina Arden. The light that burns. You will feel its fire, Serra Diora. Michelle West - The Broken Crown |
From: Paul M. <pa...@sa...> - 2009-10-07 04:20:59
|
Mikulas Patocka writes: > In the previous kernel cycle I sent you this patch, you acknowledged it > but didn't put it to the kernel. > > Did you forget it? Do you want to add it in this cycle? > > The patch fixes mach64 fill rect routine for 15 and 16-bit modes. Huh? Are you talking to me? Why did you think I was responsible for this driver? Paul. |
From: Mikulas P. <mpa...@re...> - 2009-10-06 16:22:00
|
Hi In the previous kernel cycle I sent you this patch, you acknowledged it but didn't put it to the kernel. Did you forget it? Do you want to add it in this cycle? The patch fixes mach64 fill rect routine for 15 and 16-bit modes. Mikulas ---------- Forwarded message ---------- Date: Wed, 17 Jun 2009 06:00:53 -0400 (EDT) From: Mikulas Patocka <mpa...@re...> To: pa...@sa... Cc: lin...@li... Subject: [PATCH] Fix colors in mach64 accelerator Use the same color-calculating algorithm as in atyfb_imageblit in this driver or in generic cfb_fillrect. This patch fixes bad colors when using an accelerator in 15-bit and 16-bit modes. Signed-off-by: Mikulas Patocka <mpa...@re... --- drivers/video/aty/mach64_accel.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) Index: linux-2.6.30-fast/drivers/video/aty/mach64_accel.c =================================================================== --- linux-2.6.30-fast.orig/drivers/video/aty/mach64_accel.c 2009-06-15 21:42:10.000000000 +0200 +++ linux-2.6.30-fast/drivers/video/aty/mach64_accel.c 2009-06-17 08:49:01.000000000 +0200 @@ -239,7 +239,7 @@ void atyfb_copyarea(struct fb_info *info void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { struct atyfb_par *par = (struct atyfb_par *) info->par; - u32 color = rect->color, dx = rect->dx, width = rect->width, rotation = 0; + u32 color, dx = rect->dx, width = rect->width, rotation = 0; if (par->asleep) return; @@ -250,8 +250,11 @@ void atyfb_fillrect(struct fb_info *info return; } - color |= (rect->color << 8); - color |= (rect->color << 16); + if (info->fix.visual == FB_VISUAL_TRUECOLOR || + info->fix.visual == FB_VISUAL_DIRECTCOLOR) + color = ((u32 *)(info->pseudo_palette))[rect->color]; + else + color = rect->color; if (info->var.bits_per_pixel == 24) { /* In 24 bpp, the engine is in 8 bpp - this requires that all */ |
From: Alex D. <ale...@gm...> - 2009-10-06 14:27:14
|
On Tue, Oct 6, 2009 at 10:20 AM, Jurriaan <thu...@xs...> wrote: > I'm wondering who I have to send pizza, beer or flowers to to get > support for the videocard in my Thinkpad T60p - an Ati Mobility FireGL > V5250. X.org works flawlessly with this card (using the opensource > driver). Compiling in radeonfb leads to a dmesg output without any > messages, since the pci-id is missing in the source core and the card is > not recognized. > > Is anybody working on this? radeonfb doesn't support any avivo-based radeons and never will. If you want hi-res consoles, use the the new radeon drm with modesetting. It's available in 2.6.31 and supports all r1xx-r5xx radeons. Support for r6xx-r7xx is available in 2.6.32. Alex |
From: Jurriaan <thu...@xs...> - 2009-10-06 14:20:35
|
I'm wondering who I have to send pizza, beer or flowers to to get support for the videocard in my Thinkpad T60p - an Ati Mobility FireGL V5250. X.org works flawlessly with this card (using the opensource driver). Compiling in radeonfb leads to a dmesg output without any messages, since the pci-id is missing in the source core and the card is not recognized. Is anybody working on this? Kind regards, Jurriaan -- It has a name, among the Voyani. Lumina Arden. The light that burns. You will feel its fire, Serra Diora. Michelle West - The Broken Crown |
From: Mike F. <va...@ge...> - 2009-10-06 06:02:37
|
From: Michael Hennerich <mic...@an...> Framebuffer driver for the Landscape LCD EZ-Extender (ADZS-BFLLCD-EZEXT) http://docs.blackfin.uclinux.org/doku.php?id=hw:cards:landscape_lcd_ez-extender Signed-off-by: Michael Hennerich <mic...@an...> Signed-off-by: Bryan Wu <coo...@ke...> Signed-off-by: Mike Frysinger <va...@ge...> --- v4 - fix Kconfig SPI depend pointed out by akpm - add module info to Kconfig help text arch/blackfin/include/asm/bfin-lq035q1.h | 28 + drivers/video/Kconfig | 15 + drivers/video/Makefile | 1 + drivers/video/bfin-lq035q1-fb.c | 826 ++++++++++++++++++++++++++++++ 4 files changed, 870 insertions(+), 0 deletions(-) create mode 100644 arch/blackfin/include/asm/bfin-lq035q1.h create mode 100644 drivers/video/bfin-lq035q1-fb.c diff --git a/arch/blackfin/include/asm/bfin-lq035q1.h b/arch/blackfin/include/asm/bfin-lq035q1.h new file mode 100644 index 0000000..57bc21a --- /dev/null +++ b/arch/blackfin/include/asm/bfin-lq035q1.h @@ -0,0 +1,28 @@ +/* + * Blackfin LCD Framebuffer driver SHARP LQ035Q1DH02 + * + * Copyright 2008-2009 Analog Devices Inc. + * Licensed under the GPL-2 or later. + */ + +#ifndef BFIN_LQ035Q1_H +#define BFIN_LQ035Q1_H + +#define LQ035_RL (0 << 8) /* Right -> Left Scan */ +#define LQ035_LR (1 << 8) /* Left -> Right Scan */ +#define LQ035_TB (1 << 9) /* Top -> Botton Scan */ +#define LQ035_BT (0 << 9) /* Botton -> Top Scan */ +#define LQ035_BGR (1 << 11) /* Use BGR format */ +#define LQ035_RGB (0 << 11) /* Use RGB format */ +#define LQ035_NORM (1 << 13) /* Reversal */ +#define LQ035_REV (0 << 13) /* Reversal */ + +struct bfin_lq035q1fb_disp_info { + + unsigned mode; + /* GPIOs */ + int use_bl; + unsigned gpio_bl; +}; + +#endif /* BFIN_LQ035Q1_H */ diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 9bbb285..bfc26d8 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -611,6 +611,21 @@ config FB_BFIN_T350MCQB This display is a QVGA 320x240 24-bit RGB display interfaced by an 8-bit wide PPI It uses PPI[0..7] PPI_FS1, PPI_FS2 and PPI_CLK. +config FB_BFIN_LQ035Q1 + tristate "SHARP LQ035Q1DH02 TFT LCD" + depends on FB && BLACKFIN && SPI + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + select BFIN_GPTIMERS + help + This is the framebuffer device driver for a SHARP LQ035Q1DH02 TFT display found on + the Blackfin Landscape LCD EZ-Extender Card. + This display is a QVGA 320x240 18-bit RGB display interfaced by an 16-bit wide PPI + It uses PPI[0..15] PPI_FS1, PPI_FS2 and PPI_CLK. + + To compile this driver as a module, choose M here: the + module will be called bfin-lq035q1-fb. config FB_STI tristate "HP STI frame buffer device support" diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 80232e1..42df98d 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -136,6 +136,7 @@ obj-$(CONFIG_FB_EFI) += efifb.o obj-$(CONFIG_FB_VGA16) += vga16fb.o obj-$(CONFIG_FB_OF) += offb.o obj-$(CONFIG_FB_BF54X_LQ043) += bf54x-lq043fb.o +obj-$(CONFIG_FB_BFIN_LQ035Q1) += bfin-lq035q1-fb.o obj-$(CONFIG_FB_BFIN_T350MCQB) += bfin-t350mcqb-fb.o obj-$(CONFIG_FB_MX3) += mx3fb.o obj-$(CONFIG_FB_DA8XX) += da8xx-fb.o diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c new file mode 100644 index 0000000..b690c26 --- /dev/null +++ b/drivers/video/bfin-lq035q1-fb.c @@ -0,0 +1,826 @@ +/* + * Blackfin LCD Framebuffer driver SHARP LQ035Q1DH02 + * + * Copyright 2008-2009 Analog Devices Inc. + * Licensed under the GPL-2 or later. + */ + +#define DRIVER_NAME "bfin-lq035q1" +#define pr_fmt(fmt) DRIVER_NAME ": " fmt + +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/errno.h> +#include <linux/string.h> +#include <linux/fb.h> +#include <linux/init.h> +#include <linux/types.h> +#include <linux/interrupt.h> +#include <linux/device.h> +#include <linux/backlight.h> +#include <linux/lcd.h> +#include <linux/dma-mapping.h> +#include <linux/platform_device.h> +#include <linux/spi/spi.h> +#include <linux/dma-mapping.h> + +#include <asm/blackfin.h> +#include <asm/irq.h> +#include <asm/dma.h> +#include <asm/portmux.h> +#include <asm/gptimers.h> + +#include <asm/bfin-lq035q1.h> + +#if defined(BF533_FAMILY) || defined(BF538_FAMILY) +#define TIMER_HSYNC_id TIMER1_id +#define TIMER_HSYNCbit TIMER1bit +#define TIMER_HSYNC_STATUS_TRUN TIMER_STATUS_TRUN1 +#define TIMER_HSYNC_STATUS_TIMIL TIMER_STATUS_TIMIL1 +#define TIMER_HSYNC_STATUS_TOVF TIMER_STATUS_TOVF1 + +#define TIMER_VSYNC_id TIMER2_id +#define TIMER_VSYNCbit TIMER2bit +#define TIMER_VSYNC_STATUS_TRUN TIMER_STATUS_TRUN2 +#define TIMER_VSYNC_STATUS_TIMIL TIMER_STATUS_TIMIL2 +#define TIMER_VSYNC_STATUS_TOVF TIMER_STATUS_TOVF2 +#else +#define TIMER_HSYNC_id TIMER0_id +#define TIMER_HSYNCbit TIMER0bit +#define TIMER_HSYNC_STATUS_TRUN TIMER_STATUS_TRUN0 +#define TIMER_HSYNC_STATUS_TIMIL TIMER_STATUS_TIMIL0 +#define TIMER_HSYNC_STATUS_TOVF TIMER_STATUS_TOVF0 + +#define TIMER_VSYNC_id TIMER1_id +#define TIMER_VSYNCbit TIMER1bit +#define TIMER_VSYNC_STATUS_TRUN TIMER_STATUS_TRUN1 +#define TIMER_VSYNC_STATUS_TIMIL TIMER_STATUS_TIMIL1 +#define TIMER_VSYNC_STATUS_TOVF TIMER_STATUS_TOVF1 +#endif + +#define LCD_X_RES 320 /* Horizontal Resolution */ +#define LCD_Y_RES 240 /* Vertical Resolution */ +#define DMA_BUS_SIZE 16 + +#define USE_RGB565_16_BIT_PPI + +#ifdef USE_RGB565_16_BIT_PPI +#define LCD_BPP 16 /* Bit Per Pixel */ +#define CLOCKS_PER_PIX 1 +#define CPLD_PIPELINE_DELAY_COR 0 /* NO CPLB */ +#endif + +/* Interface 16/18-bit TFT over an 8-bit wide PPI using a small Programmable Logic Device (CPLD) + * http://blackfin.uclinux.org/gf/project/stamp/frs/?action=FrsReleaseBrowse&frs_package_id=165 + */ + +#ifdef USE_RGB565_8_BIT_PPI +#define LCD_BPP 16 /* Bit Per Pixel */ +#define CLOCKS_PER_PIX 2 +#define CPLD_PIPELINE_DELAY_COR 3 /* RGB565 */ +#endif + +#ifdef USE_RGB888_8_BIT_PPI +#define LCD_BPP 24 /* Bit Per Pixel */ +#define CLOCKS_PER_PIX 3 +#define CPLD_PIPELINE_DELAY_COR 5 /* RGB888 */ +#endif + + /* + * HS and VS timing parameters (all in number of PPI clk ticks) + */ + +#define U_LINE 4 /* Blanking Lines */ + +#define H_ACTPIX (LCD_X_RES * CLOCKS_PER_PIX) /* active horizontal pixel */ +#define H_PERIOD (336 * CLOCKS_PER_PIX) /* HS period */ +#define H_PULSE (2 * CLOCKS_PER_PIX) /* HS pulse width */ +#define H_START (7 * CLOCKS_PER_PIX + CPLD_PIPELINE_DELAY_COR) /* first valid pixel */ + +#define V_LINES (LCD_Y_RES + U_LINE) /* total vertical lines */ +#define V_PULSE (2 * CLOCKS_PER_PIX) /* VS pulse width (1-5 H_PERIODs) */ +#define V_PERIOD (H_PERIOD * V_LINES) /* VS period */ + +#define ACTIVE_VIDEO_MEM_OFFSET ((U_LINE / 2) * LCD_X_RES * (LCD_BPP / 8)) + +#define BFIN_LCD_NBR_PALETTE_ENTRIES 256 + +#define PPI_TX_MODE 0x2 +#define PPI_XFER_TYPE_11 0xC +#define PPI_PORT_CFG_01 0x10 +#define PPI_POLS_1 0x8000 + +#if (CLOCKS_PER_PIX > 1) +#define PPI_PMODE (DLEN_8 | PACK_EN) +#else +#define PPI_PMODE (DLEN_16) +#endif + +#define LQ035_INDEX 0x74 +#define LQ035_DATA 0x76 + +#define LQ035_DRIVER_OUTPUT_CTL 0x1 +#define LQ035_SHUT_CTL 0x11 + +#define LQ035_DRIVER_OUTPUT_MASK (LQ035_LR | LQ035_TB | LQ035_BGR | LQ035_REV) +#define LQ035_DRIVER_OUTPUT_DEFAULT (0x2AEF & ~LQ035_DRIVER_OUTPUT_MASK) + +#define LQ035_SHUT (1 << 0) /* Shutdown */ +#define LQ035_ON (0 << 0) /* Shutdown */ + +struct bfin_lq035q1fb_info { + struct fb_info *fb; + struct device *dev; + struct spi_driver spidrv; + struct bfin_lq035q1fb_disp_info *disp_info; + unsigned char *fb_buffer; /* RGB Buffer */ + dma_addr_t dma_handle; + int lq035_open_cnt; + int irq; + spinlock_t lock; /* lock */ + u32 pseudo_pal[16]; +}; + +static int nocursor; +module_param(nocursor, int, 0644); +MODULE_PARM_DESC(nocursor, "cursor enable/disable"); + +struct spi_control { + unsigned short mode; +}; + +static int lq035q1_control(struct spi_device *spi, unsigned char reg, unsigned short value) +{ + int ret; + u8 regs[3] = { LQ035_INDEX, 0, 0 }; + u8 dat[3] = { LQ035_DATA, 0, 0 }; + + if (!spi) + return -ENODEV; + + regs[2] = reg; + dat[1] = value >> 8; + dat[2] = value & 0xFF; + + ret = spi_write(spi, regs, ARRAY_SIZE(regs)); + ret |= spi_write(spi, dat, ARRAY_SIZE(dat)); + return ret; +} + +static int __devinit lq035q1_spidev_probe(struct spi_device *spi) +{ + int ret; + struct spi_control *ctl; + struct bfin_lq035q1fb_info *info = container_of(spi->dev.driver, + struct bfin_lq035q1fb_info, + spidrv.driver); + + ctl = kzalloc(sizeof(*ctl), GFP_KERNEL); + + if (!ctl) + return -ENOMEM; + + ctl->mode = (info->disp_info->mode & + LQ035_DRIVER_OUTPUT_MASK) | LQ035_DRIVER_OUTPUT_DEFAULT; + + ret = lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON); + ret |= lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode); + if (ret) + return ret; + + spi_set_drvdata(spi, ctl); + + return 0; +} + +static int lq035q1_spidev_remove(struct spi_device *spi) +{ + return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); +} + +#ifdef CONFIG_PM +static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state) +{ + return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); +} + +static int lq035q1_spidev_resume(struct spi_device *spi) +{ + int ret; + struct spi_control *ctl = spi_get_drvdata(spi); + + ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode); + if (ret) + return ret; + + return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON); +} +#else +# define lq035q1_spidev_suspend NULL +# define lq035q1_spidev_resume NULL +#endif + +/* Power down all displays on reboot, poweroff or halt */ +static void lq035q1_spidev_shutdown(struct spi_device *spi) +{ + lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); +} + +static int lq035q1_backlight(struct bfin_lq035q1fb_info *info, unsigned arg) +{ + if (info->disp_info->use_bl) + gpio_set_value(info->disp_info->gpio_bl, arg); + + return 0; +} + +static void bfin_lq035q1_config_ppi(struct bfin_lq035q1fb_info *fbi) +{ + bfin_write_PPI_DELAY(H_START); + bfin_write_PPI_COUNT(H_ACTPIX - 1); + bfin_write_PPI_FRAME(V_LINES); + + bfin_write_PPI_CONTROL(PPI_TX_MODE | /* output mode , PORT_DIR */ + PPI_XFER_TYPE_11 | /* sync mode XFR_TYPE */ + PPI_PORT_CFG_01 | /* two frame sync PORT_CFG */ + PPI_PMODE | /* 8/16 bit data length / PACK_EN? */ + PPI_POLS_1); /* faling edge syncs POLS */ +} + +static inline void bfin_lq035q1_disable_ppi(void) +{ + bfin_write_PPI_CONTROL(bfin_read_PPI_CONTROL() & ~PORT_EN); +} + +static inline void bfin_lq035q1_enable_ppi(void) +{ + bfin_write_PPI_CONTROL(bfin_read_PPI_CONTROL() | PORT_EN); +} + +static void bfin_lq035q1_start_timers(void) +{ + enable_gptimers(TIMER_VSYNCbit | TIMER_HSYNCbit); +} + +static void bfin_lq035q1_stop_timers(void) +{ + disable_gptimers(TIMER_HSYNCbit | TIMER_VSYNCbit); + + set_gptimer_status(0, TIMER_HSYNC_STATUS_TRUN | TIMER_VSYNC_STATUS_TRUN | + TIMER_HSYNC_STATUS_TIMIL | TIMER_VSYNC_STATUS_TIMIL | + TIMER_HSYNC_STATUS_TOVF | TIMER_VSYNC_STATUS_TOVF); + +} + +static void bfin_lq035q1_init_timers(void) +{ + + bfin_lq035q1_stop_timers(); + + set_gptimer_period(TIMER_HSYNC_id, H_PERIOD); + set_gptimer_pwidth(TIMER_HSYNC_id, H_PULSE); + set_gptimer_config(TIMER_HSYNC_id, TIMER_MODE_PWM | TIMER_PERIOD_CNT | + TIMER_TIN_SEL | TIMER_CLK_SEL| + TIMER_EMU_RUN); + + set_gptimer_period(TIMER_VSYNC_id, V_PERIOD); + set_gptimer_pwidth(TIMER_VSYNC_id, V_PULSE); + set_gptimer_config(TIMER_VSYNC_id, TIMER_MODE_PWM | TIMER_PERIOD_CNT | + TIMER_TIN_SEL | TIMER_CLK_SEL | + TIMER_EMU_RUN); + +} + +static void bfin_lq035q1_config_dma(struct bfin_lq035q1fb_info *fbi) +{ + + set_dma_config(CH_PPI, + set_bfin_dma_config(DIR_READ, DMA_FLOW_AUTO, + INTR_DISABLE, DIMENSION_2D, + DATA_SIZE_16, + DMA_NOSYNC_KEEP_DMA_BUF)); + set_dma_x_count(CH_PPI, (LCD_X_RES * LCD_BPP) / DMA_BUS_SIZE); + set_dma_x_modify(CH_PPI, DMA_BUS_SIZE / 8); + set_dma_y_count(CH_PPI, V_LINES); + + set_dma_y_modify(CH_PPI, DMA_BUS_SIZE / 8); + set_dma_start_addr(CH_PPI, (unsigned long)fbi->fb_buffer); + +} + +#if (CLOCKS_PER_PIX == 1) +static const u16 ppi0_req_16[] = {P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2, + P_PPI0_D0, P_PPI0_D1, P_PPI0_D2, + P_PPI0_D3, P_PPI0_D4, P_PPI0_D5, + P_PPI0_D6, P_PPI0_D7, P_PPI0_D8, + P_PPI0_D9, P_PPI0_D10, P_PPI0_D11, + P_PPI0_D12, P_PPI0_D13, P_PPI0_D14, + P_PPI0_D15, 0}; +#else +static const u16 ppi0_req_16[] = {P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2, + P_PPI0_D0, P_PPI0_D1, P_PPI0_D2, + P_PPI0_D3, P_PPI0_D4, P_PPI0_D5, + P_PPI0_D6, P_PPI0_D7, 0}; +#endif + +static inline void bfin_lq035q1_free_ports(void) +{ + peripheral_free_list(ppi0_req_16); + if (ANOMALY_05000400) + gpio_free(P_IDENT(P_PPI0_FS3)); +} + +static int __devinit bfin_lq035q1_request_ports(struct platform_device *pdev) +{ + /* ANOMALY_05000400 - PPI Does Not Start Properly In Specific Mode: + * Drive PPI_FS3 Low + */ + if (ANOMALY_05000400) { + int ret = gpio_request(P_IDENT(P_PPI0_FS3), "PPI_FS3"); + if (ret) + return ret; + gpio_direction_output(P_IDENT(P_PPI0_FS3), 0); + } + + if (peripheral_request_list(ppi0_req_16, DRIVER_NAME)) { + dev_err(&pdev->dev, "requesting peripherals failed\n"); + return -EFAULT; + } + + return 0; +} + +static int bfin_lq035q1_fb_open(struct fb_info *info, int user) +{ + struct bfin_lq035q1fb_info *fbi = info->par; + + spin_lock(&fbi->lock); + fbi->lq035_open_cnt++; + + if (fbi->lq035_open_cnt <= 1) { + + bfin_lq035q1_disable_ppi(); + SSYNC(); + + bfin_lq035q1_config_dma(fbi); + bfin_lq035q1_config_ppi(fbi); + bfin_lq035q1_init_timers(); + + /* start dma */ + enable_dma(CH_PPI); + bfin_lq035q1_enable_ppi(); + bfin_lq035q1_start_timers(); + lq035q1_backlight(fbi, 1); + } + + spin_unlock(&fbi->lock); + + return 0; +} + +static int bfin_lq035q1_fb_release(struct fb_info *info, int user) +{ + struct bfin_lq035q1fb_info *fbi = info->par; + + spin_lock(&fbi->lock); + + fbi->lq035_open_cnt--; + + if (fbi->lq035_open_cnt <= 0) { + lq035q1_backlight(fbi, 0); + bfin_lq035q1_disable_ppi(); + SSYNC(); + disable_dma(CH_PPI); + bfin_lq035q1_stop_timers(); + } + + spin_unlock(&fbi->lock); + + return 0; +} + +static int bfin_lq035q1_fb_check_var(struct fb_var_screeninfo *var, + struct fb_info *info) +{ + switch (var->bits_per_pixel) { +#if (LCD_BPP == 24) + case 24:/* TRUECOLOUR, 16m */ +#else + case 16:/* DIRECTCOLOUR, 64k */ +#endif + var->red.offset = info->var.red.offset; + var->green.offset = info->var.green.offset; + var->blue.offset = info->var.blue.offset; + var->red.length = info->var.red.length; + var->green.length = info->var.green.length; + var->blue.length = info->var.blue.length; + var->transp.offset = 0; + var->transp.length = 0; + var->transp.msb_right = 0; + var->red.msb_right = 0; + var->green.msb_right = 0; + var->blue.msb_right = 0; + break; + default: + pr_debug("%s: depth not supported: %u BPP\n", __func__, + var->bits_per_pixel); + return -EINVAL; + } + + if (info->var.xres != var->xres || info->var.yres != var->yres || + info->var.xres_virtual != var->xres_virtual || + info->var.yres_virtual != var->yres_virtual) { + pr_debug("%s: Resolution not supported: X%u x Y%u \n", + __func__, var->xres, var->yres); + return -EINVAL; + } + + /* + * Memory limit + */ + + if ((info->fix.line_length * var->yres_virtual) > info->fix.smem_len) { + pr_debug("%s: Memory Limit requested yres_virtual = %u\n", + __func__, var->yres_virtual); + return -ENOMEM; + } + + + return 0; +} + +int bfin_lq035q1_fb_cursor(struct fb_info *info, struct fb_cursor *cursor) +{ + if (nocursor) + return 0; + else + return -EINVAL; /* just to force soft_cursor() call */ +} + +static int bfin_lq035q1_fb_setcolreg(u_int regno, u_int red, u_int green, + u_int blue, u_int transp, + struct fb_info *info) +{ + if (regno >= BFIN_LCD_NBR_PALETTE_ENTRIES) + return -EINVAL; + + if (info->var.grayscale) { + /* grayscale = 0.30*R + 0.59*G + 0.11*B */ + red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8; + } + + if (info->fix.visual == FB_VISUAL_TRUECOLOR) { + + u32 value; + /* Place color in the pseudopalette */ + if (regno > 16) + return -EINVAL; + + red >>= (16 - info->var.red.length); + green >>= (16 - info->var.green.length); + blue >>= (16 - info->var.blue.length); + + value = (red << info->var.red.offset) | + (green << info->var.green.offset) | + (blue << info->var.blue.offset); + value &= 0xFFFFFF; + + ((u32 *) (info->pseudo_palette))[regno] = value; + + } + + return 0; +} + +static struct fb_ops bfin_lq035q1_fb_ops = { + .owner = THIS_MODULE, + .fb_open = bfin_lq035q1_fb_open, + .fb_release = bfin_lq035q1_fb_release, + .fb_check_var = bfin_lq035q1_fb_check_var, + .fb_fillrect = cfb_fillrect, + .fb_copyarea = cfb_copyarea, + .fb_imageblit = cfb_imageblit, + .fb_cursor = bfin_lq035q1_fb_cursor, + .fb_setcolreg = bfin_lq035q1_fb_setcolreg, +}; + +static irqreturn_t bfin_lq035q1_irq_error(int irq, void *dev_id) +{ + /*struct bfin_lq035q1fb_info *info = (struct bfin_lq035q1fb_info *)dev_id;*/ + + u16 status = bfin_read_PPI_STATUS(); + bfin_write_PPI_STATUS(-1); + + if (status) { + bfin_lq035q1_disable_ppi(); + disable_dma(CH_PPI); + + /* start dma */ + enable_dma(CH_PPI); + bfin_lq035q1_enable_ppi(); + bfin_write_PPI_STATUS(-1); + } + + return IRQ_HANDLED; +} + +static int __devinit bfin_lq035q1_probe(struct platform_device *pdev) +{ + struct bfin_lq035q1fb_info *info; + struct fb_info *fbinfo; + int ret; + + ret = request_dma(CH_PPI, DRIVER_NAME"_CH_PPI"); + if (ret < 0) { + dev_err(&pdev->dev, "PPI DMA unavailable\n"); + goto out1; + } + + fbinfo = framebuffer_alloc(sizeof(*info), &pdev->dev); + if (!fbinfo) { + ret = -ENOMEM; + goto out2; + } + + info = fbinfo->par; + info->fb = fbinfo; + info->dev = &pdev->dev; + + info->disp_info = pdev->dev.platform_data; + + platform_set_drvdata(pdev, fbinfo); + + strcpy(fbinfo->fix.id, DRIVER_NAME); + + fbinfo->fix.type = FB_TYPE_PACKED_PIXELS; + fbinfo->fix.type_aux = 0; + fbinfo->fix.xpanstep = 0; + fbinfo->fix.ypanstep = 0; + fbinfo->fix.ywrapstep = 0; + fbinfo->fix.accel = FB_ACCEL_NONE; + fbinfo->fix.visual = FB_VISUAL_TRUECOLOR; + + fbinfo->var.nonstd = 0; + fbinfo->var.activate = FB_ACTIVATE_NOW; + fbinfo->var.height = -1; + fbinfo->var.width = -1; + fbinfo->var.accel_flags = 0; + fbinfo->var.vmode = FB_VMODE_NONINTERLACED; + + fbinfo->var.xres = LCD_X_RES; + fbinfo->var.xres_virtual = LCD_X_RES; + fbinfo->var.yres = LCD_Y_RES; + fbinfo->var.yres_virtual = LCD_Y_RES; + fbinfo->var.bits_per_pixel = LCD_BPP; + + if (info->disp_info->mode & LQ035_BGR) { +#if (LCD_BPP == 24) + fbinfo->var.red.offset = 0; + fbinfo->var.green.offset = 8; + fbinfo->var.blue.offset = 16; +#else + fbinfo->var.red.offset = 0; + fbinfo->var.green.offset = 5; + fbinfo->var.blue.offset = 11; +#endif + } else { +#if (LCD_BPP == 24) + fbinfo->var.red.offset = 16; + fbinfo->var.green.offset = 8; + fbinfo->var.blue.offset = 0; +#else + fbinfo->var.red.offset = 11; + fbinfo->var.green.offset = 5; + fbinfo->var.blue.offset = 0; +#endif + } + + fbinfo->var.transp.offset = 0; + +#if (LCD_BPP == 24) + fbinfo->var.red.length = 8; + fbinfo->var.green.length = 8; + fbinfo->var.blue.length = 8; +#else + fbinfo->var.red.length = 5; + fbinfo->var.green.length = 6; + fbinfo->var.blue.length = 5; +#endif + + fbinfo->var.transp.length = 0; + + fbinfo->fix.smem_len = LCD_X_RES * LCD_Y_RES * LCD_BPP / 8 + + ACTIVE_VIDEO_MEM_OFFSET; + + fbinfo->fix.line_length = fbinfo->var.xres_virtual * + fbinfo->var.bits_per_pixel / 8; + + + fbinfo->fbops = &bfin_lq035q1_fb_ops; + fbinfo->flags = FBINFO_FLAG_DEFAULT; + + info->fb_buffer = + dma_alloc_coherent(NULL, fbinfo->fix.smem_len, &info->dma_handle, + GFP_KERNEL); + + if (NULL == info->fb_buffer) { + dev_err(&pdev->dev, "couldn't allocate dma buffer\n"); + ret = -ENOMEM; + goto out3; + } + + fbinfo->screen_base = (void *)info->fb_buffer + ACTIVE_VIDEO_MEM_OFFSET; + fbinfo->fix.smem_start = (int)info->fb_buffer + ACTIVE_VIDEO_MEM_OFFSET; + + fbinfo->fbops = &bfin_lq035q1_fb_ops; + + fbinfo->pseudo_palette = &info->pseudo_pal; + + ret = fb_alloc_cmap(&fbinfo->cmap, BFIN_LCD_NBR_PALETTE_ENTRIES, 0); + if (ret < 0) { + dev_err(&pdev->dev, "failed to allocate colormap (%d entries)\n", + BFIN_LCD_NBR_PALETTE_ENTRIES); + goto out4; + } + + ret = bfin_lq035q1_request_ports(pdev); + if (ret) { + dev_err(&pdev->dev, "couldn't request gpio port\n"); + goto out6; + } + + info->irq = platform_get_irq(pdev, 0); + if (info->irq < 0) { + ret = -EINVAL; + goto out7; + } + + ret = request_irq(info->irq, bfin_lq035q1_irq_error, IRQF_DISABLED, + DRIVER_NAME" PPI ERROR", info); + if (ret < 0) { + dev_err(&pdev->dev, "unable to request PPI ERROR IRQ\n"); + goto out7; + } + + info->spidrv.driver.name = DRIVER_NAME"-spi"; + info->spidrv.probe = lq035q1_spidev_probe; + info->spidrv.remove = __devexit_p(lq035q1_spidev_remove); + info->spidrv.shutdown = lq035q1_spidev_shutdown; + info->spidrv.suspend = lq035q1_spidev_suspend; + info->spidrv.resume = lq035q1_spidev_resume; + + ret = spi_register_driver(&info->spidrv); + if (ret < 0) { + dev_err(&pdev->dev, "couldn't register SPI Interface\n"); + goto out8; + } + + if (info->disp_info->use_bl) { + ret = gpio_request(info->disp_info->gpio_bl, "LQ035 Backlight"); + + if (ret) { + dev_err(&pdev->dev, "failed to request GPIO %d\n", + info->disp_info->gpio_bl); + goto out9; + } + gpio_direction_output(info->disp_info->gpio_bl, 0); + } + + ret = register_framebuffer(fbinfo); + if (ret < 0) { + dev_err(&pdev->dev, "unable to register framebuffer\n"); + goto out10; + } + + dev_info(&pdev->dev, "%dx%d %d-bit RGB FrameBuffer initialized\n", + LCD_X_RES, LCD_Y_RES, LCD_BPP); + + return 0; + + out10: + if (info->disp_info->use_bl) + gpio_free(info->disp_info->gpio_bl); + out9: + spi_unregister_driver(&info->spidrv); + out8: + free_irq(info->irq, info); + out7: + bfin_lq035q1_free_ports(); + out6: + fb_dealloc_cmap(&fbinfo->cmap); + out4: + dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer, + info->dma_handle); + out3: + framebuffer_release(fbinfo); + out2: + free_dma(CH_PPI); + out1: + platform_set_drvdata(pdev, NULL); + + return ret; +} + +static int __devexit bfin_lq035q1_remove(struct platform_device *pdev) +{ + struct fb_info *fbinfo = platform_get_drvdata(pdev); + struct bfin_lq035q1fb_info *info = fbinfo->par; + + if (info->disp_info->use_bl) + gpio_free(info->disp_info->gpio_bl); + + spi_unregister_driver(&info->spidrv); + + unregister_framebuffer(fbinfo); + + free_dma(CH_PPI); + free_irq(info->irq, info); + + if (info->fb_buffer != NULL) + dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer, + info->dma_handle); + + fb_dealloc_cmap(&fbinfo->cmap); + + bfin_lq035q1_free_ports(); + + platform_set_drvdata(pdev, NULL); + framebuffer_release(fbinfo); + + dev_info(&pdev->dev, "unregistered LCD driver\n"); + + return 0; +} + +#ifdef CONFIG_PM +static int bfin_lq035q1_suspend(struct device *dev) +{ + struct fb_info *fbinfo = dev_get_drvdata(dev); + struct bfin_lq035q1fb_info *info = fbinfo->par; + + if (info->lq035_open_cnt) { + lq035q1_backlight(info, 0); + bfin_lq035q1_disable_ppi(); + SSYNC(); + disable_dma(CH_PPI); + bfin_lq035q1_stop_timers(); + bfin_write_PPI_STATUS(-1); + } + + return 0; +} + +static int bfin_lq035q1_resume(struct device *dev) +{ + struct fb_info *fbinfo = dev_get_drvdata(dev); + struct bfin_lq035q1fb_info *info = fbinfo->par; + + if (info->lq035_open_cnt) { + bfin_lq035q1_disable_ppi(); + SSYNC(); + + bfin_lq035q1_config_dma(info); + bfin_lq035q1_config_ppi(info); + bfin_lq035q1_init_timers(); + + /* start dma */ + enable_dma(CH_PPI); + bfin_lq035q1_enable_ppi(); + bfin_lq035q1_start_timers(); + lq035q1_backlight(info, 1); + } + + return 0; +} + +static struct dev_pm_ops bfin_lq035q1_dev_pm_ops = { + .suspend = bfin_lq035q1_suspend, + .resume = bfin_lq035q1_resume, +}; +#endif + +static struct platform_driver bfin_lq035q1_driver = { + .probe = bfin_lq035q1_probe, + .remove = __devexit_p(bfin_lq035q1_remove), + .driver = { + .name = DRIVER_NAME, +#ifdef CONFIG_PM + .pm = &bfin_lq035q1_dev_pm_ops, +#endif + }, +}; + +static int __init bfin_lq035q1_driver_init(void) +{ + return platform_driver_register(&bfin_lq035q1_driver); +} +module_init(bfin_lq035q1_driver_init); + +static void __exit bfin_lq035q1_driver_cleanup(void) +{ + platform_driver_unregister(&bfin_lq035q1_driver); +} +module_exit(bfin_lq035q1_driver_cleanup); + +MODULE_DESCRIPTION("Blackfin TFT LCD Driver"); +MODULE_LICENSE("GPL"); -- 1.6.5.rc2 |
From: Evgeniy P. <zb...@io...> - 2009-10-04 10:55:02
|
On Fri, Oct 02, 2009 at 02:40:03PM +0200, Philipp Reisner (phi...@li...) wrote: > Affected: All code that uses connector, in kernel and out of mainline > > The connector, as it is today, does not allow the in kernel receiving > parts to do any checks on privileges of a message's sender. > > I know, there are not many out there that like connector, but as > long as it is in the kernel, we have to fix the security issues it has! > > Please either drop connector, or someone who feels a bit responsible > and has our beloved dictator's blessing, PLEASE PLEASE PLEASE take > this into your tree, and send the pull request to Linus. How expressive! :) > Patches 1 to 4 are already Acked-by Evgeny, the connector's maintainer. > Patches 5 to 7 are the obvious fixes to the connector user's code. I ack those changes either since they do not affect logic of the user. -- Evgeniy Polyakov |
From: Krzysztof H. <krz...@po...> - 2009-10-03 05:26:41
|
On Fri, 11 Sep 2009 20:05:04 +0200 Pawel Osciak <p.o...@sa...> wrote: > This feature allows blending based on color key value. > Pixels with key value get blended with alpha1, while the rest > gets blended with alpha0. > > Reviewed-by: Marek Szyprowski <m.s...@sa...> > Reviewed-by: Kyungmin Park <kyu...@sa...> > Signed-off-by: Pawel Osciak <p.o...@sa...> > > --- > arch/arm/plat-s3c/include/plat/s3c-fb.h | 2 ++ > drivers/video/s3c-fb.c | 27 ++++++++++++++++++++++++++- > 2 files changed, 28 insertions(+), 1 deletions(-) > Acked-by: Krzysztof Helt <krz...@wp...> ---------------------------------------------------------------------- Zobacz najwiekszy samolot na swiecie! Kliknij >>> http://link.interia.pl/f238f |
From: Krzysztof H. <krz...@po...> - 2009-10-03 05:25:04
|
On Fri, 11 Sep 2009 20:05:02 +0200 Pawel Osciak <p.o...@sa...> wrote: > This patch adds debugfs information in s3c-fb directory in > debugfs root. > > Reviewed-by: Marek Szyprowski <m.s...@sa...> > Reviewed-by: Kyungmin Park <kyu...@sa...> > Signed-off-by: Pawel Osciak <p.o...@sa...> > > --- > drivers/video/Kconfig | 16 +++- > drivers/video/s3c-fb.c | 237 ++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 249 insertions(+), 4 deletions(-) > > diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig > index 3b54b39..922a1cb 100644 > --- a/drivers/video/Kconfig > +++ b/drivers/video/Kconfig > @@ -1917,10 +1917,18 @@ config FB_S3C > Currently the support is only for the S3C6400 and S3C6410 SoCs. > > config FB_S3C_DEBUG_REGWRITE > - bool "Debug register writes" > - depends on FB_S3C > - ---help--- > - Show all register writes via printk(KERN_DEBUG) > + bool "Debug register writes" > + depends on FB_S3C > + ---help--- > + Show all register writes via printk(KERN_DEBUG) > + > +config FB_S3C_DEBUG_FS > + bool "Enable debug information in DebugFS" > + depends on FB_S3C && DEBUG_FS > + default n > + ---help--- > + Enable this if you want debugging information in debugfs. > + If unsure, say N. > > config FB_S3C2410 > tristate "S3C2410 LCD framebuffer support" > diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c > index 226d225..6721f20 100644 > --- a/drivers/video/s3c-fb.c > +++ b/drivers/video/s3c-fb.c > @@ -26,6 +26,12 @@ > > #include <plat/s3c-fb.h> > > +#ifdef CONFIG_FB_S3C_DEBUG_FS > +#include <linux/debugfs.h> > +#include <linux/seq_file.h> > +#endif > + > + > #include <mach/map.h> > #include <mach/regs-fb.h> > #include <plat/fb.h> > @@ -62,6 +68,11 @@ > > struct s3c_fb; > > +#ifdef CONFIG_FB_S3C_DEBUG_FS > +static void __devinit s3c_fb_debugfs_init(struct s3c_fb *sfb); > +static void __devinit s3c_fb_debugfs_remove(void); > +#endif > + > /** > * struct s3c_fb_win - per window private data for each framebuffer. > * @windata: The platform data supplied for the window configuration. > @@ -1441,6 +1452,10 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev) > > platform_set_drvdata(pdev, sfb); > > +#ifdef CONFIG_FB_S3C_DEBUG_FS > + s3c_fb_debugfs_init(sfb); > +#endif > + > return 0; > > err_irq: > @@ -1474,6 +1489,10 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev) > struct s3c_fb *sfb = platform_get_drvdata(pdev); > int win; > > +#ifdef CONFIG_FB_S3C_DEBUG_FS > + s3c_fb_debugfs_remove(); > +#endif > + > for (win = 0; win < S3C_FB_MAX_WIN; win++) > if (sfb->windows[win]) > s3c_fb_release_win(sfb, sfb->windows[win]); > @@ -1567,6 +1586,224 @@ static void __exit s3c_fb_cleanup(void) > platform_driver_unregister(&s3c_fb_driver); > } > > +/* DEBUGFS */ > + > +#ifdef CONFIG_FB_S3C_DEBUG_FS > +static struct dentry *debugfs_dir; > + > +static void *dbg_seq_next(struct seq_file *s, void *v, loff_t *pos) > +{ > + int *win_no; > + > + if (v == SEQ_START_TOKEN) > + return pos; > + > + win_no = (int *)pos; > + *win_no += 1; > + if (*win_no >= S3C_FB_MAX_WIN) > + return NULL; > + > + return pos; > +} > + > +static int dbg_blend_seq_show(struct seq_file *s, void *v) > +{ > + struct s3c_fb *sfb = s->private; > + int *win_no = v; > + u32 vidosdc, wincon; > + > + if (v == SEQ_START_TOKEN) { > + seq_printf(s, "win| mode AEN0 AEN1\n"); > + return 0; > + } > + > + if (!s3c_fb_has_alpha(*win_no)) > + return SEQ_SKIP; > + > + seq_printf(s, "%2d | ", *win_no); > + > + vidosdc = readl(sfb->regs + VIDOSD_C(*win_no)); > + wincon = readl(sfb->regs + WINCONx(*win_no)); > + if (wincon & WINCONx_BLD_PIX) { > + seq_printf(s, " per pixel "); > + if (wincon & WINCONx_ALPHA_SEL) > + seq_printf(s, "value "); > + else > + seq_printf(s, "global "); > + } else { > + seq_printf(s, " global "); > + if (wincon & WINCONx_ALPHA_SEL) > + seq_printf(s, "val 1 "); > + else > + seq_printf(s, "val 0 "); > + } > + seq_printf(s, "%04x %04x\n", > + (vidosdc & VIDOSD14C_ALPHA0_MASK) > + >> VIDOSD14C_ALPHA0_B_SHIFT, > + vidosdc & VIDOSD14C_ALPHA1_MASK); > + > + return 0; > +} > + > +static int dbg_ckey_seq_show(struct seq_file *s, void *v) > +{ > + struct s3c_fb *sfb = s->private; > + int *win_no = v; > + u32 keycon0, keycon1; > + > + if (v == SEQ_START_TOKEN) { > + seq_printf(s, "win| enabled direction value mask\n"); > + return 0; > + } > + > + if (!has_colorkey(*win_no)) > + return SEQ_SKIP; > + > + seq_printf(s, "%2d | ", *win_no); > + > + keycon0 = readl(sfb->regs + WxKEYCON0(*win_no)); > + keycon1 = readl(sfb->regs + WxKEYCON1(*win_no)); > + > + seq_printf(s, " %d ", keycon0 & WxKEYCON0_KEYEN_F); > + if (keycon0 & WxKEYCON0_DIRCON) > + seq_printf(s, " FG "); > + else > + seq_printf(s, " BG "); > + > + seq_printf(s, " %06x ", keycon1 & WxKEYCON1_COLVAL_MASK); > + seq_printf(s, "%06x ", keycon0 & WxKEYCON0_COMPKEY_MASK); > + seq_printf(s, "\n"); > + > + return 0; > +} > + > +static inline void *single_start(struct seq_file *p, loff_t *pos) > +{ > + if (*pos == 0) > + return SEQ_START_TOKEN; > + > + return NULL + (*pos == 0); > +} > + > +static inline void single_stop(struct seq_file *p, void *v) > +{ > +} > + > +static const struct seq_operations dbg_blend_seq_ops = { > + .start = single_start, > + .next = dbg_seq_next, > + .stop = single_stop, > + .show = dbg_blend_seq_show, > +}; > + > +static const struct seq_operations dbg_ckey_seq_ops = { > + .start = single_start, > + .next = dbg_seq_next, > + .stop = single_stop, > + .show = dbg_ckey_seq_show, > +}; > + > +static int dbg_blend_open(struct inode *inode, struct file *file) > +{ > + struct seq_file *seq; > + int ret; > + > + ret = seq_open(file, &dbg_blend_seq_ops); > + if (ret) > + return ret; > + > + seq = file->private_data; > + seq->private = inode->i_private; > + > + return 0; > +} > + > +static const struct file_operations dbg_blend_fops = { > + .owner = THIS_MODULE, > + .open = dbg_blend_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release = seq_release, > +}; > + > +static int dbg_ckey_open(struct inode *inode, struct file *file) > +{ > + struct seq_file *seq; > + int ret; > + > + ret = seq_open(file, &dbg_ckey_seq_ops); > + if (ret) > + return ret; > + > + seq = file->private_data; > + seq->private = inode->i_private; > + > + return 0; > +} > + > +static const struct file_operations dbg_ckey_fops = { > + .owner = THIS_MODULE, > + .open = dbg_ckey_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release = seq_release, > +}; > + > +static int dbg_winen_show(struct seq_file *s, void *v) > +{ > + struct s3c_fb *sfb = s->private; > + int win_no; > + > + for (win_no = 0; win_no < S3C_FB_MAX_WIN; ++win_no) { > + if (sfb->enabled & (1 << win_no)) > + seq_printf(s, "Win%d: enabled\n", win_no); > + else > + seq_printf(s, "Win%d: disabled\n", win_no); > + } > + > + return 0; > +} > + > +static int dbg_winen_open(struct inode *inode, struct file *file) > +{ > + return single_open(file, dbg_winen_show, inode->i_private); > +} > + > +static const struct file_operations dbg_winen_fops = { > + .owner = THIS_MODULE, > + .open = dbg_winen_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release = single_release, > +}; > + > +static void __devinit s3c_fb_debugfs_init(struct s3c_fb *sfb) > +{ > + debugfs_dir = debugfs_create_dir("s3c-fb", NULL); > + if (! debugfs_dir || IS_ERR(debugfs_dir)) { > + dev_warn(sfb->dev, "Could not create debugfs directory\n"); > + return; > + } > + > + debugfs_create_file("windows_enabled", S_IRUGO, debugfs_dir, sfb, > + &dbg_winen_fops); > + > + debugfs_create_file("blending", S_IRUGO, debugfs_dir, sfb, > + &dbg_blend_fops); > + > + debugfs_create_file("color_key", S_IRUGO, debugfs_dir, sfb, > + &dbg_ckey_fops); > +} > + > +static void __devinit s3c_fb_debugfs_remove(void) __devexit Regards, Krzysztof --------------------------------------------------------------- Przygotuj siê na przysz³o¶æ! Kliknij >>> http://link.interia.pl/f238a |
From: Krzysztof H. <krz...@po...> - 2009-10-03 05:21:35
|
On Fri, 11 Sep 2009 20:05:00 +0200 Pawel Osciak <p.o...@sa...> wrote: > Reviewed-by: Marek Szyprowski <m.s...@sa...> > Reviewed-by: Kyungmin Park <kyu...@sa...> > Signed-off-by: Pawel Osciak <p.o...@sa...> > Acked-by: Krzysztof Helt <krz...@wp...> > --- > drivers/video/s3c-fb.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c > index 307a7e8..226d225 100644 > --- a/drivers/video/s3c-fb.c > +++ b/drivers/video/s3c-fb.c > @@ -401,6 +401,7 @@ static int s3c_fb_set_par(struct fb_info *info) > writel(osdc_data, regs + VIDOSD_C(win_no)); > > data = WINCONx_ENWIN; > + sfb->enabled |= (1 << win_no); > > /* note, since we have to round up the bits-per-pixel, we end up > * relying on the bitfield information for r/g/b/a to work out > @@ -633,6 +634,7 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info) > /* disable the DMA and display 0x0 (black) */ > writel(WINxMAP_MAP | WINxMAP_MAP_COLOUR(0x0), > sfb->regs + WINxMAP(index)); > + sfb->enabled &= ~(1 << index); > break; > > case FB_BLANK_UNBLANK: > -- > 1.6.4.2.253.g0b1fac > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Linux-fbdev-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel ---------------------------------------------------------------------- Nie boisz sie wampirow! A wiêc Graj >>> http://link.interia.pl/f2390 |
From: Krzysztof H. <krz...@po...> - 2009-10-03 05:18:59
|
On Fri, 11 Sep 2009 20:04:57 +0200 Pawel Osciak <p.o...@sa...> wrote: > For S3C64xx, only windows 1 and 2 have VIDOSD_D registers. > The VIDOSD_x register functions differ depending on the window number, as > does the ability of setting up size and alpha: > > win0: size in VIDOSD_C > win1-2: alpha in VIDOSD_C and size in VIDOSD_D > win3-4: alpha in VIDOSD_C > > Reviewed-by: Marek Szyprowski <m.s...@sa...> > Reviewed-by: Kyungmin Park <kyu...@sa...> > Signed-off-by: Pawel Osciak <p.o...@sa...> > > --- > arch/arm/mach-s3c6400/include/mach/regs-fb.h | 14 +++++++- > arch/arm/plat-s3c/include/plat/regs-fb.h | 44 +++++++++++++------------ > drivers/video/s3c-fb.c | 27 ++++++++++------ > 3 files changed, 52 insertions(+), 33 deletions(-) > Acked-by: Krzysztof Helt <krz...@wp...> --------------------------------------------------------------- Zapytaj wró¿kê! Kliknij >>> http://link.interia.pl/f238d |
From: Krzysztof H. <krz...@po...> - 2009-10-03 05:16:01
|
On Fri, 11 Sep 2009 20:04:55 +0200 Pawel Osciak <p.o...@sa...> wrote: > Reviewed-by: Marek Szyprowski <m.s...@sa...> > Reviewed-by: Kyungmin Park <kyu...@sa...> > Signed-off-by: Pawel Osciak <p.o...@sa...> > > --- > arch/arm/mach-s3c6400/include/mach/regs-fb.h | 6 ++ > arch/arm/plat-s3c/include/plat/regs-fb.h | 7 +++ > arch/arm/plat-s3c/include/plat/s3c-fb.h | 27 +++++++++ > drivers/video/s3c-fb.c | 75 ++++++++++++++++++++++++++ > 4 files changed, 115 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/mach-s3c6400/include/mach/regs-fb.h b/arch/arm/mach-s3c6400/include/mach/regs-fb.h > index 6339426..84facc9 100644 > --- a/arch/arm/mach-s3c6400/include/mach/regs-fb.h > +++ b/arch/arm/mach-s3c6400/include/mach/regs-fb.h > @@ -24,6 +24,9 @@ > * override them at a later date. > */ > > +#ifndef __ASM_ARCH_REGS_FB_H > +#define __ASM_ARCH_REGS_FB_H __FILE__ > + > #include <plat/regs-fb.h> > > #define S3C_FB_MAX_WIN (5) /* number of hardware windows available. */ > @@ -262,3 +265,6 @@ static inline void s3c_fb_init_palette(unsigned int window, > * 1110 -none- -none- -none- -none- -none- > * 1111 -none- -none- -none- -none- -none- > */ > + > +#endif /* __ASM_ARCH_REGS_FB_H */ > + > diff --git a/arch/arm/plat-s3c/include/plat/regs-fb.h b/arch/arm/plat-s3c/include/plat/regs-fb.h > index 4c024ca..26b878b 100644 > --- a/arch/arm/plat-s3c/include/plat/regs-fb.h > +++ b/arch/arm/plat-s3c/include/plat/regs-fb.h > @@ -28,6 +28,9 @@ > * ensure all the localised SoC support is included as necessary. > */ > > +#ifndef __PLAT_S3C_REGS_FB_H > +#define __PLAT_S3C_REGS_FB_H __FILE__ > + > /* VIDCON0 */ > > #define VIDCON0 (0x00) > @@ -179,6 +182,8 @@ > #define WINCONx_BURSTLEN_16WORD (0x0 << 9) > #define WINCONx_BURSTLEN_8WORD (0x1 << 9) > #define WINCONx_BURSTLEN_4WORD (0x2 << 9) > +#define WINCONx_BLD_PIX (1 << 6) > +#define WINCONx_ALPHA_SEL (1 << 1) > > #define WINCONx_ENWIN (1 << 0) > #define WINCON0_BPPMODE_MASK (0xf << 2) > @@ -369,3 +374,5 @@ > #define WPALCON_W0PAL_16BPP_A555 (0x5 << 0) > #define WPALCON_W0PAL_16BPP_565 (0x6 << 0) > > +#endif /* __PLAT_S3C_REGS_FB_H */ > + > diff --git a/arch/arm/plat-s3c/include/plat/s3c-fb.h b/arch/arm/plat-s3c/include/plat/s3c-fb.h > index b08f9ad..080524d 100644 > --- a/arch/arm/plat-s3c/include/plat/s3c-fb.h > +++ b/arch/arm/plat-s3c/include/plat/s3c-fb.h > @@ -21,6 +21,16 @@ struct s3c_fb_color { > __u32 b : 8; > } __attribute__((__packed__)); > > +struct s3c_fb_alpha { > + __u32 reserved : 8; > + __u32 r0 : 4; > + __u32 g0 : 4; > + __u32 b0 : 4; > + __u32 r1 : 4; > + __u32 g1 : 4; > + __u32 b1 : 4; > +} __attribute__((__packed__)); > + > typedef enum s3c_fb_color_key_mode { > S3CFB_COLORKEY_MODE_BG = 0, > S3CFB_COLORKEY_MODE_FG = 1 > @@ -32,6 +42,17 @@ typedef enum s3c_fb_source { > S3CFB_SOURCE_LOCAL_YCbCr = 2 > } s3c_fb_source_t; > > +typedef enum s3c_fb_alpha_mode { > + /* Use alpha value from each pixel */ > + S3CFB_ALPHA_PIXEL_VALUE, > + /* Use global alpha (0 or 1) value chosen by alpha bit of the pixel */ > + S3CFB_ALPHA_PIXEL_SWITCH, > + /* Blend all pixels with global alpha0 value */ > + S3CFB_ALPHA_PLANE_0, > + /* Blend all pixels with global alpha1 value */ > + S3CFB_ALPHA_PLANE_1 > +} s3c_fb_alpha_mode_t; > + Please do not use typedef here. > #ifndef FBIO_WAITFORVSYNC > #define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) > #endif > @@ -50,5 +71,11 @@ typedef enum s3c_fb_source { > > /* Param: s3c_fb_source */ > #define S3CFB_IOCTL_SET_SOURCE _IO(S3CFB_IOCTL_MAGIC, 5) > + > +/* Param: s3c_fb_alpha_mode */ > +#define S3CFB_IOCTL_SET_ALPHA_MODE _IO(S3CFB_IOCTL_MAGIC, 6) > + > +#define S3CFB_IOCTL_SET_WINDOW_ALPHA _IOW(S3CFB_IOCTL_MAGIC, 7,\ > + struct s3c_fb_alpha) > #endif /* __LINUX_S3C_FB_H__ */ > > diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c > index 28622c0..54ed018 100644 > --- a/drivers/video/s3c-fb.c > +++ b/drivers/video/s3c-fb.c > @@ -997,6 +997,67 @@ static int s3c_fb_set_source(struct s3c_fb_win *win, s3c_fb_source_t source) > return 0; > } > > +static int s3c_fb_set_alpha_mode(struct s3c_fb_win *win, > + s3c_fb_alpha_mode_t mode) > +{ > + struct s3c_fb *sfb = win->parent; > + int wincon_reg; > + > + if (win->index == 0) { > + dev_err(sfb->dev, > + "Alpha mode for window %d is not supported.\n", > + win->index); > + return -EINVAL; > + } > + > + wincon_reg = readl(sfb->regs + WINCONx(win->index)); > + wincon_reg &= ~(WINCONx_BLD_PIX | WINCONx_ALPHA_SEL); > + The WINCONx_BLD_PIX is cleared inside the switch clause again. You may leave this line and shorten the switch cases. > + switch (mode) { > + case S3CFB_ALPHA_PIXEL_VALUE: > + /* Use alpha value of each pixel */ > + wincon_reg |= WINCONx_BLD_PIX | WINCONx_ALPHA_SEL; > + break; > + case S3CFB_ALPHA_PIXEL_SWITCH: > + /* Use global alpha chosen by the alpha bit of each pixel */ > + wincon_reg |= WINCONx_BLD_PIX; > + break; > + case S3CFB_ALPHA_PLANE_0: > + /* Use global alpha0 for every pixel */ > + wincon_reg &= ~WINCONx_BLD_PIX; > + break; > + case S3CFB_ALPHA_PLANE_1: > + /* Use global alpha1 for every pixel */ > + wincon_reg &= ~WINCONx_BLD_PIX; > + wincon_reg |= WINCONx_ALPHA_SEL; > + break; > + default: > + return -EINVAL; > + } > + > + writel(wincon_reg, sfb->regs + WINCONx(win->index)); > + > + return 0; > +} > + > +static int s3c_fb_set_win_alpha(struct s3c_fb_win *win, > + struct s3c_fb_alpha *alpha) > +{ > + struct s3c_fb *sfb = win->parent; > + u32 vidosdc_reg = 0; > + > + if (win->index == 0) { > + dev_err(sfb->dev, "Alpha cannot be set for window %d\n.", > + win->index); Is there a missing return here. This function cannot fail. > + } > + > + vidosdc_reg = alpha->r0 << 20 | alpha->g0 << 16 | alpha->b0 << 12 > + | alpha->r1 << 8 | alpha->g1 << 4 | alpha->b1; > + writel(vidosdc_reg, sfb->regs + VIDOSD_C(win->index)); > + > + return 0; > +} > + > static int s3c_fb_ioctl(struct fb_info *info, unsigned int cmd, > unsigned long arg) > { > @@ -1039,6 +1100,20 @@ static int s3c_fb_ioctl(struct fb_info *info, unsigned int cmd, > > case S3CFB_IOCTL_SET_SOURCE: > return s3c_fb_set_source(win, arg); > + > + case S3CFB_IOCTL_SET_ALPHA_MODE: > + return s3c_fb_set_alpha_mode(win, arg); > + > + case S3CFB_IOCTL_SET_WINDOW_ALPHA: { > + struct s3c_fb_alpha alpha_arg; > + ret = copy_from_user(&alpha_arg, (void __user *)arg, > + sizeof(struct s3c_fb_alpha)); > + if (ret) > + return ret; > + > + return s3c_fb_set_win_alpha(win, &alpha_arg); > + } > + > default: > return -ENOTTY; > } > -- > 1.6.4.2.253.g0b1fac > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Linux-fbdev-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel --------------------------------------------------------------- Zapytaj wró¿kê! Kliknij >>> http://link.interia.pl/f238d |
From: Krzysztof H. <krz...@po...> - 2009-10-03 05:09:05
|
On Fri, 11 Sep 2009 20:04:48 +0200 Pawel Osciak <p.o...@sa...> wrote: > Reviewed-by: Marek Szyprowski <m.s...@sa...> > Reviewed-by: Kyungmin Park <kyu...@sa...> > Signed-off-by: Pawel Osciak <p.o...@sa...> > > > --- > arch/arm/plat-s3c/include/plat/regs-fb.h | 3 + > arch/arm/plat-s3c/include/plat/s3c-fb.h | 45 ++++++++ > drivers/video/s3c-fb.c | 164 ++++++++++++++++++++++++++++++ > 3 files changed, 212 insertions(+), 0 deletions(-) > create mode 100644 arch/arm/plat-s3c/include/plat/s3c-fb.h > > diff --git a/arch/arm/plat-s3c/include/plat/regs-fb.h b/arch/arm/plat-s3c/include/plat/regs-fb.h > index 8048cae..8d3071d 100644 > --- a/arch/arm/plat-s3c/include/plat/regs-fb.h > +++ b/arch/arm/plat-s3c/include/plat/regs-fb.h > @@ -323,6 +323,7 @@ > > /* Window colour-key control registers */ > > +#define WxKEYCON0(_x) (0x140 + ((_x-1) * 8)) > #define WxKEYCON0_KEYBL_EN (1 << 26) > #define WxKEYCON0_KEYEN_F (1 << 25) > #define WxKEYCON0_DIRCON (1 << 24) > @@ -330,6 +331,8 @@ > #define WxKEYCON0_COMPKEY_SHIFT (0) > #define WxKEYCON0_COMPKEY_LIMIT (0xffffff) > #define WxKEYCON0_COMPKEY(_x) ((_x) << 0) > + > +#define WxKEYCON1(_x) (0x144 + ((_x-1) * 8)) > #define WxKEYCON1_COLVAL_MASK (0xffffff << 0) > #define WxKEYCON1_COLVAL_SHIFT (0) > #define WxKEYCON1_COLVAL_LIMIT (0xffffff) > diff --git a/arch/arm/plat-s3c/include/plat/s3c-fb.h b/arch/arm/plat-s3c/include/plat/s3c-fb.h > new file mode 100644 > index 0000000..0aebc40 > --- /dev/null > +++ b/arch/arm/plat-s3c/include/plat/s3c-fb.h > @@ -0,0 +1,45 @@ > +/* > + * include/linux/s3c/s3c-fb.h > + * > + * Copyright 2009 Samsung Electronics Co., Ltd. > + * Author: Pawel Osciak <p.o...@sa...> > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + */ > + > +#ifndef __LINUX_S3C_FB_H__ > +#define __LINUX_S3C_FB_H__ > + > +#include <linux/types.h> > + > +struct s3c_fb_color { > + __u32 a : 8; > + __u32 r : 8; > + __u32 g : 8; > + __u32 b : 8; > +} __attribute__((__packed__)); > + > +typedef enum s3c_fb_color_key_mode { > + S3CFB_COLORKEY_MODE_BG = 0, > + S3CFB_COLORKEY_MODE_FG = 1 > +} s3c_fb_color_key_mode_t; > + Typedef here is also not needed (is it used at all?). Regards, Krzysztof ---------------------------------------------------------------------- Nie dla nich ciepla praca za biurkiem. Sprawdz >>> http://link.interia.pl/f2383 |
From: Krzysztof H. <krz...@po...> - 2009-10-03 05:07:24
|
On Fri, 11 Sep 2009 20:04:52 +0200 Pawel Osciak <p.o...@sa...> wrote: > It is now possible to switch between local bus and DMA as the source > for a window. Local source mode can handle RGB and YCbCr formats. > > Reviewed-by: Marek Szyprowski <m.s...@sa...> > Reviewed-by: Kyungmin Park <kyu...@sa...> > Signed-off-by: Pawel Osciak <p.o...@sa...> > > --- > arch/arm/plat-s3c/include/plat/regs-fb.h | 1 + > arch/arm/plat-s3c/include/plat/s3c-fb.h | 9 ++++++ > drivers/video/s3c-fb.c | 40 ++++++++++++++++++++++++++++++ > 3 files changed, 50 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/plat-s3c/include/plat/regs-fb.h b/arch/arm/plat-s3c/include/plat/regs-fb.h > index 8d3071d..4c024ca 100644 > --- a/arch/arm/plat-s3c/include/plat/regs-fb.h > +++ b/arch/arm/plat-s3c/include/plat/regs-fb.h > @@ -170,6 +170,7 @@ > /* WINCONx */ > > > +#define WINCONx(_x) (0x20 + ((_x) * 4)) > #define WINCONx_BITSWP (1 << 18) > #define WINCONx_BYTSWP (1 << 17) > #define WINCONx_HAWSWP (1 << 16) > diff --git a/arch/arm/plat-s3c/include/plat/s3c-fb.h b/arch/arm/plat-s3c/include/plat/s3c-fb.h > index 0aebc40..b08f9ad 100644 > --- a/arch/arm/plat-s3c/include/plat/s3c-fb.h > +++ b/arch/arm/plat-s3c/include/plat/s3c-fb.h > @@ -26,6 +26,12 @@ typedef enum s3c_fb_color_key_mode { > S3CFB_COLORKEY_MODE_FG = 1 > } s3c_fb_color_key_mode_t; > > +typedef enum s3c_fb_source { > + S3CFB_SOURCE_DMA = 0, > + S3CFB_SOURCE_LOCAL_RGB = 1, > + S3CFB_SOURCE_LOCAL_YCbCr = 2 > +} s3c_fb_source_t; > + There is no need to use typedef here (see Documentation/CodingStyle). It is used in one place only, anyway. > #ifndef FBIO_WAITFORVSYNC > #define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) > #endif > @@ -41,5 +47,8 @@ typedef enum s3c_fb_color_key_mode { > /* param: 1 - on, 0 - off */ > #define S3CFB_IOCTL_COLOR_KEY_ENABLE _IO(S3CFB_IOCTL_MAGIC, 3) > > + > +/* Param: s3c_fb_source */ > +#define S3CFB_IOCTL_SET_SOURCE _IO(S3CFB_IOCTL_MAGIC, 5) > #endif /* __LINUX_S3C_FB_H__ */ > > diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c > index 2de3151..28622c0 100644 > --- a/drivers/video/s3c-fb.c > +++ b/drivers/video/s3c-fb.c > @@ -960,6 +960,43 @@ static int s3c_fb_set_color_key_mode(struct s3c_fb_win *win, > return 0; > } > > +static int s3c_fb_set_source(struct s3c_fb_win *win, s3c_fb_source_t source) > +{ > + struct s3c_fb *sfb = win->parent; > + int wincon_reg, new_val; > + > + if (win->index > 2) { > + dev_err(sfb->dev, "Source change not supported for window %d\n", > + win->index); > + return -EINVAL; > + } > + > + wincon_reg = readl(sfb->regs + WINCONx(win->index)); > + new_val = wincon_reg; > + > + switch (source) { > + case S3CFB_SOURCE_DMA: > + new_val &= ~(WINCONx_ENLOCAL | WINCONx_YCbCr); > + break; > + case S3CFB_SOURCE_LOCAL_RGB: > + new_val &= ~WINCONx_YCbCr; > + new_val |= WINCONx_ENLOCAL; > + break; > + case S3CFB_SOURCE_LOCAL_YCbCr: > + new_val |= WINCONx_YCbCr | WINCONx_ENLOCAL; > + break; > + default: > + return -EINVAL; > + } > + > + /* The window has to be disabled during source switch */ > + writel(wincon_reg & ~WINCONx_ENWIN, sfb->regs + WINCONx(win->index)); > + new_val |= WINCONx_ENWIN; > + writel(new_val, sfb->regs + WINCONx(win->index)); > + > + return 0; > +} > + > static int s3c_fb_ioctl(struct fb_info *info, unsigned int cmd, > unsigned long arg) > { > @@ -999,6 +1036,9 @@ static int s3c_fb_ioctl(struct fb_info *info, unsigned int cmd, > case S3CFB_IOCTL_COLOR_KEY_ENABLE: > return s3c_fb_color_key_enable(win, arg); > > + > + case S3CFB_IOCTL_SET_SOURCE: > + return s3c_fb_set_source(win, arg); > default: > return -ENOTTY; > } > -- > 1.6.4.2.253.g0b1fac > > > _______________________________________________ > linux-arm-kernel mailing list > lin...@li... > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ---------------------------------------------------------------------- Nie boisz sie wampirow! A wiêc Graj >>> http://link.interia.pl/f2390 |
From: Krzysztof H. <krz...@po...> - 2009-10-03 05:02:21
|
On Fri, 11 Sep 2009 20:04:48 +0200 Pawel Osciak <p.o...@sa...> wrote: > Reviewed-by: Marek Szyprowski <m.s...@sa...> > Reviewed-by: Kyungmin Park <kyu...@sa...> > Signed-off-by: Pawel Osciak <p.o...@sa...> > > > --- > arch/arm/plat-s3c/include/plat/regs-fb.h | 3 + > arch/arm/plat-s3c/include/plat/s3c-fb.h | 45 ++++++++ > drivers/video/s3c-fb.c | 164 ++++++++++++++++++++++++++++++ > 3 files changed, 212 insertions(+), 0 deletions(-) > create mode 100644 arch/arm/plat-s3c/include/plat/s3c-fb.h > > diff --git a/arch/arm/plat-s3c/include/plat/regs-fb.h b/arch/arm/plat-s3c/include/plat/regs-fb.h > index 8048cae..8d3071d 100644 > --- a/arch/arm/plat-s3c/include/plat/regs-fb.h > +++ b/arch/arm/plat-s3c/include/plat/regs-fb.h > @@ -323,6 +323,7 @@ > > /* Window colour-key control registers */ > > +#define WxKEYCON0(_x) (0x140 + ((_x-1) * 8)) > #define WxKEYCON0_KEYBL_EN (1 << 26) > #define WxKEYCON0_KEYEN_F (1 << 25) > #define WxKEYCON0_DIRCON (1 << 24) > @@ -330,6 +331,8 @@ > #define WxKEYCON0_COMPKEY_SHIFT (0) > #define WxKEYCON0_COMPKEY_LIMIT (0xffffff) > #define WxKEYCON0_COMPKEY(_x) ((_x) << 0) > + > +#define WxKEYCON1(_x) (0x144 + ((_x-1) * 8)) > #define WxKEYCON1_COLVAL_MASK (0xffffff << 0) > #define WxKEYCON1_COLVAL_SHIFT (0) > #define WxKEYCON1_COLVAL_LIMIT (0xffffff) > diff --git a/arch/arm/plat-s3c/include/plat/s3c-fb.h b/arch/arm/plat-s3c/include/plat/s3c-fb.h > new file mode 100644 > index 0000000..0aebc40 > --- /dev/null > +++ b/arch/arm/plat-s3c/include/plat/s3c-fb.h > @@ -0,0 +1,45 @@ > +/* > + * include/linux/s3c/s3c-fb.h > + * > + * Copyright 2009 Samsung Electronics Co., Ltd. > + * Author: Pawel Osciak <p.o...@sa...> > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + */ > + > +#ifndef __LINUX_S3C_FB_H__ > +#define __LINUX_S3C_FB_H__ > + > +#include <linux/types.h> > + > +struct s3c_fb_color { > + __u32 a : 8; > + __u32 r : 8; > + __u32 g : 8; > + __u32 b : 8; > +} __attribute__((__packed__)); > + > +typedef enum s3c_fb_color_key_mode { > + S3CFB_COLORKEY_MODE_BG = 0, > + S3CFB_COLORKEY_MODE_FG = 1 > +} s3c_fb_color_key_mode_t; > + > +#ifndef FBIO_WAITFORVSYNC > +#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) > +#endif > + > +#define S3CFB_IOCTL_MAGIC 'k' > + > +#define S3CFB_IOCTL_SET_COLOR_KEY _IOW(S3CFB_IOCTL_MAGIC, 0,\ > + struct s3c_fb_color) > +#define S3CFB_IOCTL_SET_COLOR_KEY_MASK _IOW(S3CFB_IOCTL_MAGIC, 1,\ > + struct s3c_fb_color) > +/* param: s3c_fb_color_key_mode */ > +#define S3CFB_IOCTL_SET_COLOR_KEY_MODE _IO(S3CFB_IOCTL_MAGIC, 2) > +/* param: 1 - on, 0 - off */ > +#define S3CFB_IOCTL_COLOR_KEY_ENABLE _IO(S3CFB_IOCTL_MAGIC, 3) > + > +#endif /* __LINUX_S3C_FB_H__ */ > + > diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c > index 001a1a1..2de3151 100644 > --- a/drivers/video/s3c-fb.c > +++ b/drivers/video/s3c-fb.c > @@ -24,6 +24,8 @@ > #include <linux/uaccess.h> > #include <linux/interrupt.h> > > +#include <plat/s3c-fb.h> > + > #include <mach/map.h> > #include <mach/regs-fb.h> > #include <plat/fb.h> > @@ -43,6 +45,7 @@ > * is being built for. > */ > > +/*#define CONFIG_FB_S3C_DEBUG_REGWRITE*/ > #ifdef CONFIG_FB_S3C_DEBUG_REGWRITE > #undef writel > #define writel(v, r) do { \ > @@ -821,11 +824,148 @@ static int s3c_fb_pan_display(struct fb_var_screeninfo *var, > return 0; > } > > +static inline int s3c_fb_color_to_rgb565(struct s3c_fb_color *color) > +{ > + return (((color->r & 0x1f) << 19) | 0x70000) > + | (((color->g & 0x3f) << 10) | 0x300) > + | (((color->b & 0x1f) << 3) | 0x7); > +} Does it work for color key values which are 0? If the color key is black (#000000) the key value is 0x70307. I don't know the datasheet of the controller so it is just a something to check. > + > +static inline int s3c_fb_color_to_rgb888(struct s3c_fb_color *color) > +{ > + return (color->r << 16) | (color->g << 8) | color->b; > +} > + > +static inline int has_colorkey(int win_no) > +{ > + if (win_no == 0) > + return 0; > + else > + return 1; > +} > + > +static int s3c_fb_set_color_key(struct s3c_fb_win *win, > + struct s3c_fb_color *color_key) > +{ > + struct s3c_fb *sfb = win->parent; > + void __iomem *regs = sfb->regs; > + int color = 0; > + > + if (! has_colorkey(win->index)) { > + dev_err(sfb->dev, "Window %d does not support color keying\n", > + win->index); > + return -EINVAL; > + } > + > + dev_info(sfb->dev, "Window %d, BPP: %d\n", win->index, > + win->fbinfo->var.bits_per_pixel); > + > + if (win->fbinfo->var.bits_per_pixel == 16) { > + color = s3c_fb_color_to_rgb565(color_key); > + } else if (win->fbinfo->var.bits_per_pixel >= 24) { > + /*|| win->fbinfo->var.bits_per_pixel == 28) {*/ Please remove this commented line. Best regards, Krzysztof --------------------------------------------------------------- Zapytaj wró¿kê! Kliknij >>> http://link.interia.pl/f238d |