Commit Graph

3 Commits (493f139ecf9ee72f73ccbabd016325a145e884ee)

Author SHA1 Message Date
InKi Dae 39000d654c Samsung SoC Framebuffer driver: add Alpha Channel support
Add support for the ARGB1888 and ARGB4888 hardware to the Samsung SoC
Framebuffer driver (s3c-fb.c).

ARGB1888 and ARGB4888 is decided by var->transp.length and this variable
is set by s3c_fb_check_var().

In s3c_fb_check_var(), if var->vits_per_pixel is 25 or 28, then
var->transp.length would be 1 or 3.

Therefore alpha mode(ARGB1888 or ARGB4888) could be decided through that
variable.

For using alpha mode, you need to set the following: This code should be
added to your machine code as platform data.

static struct s3c_fb_pd_win xxx_fb_win0 = {
	/* this is to ensure we use win0 */
	.win_mode = {
		.pixclock		= (8+8+8+240)*(38+4+38+400),
		.left_margin	= 8,
		.right_margin	= 8,
		.upper_margin	= 38,
		.lower_margin	= 38,
		.hsync_len		= 8,
		.vsync_len		= 4,
		.xres			= 240,
		.yres			= 400,
	},
	.max_bpp		= 32,
	.default_bpp	= 24,
};

static struct s3c_fb_pd_win xxx_fb_win1 = {
	.win_mode = {
		.pixclock		= (8+8+8+240)*(38+4+38+400),
		.left_margin	= 8,
		.right_margin	= 8,
		.upper_margin	= 38,
		.lower_margin	= 38,
		.hsync_len		= 8,
		.vsync_len		= 4,
		.xres			= 240,
		.yres			= 400,
	},
	.max_bpp		= 32,
	.default_bpp	= 28,
};

static struct s3c_fb_platdata xxx_lcd_pdata __initdata = {
	.win[0]		= &ncp_fb_win0,
	.win[1]		= &ncp_fb_win1,
	.vidcon0	= VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
	.vidcon1	= VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
	.setup_gpio	= xxx_fb_gpio_setup,
};

s3c_fb_set_platdata(&xxx_lcd_pdata);

The above code sets pixelformat for window0 layer to RGB888 and window1
layer to ARGB4888.

Signed-off-by: InKi Dae <inki.dae@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kyungmin Park <kmpark@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-16 19:47:58 -07:00
Marek Szyprowski 17663e5970 S3C-fb: PM fix
Correctly restore the FrameBuffer register state in the resume function.

Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-05-29 08:40:03 -07:00
Ben Dooks ec549a0fdc fb: add s3c-fb driver for newer Samsung SoC framebuffer devices
Add support for the newer Samsung devices, such as found in the S3C2443,
S3C6400 or S3C6410 series SoC.

It currently does not support all the alpha- or chroma-key options but it
will support more exporting more than one framebuffer ready for adding
overlay and blending functions.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-01 08:59:33 -07:00