Various s3c-fb updates
Subsystems (4)
cover Various s3c-fb updates
Hello,
This series is rebased onto Ben Dook's framebuffer branch available at:git://git.fluff.org/bjdooks/linux.git dev/s3c-fb
The main changes are the addition of an ability to wait for VSYNC and display panning.
The first patch attempts to fix some NULL pointer dereferences in case of a failed framebuffer memory allocation attempt. This is a quick fix, so please treat it more as an indication of what may be wrong with the code in the probe function and not as something to merge.
Patches 3-4 add "new style" device name initialization for various S3C/S5P devices. The 4th patch also separates S5PC100 and S5PV210 as their framebuffer registers sets differ.
[PATCH 1/6] s3c-fb: Fix various null references on framebuffer memory alloc failure [PATCH 2/6] s3c-fb: Correct FRAMESEL1 bitfield defines for VIDINTCON0 register [PATCH 3/6] s3c-fb: Add device name initialization.
[PATCH 4/6] s3c-fb: Separate S5PC100 and S5PV210 framebuffer driver data structures [PATCH 5/6] s3c-fb: Add support for display panning
[PATCH 6/6] s3c-fb: Add wait for VSYNC ioctl
Best regards
--
Pawel Osciak
Linux Platform Group
Samsung Poland R&D Center
PATCH 1/6 s3c-fb: Fix various null references on framebuffer memory alloc failure
The following problems were found in the above situation:
sfb->windows[win] was being assigned at the end of s3c_fb_probe_win only. This resulted in passing a NULL to s3c_fb_release_win if probe_win returned early and a memory leak.
dma_free_writecombine does not allow its third argument to be NULL.
fb_dealloc_cmap does not verify whether its argument is not NULL.
--- drivers/video/s3c-fb.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/video/s3c-fb.c +5 -3
@@ -804,7 +804,8 @@ static void s3c_fb_free_memory(struct s3c_fb *sfb, struct s3c_fb_win *win) {struct fb_info *fbi = win->fbinfo; -dma_free_writecombine (sfb->dev,PAGE_ALIGN (fbi->fix.smem_len), +if (fbi->screen_base) +dma_free_writecombine (sfb->dev,PAGE_ALIGN (fbi->fix.smem_len), fbi->screen_base, fbi->fix.smem_start); }
@@ -819,7 +820,8 @@ static void s3c_fb_release_win(struct s3c_fb *sfb, struct s3c_fb_win *win) {if (win->fbinfo) {unregister_framebuffer (win->fbinfo); -fb_dealloc_cmap (&win->fbinfo->cmap); +if (&win->fbinfo->cmap) +fb_dealloc_cmap (&win->fbinfo->cmap);s3c_fb_free_memory (sfb, win);framebuffer_release (win->fbinfo); }
@@ -865,6 +867,7 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,WARN_ON (windata->win_mode.yres ==0 ); win = fbinfo->par; + *res = win; var = &fbinfo->var; win->variant = *variant; win->fbinfo = fbinfo;
@@ -939,7 +942,6 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,return ret; } - *res = win;dev_info (sfb->dev,"window %d: fb %s\n" , win_no, fbinfo->fix.id);return 0 ;
Signature · 1 line
1.7.0.4
PATCH 2/6 s3c-fb: Correct FRAMESEL1 bitfield defines for VIDINTCON0 register
In reply to Pawel OsciakFRAMESEL1 bitfield starts on 13th bit, not on 14th.
--- arch/arm/plat-samsung/include/plat/regs-fb.h | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/plat-samsung/include/plat/regs-fb.h +5 -5
@@ -292,11 +292,11 @@#define VIDINTCON0_FRAMESEL0_ACTIVE (0x2 << 15)#define VIDINTCON0_FRAMESEL0_FRONTPORCH (0x3 << 15) -#define VIDINTCON0_FRAMESEL1 (1 << 14) -#define VIDINTCON0_FRAMESEL1_NONE (0x0 << 14) -#define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 14) -#define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 14) -#define VIDINTCON0_FRAMESEL1_FRONTPORCH (0x3 << 14) +#define VIDINTCON0_FRAMESEL1 (1 << 13) +#define VIDINTCON0_FRAMESEL1_NONE (0x0 << 13) +#define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 13) +#define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 13) +#define VIDINTCON0_FRAMESEL1_FRONTPORCH (0x3 << 13)#define VIDINTCON0_INT_FRAME (1 << 12)#define VIDINTCON0_FIFIOSEL_MASK (0x7f << 5)
Signature · 1 line
1.7.0.4
PATCH 2/6 s3c-fb: Correct FRAMESEL1 bitfield defines for VIDINTCON0 register
Quoted 1 line · Pawel Osciak
FRAMESEL1 bitfield starts on 13th bit, not on 14th.
is this true for all variants that have FRAMESEL1?
Quoted 34 lines
Signed-off-by Pawel Osciak <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- arch/arm/plat-samsung/include/plat/regs-fb.h | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)arch/arm/plat-samsung/include/plat/regs-fb.h +5
-5@@ -292,11 +292,11 @@#define VIDINTCON0_FRAMESEL0_ACTIVE (0x2 << 15)#define VIDINTCON0_FRAMESEL0_FRONTPORCH (0x3 << 15) -#define VIDINTCON0_FRAMESEL1 (1 << 14) -#define VIDINTCON0_FRAMESEL1_NONE (0x0 << 14) -#define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 14) -#define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 14) -#define VIDINTCON0_FRAMESEL1_FRONTPORCH (0x3 << 14) +#define VIDINTCON0_FRAMESEL1 (1 << 13) +#define VIDINTCON0_FRAMESEL1_NONE (0x0 << 13) +#define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 13) +#define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 13) +#define VIDINTCON0_FRAMESEL1_FRONTPORCH (0x3 << 13)#define VIDINTCON0_INT_FRAME (1 << 12)#define VIDINTCON0_FIFIOSEL_MASK (0x7f << 5)Signature · 6 lines
1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 2/6 s3c-fb: Correct FRAMESEL1 bitfield defines for VIDINTCON0 register
Quoted 6 lines
Ben Dooks <[email protected]> wrote:
Quoted 1 line · Pawel Osciak
FRAMESEL1 bitfield starts on 13th bit, not on 14th.
is this true for all variants that have FRAMESEL1?
That's at least the case for all the chips I have docs for:
6400, 6410, S5PC100 and V210...
Best regards
--
Pawel Osciak
Linux Platform Group
Samsung Poland R&D Center
PATCH 3/6 s3c-fb: Add device name initialization.
In reply to Pawel OsciakAdd framebuffer device name initialization calls for S3C2443, S3C64xx and S5P machines.
--- arch/arm/mach-s3c2443/s3c2443.c | 2 + arch/arm/mach-s3c64xx/s3c6400.c | 3 ++ arch/arm/mach-s3c64xx/s3c6410.c | 3 ++ arch/arm/mach-s5pc100/cpu.c | 3 ++ arch/arm/mach-s5pv210/cpu.c | 3 ++ arch/arm/plat-samsung/include/plat/fb-core.h | 29 ++++++++++++++++++++++++++ 6 files changed, 43 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-samsung/include/plat/fb-core.h
arch/arm/mach-s3c2443/s3c2443.c +2 -0
@@ -35,6 +35,7 @@#include <plat/s3c2443.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/fb-core.h> static struct map_desc s3c2443_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),
@@ -62,6 +63,7 @@ int __init s3c2443_init(void) s3c24xx_reset_hook = s3c2443_hard_reset; s3c_device_nand.name ="s3c2412-nand" ; +s3c_fb_setname ("s3c2443-fb" );/* change WDT IRQ number */ s3c_device_wdt.resource[1 ].start =IRQ_S3C2443_WDT ;
arch/arm/mach-s3c64xx/s3c6400.c +3 -0
@@ -38,6 +38,7 @@#include <plat/sdhci.h> #include <plat/iic-core.h> #include <plat/onenand-core.h> +#include <plat/fb-core.h> #include <mach/s3c6400.h> void __init s3c6400_map_io (void )
@@ -55,6 +56,8 @@ void __init s3c6400_map_io(void)s3c_onenand_setname ("s3c6400-onenand" );s3c64xx_onenand1_setname ("s3c6400-onenand" ); + +s3c_fb_setname ("s3c-fb" ); }void __init s3c6400_init_clocks (int xtal)
arch/arm/mach-s3c64xx/s3c6410.c +3 -0
@@ -40,6 +40,7 @@#include <plat/iic-core.h> #include <plat/adc.h> #include <plat/onenand-core.h> +#include <plat/fb-core.h> #include <mach/s3c6400.h> #include <mach/s3c6410.h>
@@ -58,6 +59,8 @@ void __init s3c6410_map_io(void) s3c_device_nand.name ="s3c6400-nand" ;s3c_onenand_setname ("s3c6410-onenand" );s3c64xx_onenand1_setname ("s3c6410-onenand" ); + +s3c_fb_setname ("s3c-fb" ); }void __init s3c6410_init_clocks (int xtal)
arch/arm/mach-s5pc100/cpu.c +3 -0
@@ -41,6 +41,7 @@#include <plat/iic-core.h> #include <plat/sdhci.h> #include <plat/onenand-core.h> +#include <plat/fb-core.h> #include <plat/s5pc100.h>
@@ -92,6 +93,8 @@ void __init s5pc100_map_io(void)s3c_i2c1_setname ("s3c2440-i2c" );s3c_onenand_setname ("s5pc100-onenand" ); + +s3c_fb_setname ("s5pc100-fb" ); }void __init s5pc100_init_clocks (int xtal)
arch/arm/mach-s5pv210/cpu.c +3 -0
@@ -34,6 +34,7 @@#include <plat/s5pv210.h> #include <plat/iic-core.h> #include <plat/sdhci.h> +#include <plat/fb-core.h> /* Initial IO mappings */
@@ -91,6 +92,8 @@ void __init s5pv210_map_io(void)s3c_i2c0_setname ("s3c2440-i2c" );s3c_i2c1_setname ("s3c2440-i2c" );s3c_i2c2_setname ("s3c2440-i2c" ); + +s3c_fb_setname ("s5pv210-fb" ); }void __init s5pv210_init_clocks (int xtal)
arch/arm/plat-samsung/include/plat/fb-core.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* arch/arm/plat-samsung/include/plat/fb-core.h +* +* Copyright 2010 Samsung Electronics Co., Ltd. +* Pawel Osciak <[email protected]> +* +* Samsung framebuffer driver core functions +* +* 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 __ASM_PLAT_FB_CORE_H +#define __ASM_PLAT_FB_CORE_H __FILE__ + +/* +* These functions are only for use with the core support code, such as +* the CPU-specific initialization code. +*/ + +/* Re-define device name depending on support. */ +static inline void s3c_fb_setname (char *name) +{ +#ifdef CONFIG_S3C_DEV_FB + s3c_device_fb.name = name; +#endif +} + +#endif /* __ASM_PLAT_FB_CORE_H */
Signature · 1 line
1.7.0.4
PATCH 4/6 s3c-fb: Separate S5PC100 and S5PV210 framebuffer driver data structures
In reply to Pawel OsciakS5PC100 and S5PV210 framebuffer devices differ slightly in terms of available registers and their driver data structures have to be separate.
--- drivers/video/s3c-fb.c | 37 ++++++++++++++++++++++++++++++++++--- 1 files changed, 34 insertions(+), 3 deletions(-)
drivers/video/s3c-fb.c +34 -3
@@ -1251,7 +1251,35 @@ static struct s3c_fb_driverdata s3c_fb_data_64xx __devinitdata = { .win[4] = &s3c_fb_data_64xx_wins[4], }; -static struct s3c_fb_driverdata s3c_fb_data_s5p__devinitdata = { +static struct s3c_fb_driverdata s3c_fb_data_s5pc100__devinitdata = { + .variant = { + .nr_windows =5 , + .vidtcon =VIDTCON0 , + .wincon =WINCON (0 ), + .winmap =WINxMAP (0 ), + .keycon =WKEYCON , + .osd =VIDOSD_BASE , + .osd_stride =16 , + .buf_start =VIDW_BUF_START (0 ), + .buf_size =VIDW_BUF_SIZE (0 ), + .buf_end =VIDW_BUF_END (0 ), + + .palette = { + [0 ] =0x2400 , + [1 ] =0x2800 , + [2 ] =0x2c00 , + [3 ] =0x3000 , + [4 ] =0x3400 , + }, + }, + .win[0 ] = &s3c_fb_data_64xx_wins[0 ], + .win[1 ] = &s3c_fb_data_64xx_wins[1 ], + .win[2 ] = &s3c_fb_data_64xx_wins[2 ], + .win[3 ] = &s3c_fb_data_64xx_wins[3 ], + .win[4 ] = &s3c_fb_data_64xx_wins[4 ], +}; + +static struct s3c_fb_driverdata s3c_fb_data_s5pv210__devinitdata = { .variant = { .nr_windows =5 , .vidtcon =VIDTCON0 ,
@@ -1319,8 +1347,11 @@ static struct platform_device_id s3c_fb_driver_ids[] = { .name = "s3c-fb", .driver_data = (unsigned long)&s3c_fb_data_64xx, }, { - .name = "s5p-fb", - .driver_data = (unsigned long)&s3c_fb_data_s5p, + .name = "s5pc100-fb", + .driver_data = (unsigned long)&s3c_fb_data_s5pc100, + }, { + .name = "s5pv210-fb", + .driver_data = (unsigned long)&s3c_fb_data_s5pv210, }, { .name = "s3c2443-fb", .driver_data = (unsigned long)&s3c_fb_data_s3c2443,
Signature · 1 line
1.7.0.4
PATCH 5/6 s3c-fb: Add support for display panning
In reply to Pawel OsciakSupports all bpp modes.
The PRTCON register is used to disable in-hardware updates of registers that store start and end addresses of framebuffer memory. This prevents display corruption in case we do not make it before VSYNC with updating them atomically. With this feature there is no need to wait for a VSYNC interrupt before each such update.
--- arch/arm/plat-samsung/include/plat/regs-fb.h | 5 ++ drivers/video/s3c-fb.c | 71 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 0 deletions(-)
arch/arm/plat-samsung/include/plat/regs-fb.h +5 -0
@@ -112,6 +112,11 @@#define VIDCON2_ORGYCbCr (1 << 8)#define VIDCON2_YUVORDCrCb (1 << 7) +/* PRTCON (S3C6410, S5PC100) */ + +#define PRTCON (0x0c) +#define PRTCON_PROTECT (1 << 11) +/* VIDTCON0 */ #define VIDTCON0_VBPDE_MASK (0xff << 24)
drivers/video/s3c-fb.c +71 -0
113 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 6/6 s3c-fb: Add wait for VSYNC ioctl
In reply to Pawel OsciakAdd VSYNC interrupt support and an ioctl that allows waiting for it. Interrupts are turned on only when needed.
--- arch/arm/plat-samsung/include/plat/regs-fb.h | 1 + drivers/video/s3c-fb.c | 171 +++++++++++++++++++++++++- 2 files changed, 171 insertions(+), 1 deletions(-)
arch/arm/plat-samsung/include/plat/regs-fb.h +1 -0
@@ -298,6 +298,7 @@#define VIDINTCON0_FRAMESEL0_FRONTPORCH (0x3 << 15)#define VIDINTCON0_FRAMESEL1 (1 << 13) +#define VIDINTCON0_FRAMESEL1_MASK (0x3 << 13)#define VIDINTCON0_FRAMESEL1_NONE (0x0 << 13)#define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 13)#define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 13)
drivers/video/s3c-fb.c +170 -1
249 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 6/6 s3c-fb: Add wait for VSYNC ioctl
Quoted 37 lines · Pawel Osciak
Add VSYNC interrupt support and an ioctl that allows waiting for it. Interrupts are turned on only when needed.
Signed-off-by Pawel Osciak <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- arch/arm/plat-samsung/include/plat/regs-fb.h | 1 + drivers/video/s3c-fb.c | 171 +++++++++++++++++++++++++- 2 files changed, 171 insertions(+), 1 deletions(-)arch/arm/plat-samsung/include/plat/regs-fb.h +1
-0@@ -298,6 +298,7 @@#define VIDINTCON0_FRAMESEL0_FRONTPORCH (0x3 << 15)#define VIDINTCON0_FRAMESEL1 (1 << 13) +#define VIDINTCON0_FRAMESEL1_MASK (0x3 << 13)#define VIDINTCON0_FRAMESEL1_NONE (0x0 << 13)#define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 13)#define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 13)drivers/video/s3c-fb.c +2
-0@@ -21,6 +21,8 @@#include <linux/clk.h> #include <linux/fb.h> #include <linux/io.h> +#include <linux/uaccess.h> +#include <linux/interrupt.h> #include <mach/map.h> #include <plat/regs-fb-v4.h> @@ -48,6 +50,15 @@__raw_writel (v, r); }while (0 )
drivers/video/s3c-fb.c line 60
Quoted 10 lines
drivers/video/s3c-fb.c +8
-0#endif /* FB_S3C_DEBUG_REGWRITE */ +/* irq_flags bits */ +#define S3C_FB_VSYNC_IRQ_EN 0 + +#ifndef FBIO_WAITFORVSYNC +#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) +#endif + +#define VSYNC_TIMEOUT_MSEC 50
why are you testign for this, surely you need t oget FBIO_WAITFORVSYNC from a header file.
Quoted 243 lines
drivers/video/s3c-fb.c +159
-1struct s3c_fb ;#define VALID_BPP (x) (1 << ((x) - 1))@@ -156,6 +167,16 @@ struct s3c_fb_win { };/** +* struct s3c_fb_vsync - vsync information +* @wait: a queue for processes waiting for vsync +* @count: vsync interrupt count +*/ +struct s3c_fb_vsync { +wait_queue_head_t wait; +unsigned int count; +}; + +/** * struct s3c_fb - overall hardware state of the hardware * @dev: The device that we bound to, for printing, etc. * @regs_res: The resource we claimed for the IO registers. @@ -165,6 +186,9 @@ struct s3c_fb_win {* @enabled: A bitmask of enabled hardware windows. * @pdata: The platform configuration data passed with the device. * @windows: The hardware windows that have been claimed. +* @irq_no: IRQ line number +* @irq_flags: irq flags +* @vsync_info: VSYNC-related information (count, queues...) */ struct s3c_fb {struct device *dev;@@ -177,6 +201,10 @@ struct s3c_fb {struct s3c_fb_platdata *pdata;struct s3c_fb_win *windows[S3C_FB_MAX_WIN ]; + +int irq_no; +unsigned long irq_flags; +struct s3c_fb_vsync vsync_info; };/** @@ -801,6 +829,124 @@ static int s3c_fb_pan_display(struct fb_var_screeninfo *var,return 0 ; } +/** +* s3c_fb_enable_irq() - enable framebuffer interrupts +* @sfb: main hardware state +*/ +static void s3c_fb_enable_irq (struct s3c_fb *sfb) +{ +void __iomem *regs = sfb->regs; +u32 irq_ctrl_reg; + +if (!test_and_set_bit (S3C_FB_VSYNC_IRQ_EN , &sfb->irq_flags)) { +/* IRQ disabled, enable it */ + irq_ctrl_reg =readl (regs +VIDINTCON0 ); + + irq_ctrl_reg |=VIDINTCON0_INT_ENABLE ; + irq_ctrl_reg |=VIDINTCON0_INT_FRAME ; + + irq_ctrl_reg &= ~VIDINTCON0_FRAMESEL0_MASK ; + irq_ctrl_reg |=VIDINTCON0_FRAMESEL0_VSYNC ; + irq_ctrl_reg &= ~VIDINTCON0_FRAMESEL1_MASK ; + irq_ctrl_reg |=VIDINTCON0_FRAMESEL1_NONE ; + +writel (irq_ctrl_reg, regs +VIDINTCON0 ); + } +} + +/** +* s3c_fb_disable_irq() - disable framebuffer interrupts +* @sfb: main hardware state +*/ +static void s3c_fb_disable_irq (struct s3c_fb *sfb) +{ +void __iomem *regs = sfb->regs; +u32 irq_ctrl_reg; + +if (test_and_clear_bit (S3C_FB_VSYNC_IRQ_EN , &sfb->irq_flags)) { +/* IRQ enabled, disable it */ + irq_ctrl_reg =readl (regs +VIDINTCON0 ); + + irq_ctrl_reg &= ~VIDINTCON0_INT_FRAME ; + irq_ctrl_reg &= ~VIDINTCON0_INT_ENABLE ; + +writel (irq_ctrl_reg, regs +VIDINTCON0 ); + } +} + +static irqreturn_t s3c_fb_irq (int irq,void *dev_id) +{ +struct s3c_fb *sfb = dev_id; +void __iomem *regs = sfb->regs; +u32 irq_sts_reg; + + irq_sts_reg =readl (regs +VIDINTCON1 ); + +if (irq_sts_reg &VIDINTCON1_INT_FRAME ) { + +/* VSYNC interrupt, accept it */ +writel (VIDINTCON1_INT_FRAME , regs +VIDINTCON1 ); + + sfb->vsync_info.count++; +wake_up_interruptible (&sfb->vsync_info.wait); + } + +/* We only support waiting for VSYNC for now, so it's safe +* to always disable irqs here. +*/ +s3c_fb_disable_irq (sfb); + +return IRQ_HANDLED ; +} + +/** +* s3c_fb_wait_for_vsync() - sleep until next VSYNC interrupt or timeout +* @sfb: main hardware state +* @crtc: head index. +*/ +static int s3c_fb_wait_for_vsync (struct s3c_fb *sfb,u32 crtc) +{ +unsigned long count; +int ret; + +if (crtc !=0 ) +return -ENODEV ; + +s3c_fb_enable_irq (sfb); + count = sfb->vsync_info.count; + ret =wait_event_interruptible_timeout (sfb->vsync_info.wait, + count != sfb->vsync_info.count, +msecs_to_jiffies (VSYNC_TIMEOUT_MSEC )); +if (ret ==0 ) +return -ETIMEDOUT ; + +return 0 ; +} + +static int s3c_fb_ioctl (struct fb_info *info,unsigned int cmd, +unsigned long arg) +{ +struct s3c_fb_win *win = info->par; +struct s3c_fb *sfb = win->parent; +int ret; +u32 crtc; + +switch (cmd) { +case FBIO_WAITFORVSYNC : +if (get_user (crtc, (u32 __user *)arg)) { + ret = -EFAULT ; +break ; + } + + ret =s3c_fb_wait_for_vsync (sfb, crtc); +break ; +default : + ret = -ENOTTY ; + } + +return ret; +} +static struct fb_ops s3c_fb_ops = { .owner =THIS_MODULE , .fb_check_var = s3c_fb_check_var,@@ -811,6 +957,7 @@ static struct fb_ops s3c_fb_ops = { .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, .fb_pan_display = s3c_fb_pan_display, + .fb_ioctl = s3c_fb_ioctl, };/** @@ -917,6 +1064,8 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,dev_dbg (sfb->dev,"probing window %d, variant %p\n" , win_no, variant); +init_waitqueue_head (&sfb->vsync_info.wait); + palette_size = variant->palette_sz *4 ; fbinfo = framebuffer_alloc(sizeof(struct s3c_fb_win) +@@ -1096,6 +1245,20 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev) goto err_req_region; } + res =platform_get_resource (pdev,IORESOURCE_IRQ ,0 ); +if (!res) { +dev_err (dev,"failed to acquire irq resource\n" ); + ret = -ENOENT ; + goto err_ioremap; + } + sfb->irq_no = res->start; + ret =request_irq (sfb->irq_no, s3c_fb_irq, +0 ,"s3c_fb" , sfb); +if (ret) { +dev_err (dev,"irq request failed\n" ); + goto err_ioremap; + } +dev_dbg (dev,"got resources (regs %p), probing windows\n" , sfb->regs);/* setup gpio and output polarity controls */ @@ -1130,7 +1293,7 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)dev_err (dev,"failed to create window %d\n" , win);for (; win >=0 ; win--)s3c_fb_release_win (sfb, sfb->windows[win]); - goto err_ioremap; + goto err_irq; } }@@ -1138,6 +1301,9 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)return 0 ; +err_irq: +free_irq (sfb->irq_no, sfb); + err_ioremap:iounmap (sfb->regs);@@ -1170,6 +1336,8 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)if (sfb->windows[win])s3c_fb_release_win (sfb, sfb->windows[win]); +free_irq (sfb->irq_no, sfb); +iounmap (sfb->regs);clk_disable (sfb->bus_clk);@@ -1370,6 +1538,7 @@ static struct s3c_fb_driverdata s3c_fb_data_s5pv210 __devinitdata = { [3] = 0x3000, [4] = 0x3400, }, + }, .win[0] = &s3c_fb_data_64xx_wins[0], .win[1] = &s3c_fb_data_64xx_wins[1],Signature · 1 line
1.7.0.4
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
cover Various s3c-fb updates
In reply to Pawel OsciakQuoted 4 lines · Pawel Osciak
Hello,
This series is rebased onto Ben Dook's framebuffer branch available at:
git://git.fluff.org/bjdooks/linux.gitdev/s3c-fb
I'll look at updating this series once I am back in the uk, it mostly looks good but I have yet to do any testing or give it a thorough review.
Quoted 29 lines
The main changes are the addition of an ability to wait for VSYNC and display panning.
The first patch attempts to fix some NULL pointer dereferences in case of a failed framebuffer memory allocation attempt. This is a quick fix, so please treat it more as an indication of what may be wrong with the code in the probe function and not as something to merge.
Patches 3-4 add "new style" device name initialization for various S3C/S5P devices. The 4th patch also separates S5PC100 and S5PV210 as their framebuffer registers sets differ.
[PATCH 1/6] s3c-fb: Fix various null references on framebuffer memory alloc failure [PATCH 2/6] s3c-fb: Correct FRAMESEL1 bitfield defines for VIDINTCON0 register [PATCH 3/6] s3c-fb: Add device name initialization.
[PATCH 4/6] s3c-fb: Separate S5PC100 and S5PV210 framebuffer driver data structures [PATCH 5/6] s3c-fb: Add support for display panning
[PATCH 6/6] s3c-fb: Add wait for VSYNC ioctlBest regards
--
Pawel Osciak
Linux Platform Group
Samsung Poland R&D Center
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH v2 1/1 Various s3c-fb updates
In reply to Pawel OsciakHello,
Im sending a new version of the s3c-fb patch series on behalf of Pawel Osciak.
This series is rebased onto Ben Dook's framebuffer branch available at:git://git.fluff.org/bjdooks/linux.git dev/s3c-fb
The main changes are the addition of an ability to wait for VSYNC and display panning and better support for S5PV210 SoCs. A lot of various bugs has been also fixed.
The first patch attempts to fix some NULL pointer dereferences in case of a failed framebuffer memory allocation attempt. This is a quick fix, so please treat it more as an indication of what may be wrong with the code in the probe function and not as something to merge.
Patches 3-4 add "new style" device name initialization for various S3C/S5P devices. The 4th patch also separates S5PC100 and S5PV210 as their framebuffer registers sets differ.
Patch 7 nd 9 are pure bugfixes.
Patch 8 adds support for the new feature available on S5PV210.
The complete list of patches:
[PATCH 1/9] s3c-fb: Fix various null references on framebuffer memory alloc failure [PATCH 2/9] s3c-fb: Correct FRAMESEL1 bitfield defines for VIDINTCON0 register [PATCH 3/9] s3c-fb: Add device name initialization.
[PATCH 4/9] s3c-fb: Separate S5PC100 and S5PV210 framebuffer driver data structures [PATCH 5/9] s3c-fb: Add support for display panning
[PATCH 6/9] s3c-fb: Add wait for VSYNC ioctl
[PATCH 7/9] s3c-fb: window 3 of 64xx+ does not have an osd_d register [PATCH 8/9] s3c-fb: Add SHADOWCON shadow register locking support for S5PV210 [PATCH 9/9] s3c-fb: Correct window osd size and alpha register handling
Best regards
Signature · 2 lines
Marek Szyprowski Samsung Poland R&D Center
PATCH 1/9 s3c-fb: Fix various null references on framebuffer memory alloc failure
In reply to Pawel OsciakFrom: Pawel Osciak <[email protected]>
The following problems were found in the above situation:
sfb->windows[win] was being assigned at the end of s3c_fb_probe_win only. This resulted in passing a NULL to s3c_fb_release_win if probe_win returned early and a memory leak.
dma_free_writecombine does not allow its third argument to be NULL.
fb_dealloc_cmap does not verify whether its argument is not NULL.
--- drivers/video/s3c-fb.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/video/s3c-fb.c +5 -3
@@ -804,7 +804,8 @@ static void s3c_fb_free_memory(struct s3c_fb *sfb, struct s3c_fb_win *win) {struct fb_info *fbi = win->fbinfo; -dma_free_writecombine (sfb->dev,PAGE_ALIGN (fbi->fix.smem_len), +if (fbi->screen_base) +dma_free_writecombine (sfb->dev,PAGE_ALIGN (fbi->fix.smem_len), fbi->screen_base, fbi->fix.smem_start); }
@@ -819,7 +820,8 @@ static void s3c_fb_release_win(struct s3c_fb *sfb, struct s3c_fb_win *win) {if (win->fbinfo) {unregister_framebuffer (win->fbinfo); -fb_dealloc_cmap (&win->fbinfo->cmap); +if (&win->fbinfo->cmap) +fb_dealloc_cmap (&win->fbinfo->cmap);s3c_fb_free_memory (sfb, win);framebuffer_release (win->fbinfo); }
@@ -865,6 +867,7 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,WARN_ON (windata->win_mode.yres ==0 ); win = fbinfo->par; + *res = win; var = &fbinfo->var; win->variant = *variant; win->fbinfo = fbinfo;
@@ -939,7 +942,6 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,return ret; } - *res = win;dev_info (sfb->dev,"window %d: fb %s\n" , win_no, fbinfo->fix.id);return 0 ;
Signature · 1 line
1.7.1.240.g225c
PATCH 2/9 s3c-fb: Correct FRAMESEL1 bitfield defines for VIDINTCON0 register
In reply to Pawel OsciakFrom: Pawel Osciak <[email protected]>
FRAMESEL1 bitfield starts on 13th bit, not on 14th.
--- arch/arm/plat-samsung/include/plat/regs-fb.h | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/plat-samsung/include/plat/regs-fb.h +5 -5
@@ -292,11 +292,11 @@#define VIDINTCON0_FRAMESEL0_ACTIVE (0x2 << 15)#define VIDINTCON0_FRAMESEL0_FRONTPORCH (0x3 << 15) -#define VIDINTCON0_FRAMESEL1 (1 << 14) -#define VIDINTCON0_FRAMESEL1_NONE (0x0 << 14) -#define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 14) -#define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 14) -#define VIDINTCON0_FRAMESEL1_FRONTPORCH (0x3 << 14) +#define VIDINTCON0_FRAMESEL1 (1 << 13) +#define VIDINTCON0_FRAMESEL1_NONE (0x0 << 13) +#define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 13) +#define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 13) +#define VIDINTCON0_FRAMESEL1_FRONTPORCH (0x3 << 13)#define VIDINTCON0_INT_FRAME (1 << 12)#define VIDINTCON0_FIFIOSEL_MASK (0x7f << 5)
Signature · 1 line
1.7.1.240.g225c
PATCH 3/9 s3c-fb: Add device name initialization.
In reply to Pawel OsciakFrom: Pawel Osciak <[email protected]>
Add framebuffer device name initialization calls for S3C2443, S3C64xx and S5P machines.
--- arch/arm/mach-s3c2443/s3c2443.c | 2 + arch/arm/mach-s3c64xx/s3c6400.c | 3 ++ arch/arm/mach-s3c64xx/s3c6410.c | 3 ++ arch/arm/mach-s5pc100/cpu.c | 3 ++ arch/arm/mach-s5pv210/cpu.c | 3 ++ arch/arm/plat-samsung/include/plat/fb-core.h | 29 ++++++++++++++++++++++++++ 6 files changed, 43 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-samsung/include/plat/fb-core.h
arch/arm/mach-s3c2443/s3c2443.c +2 -0
@@ -35,6 +35,7 @@#include <plat/s3c2443.h> #include <plat/devs.h> #include <plat/cpu.h> +#include <plat/fb-core.h> static struct map_desc s3c2443_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),
@@ -62,6 +63,7 @@ int __init s3c2443_init(void) s3c24xx_reset_hook = s3c2443_hard_reset; s3c_device_nand.name ="s3c2412-nand" ; +s3c_fb_setname ("s3c2443-fb" );/* change WDT IRQ number */ s3c_device_wdt.resource[1 ].start =IRQ_S3C2443_WDT ;
arch/arm/mach-s3c64xx/s3c6400.c +3 -0
@@ -38,6 +38,7 @@#include <plat/sdhci.h> #include <plat/iic-core.h> #include <plat/onenand-core.h> +#include <plat/fb-core.h> #include <mach/s3c6400.h> void __init s3c6400_map_io (void )
@@ -55,6 +56,8 @@ void __init s3c6400_map_io(void)s3c_onenand_setname ("s3c6400-onenand" );s3c64xx_onenand1_setname ("s3c6400-onenand" ); + +s3c_fb_setname ("s3c-fb" ); }void __init s3c6400_init_clocks (int xtal)
arch/arm/mach-s3c64xx/s3c6410.c +3 -0
@@ -40,6 +40,7 @@#include <plat/iic-core.h> #include <plat/adc.h> #include <plat/onenand-core.h> +#include <plat/fb-core.h> #include <mach/s3c6400.h> #include <mach/s3c6410.h>
@@ -58,6 +59,8 @@ void __init s3c6410_map_io(void) s3c_device_nand.name ="s3c6400-nand" ;s3c_onenand_setname ("s3c6410-onenand" );s3c64xx_onenand1_setname ("s3c6410-onenand" ); + +s3c_fb_setname ("s3c-fb" ); }void __init s3c6410_init_clocks (int xtal)
arch/arm/mach-s5pc100/cpu.c +3 -0
@@ -41,6 +41,7 @@#include <plat/iic-core.h> #include <plat/sdhci.h> #include <plat/onenand-core.h> +#include <plat/fb-core.h> #include <plat/s5pc100.h>
@@ -92,6 +93,8 @@ void __init s5pc100_map_io(void)s3c_i2c1_setname ("s3c2440-i2c" );s3c_onenand_setname ("s5pc100-onenand" ); + +s3c_fb_setname ("s5pc100-fb" ); }void __init s5pc100_init_clocks (int xtal)
arch/arm/mach-s5pv210/cpu.c +3 -0
@@ -34,6 +34,7 @@#include <plat/s5pv210.h> #include <plat/iic-core.h> #include <plat/sdhci.h> +#include <plat/fb-core.h> /* Initial IO mappings */
@@ -91,6 +92,8 @@ void __init s5pv210_map_io(void)s3c_i2c0_setname ("s3c2440-i2c" );s3c_i2c1_setname ("s3c2440-i2c" );s3c_i2c2_setname ("s3c2440-i2c" ); + +s3c_fb_setname ("s5pv210-fb" ); }void __init s5pv210_init_clocks (int xtal)
arch/arm/plat-samsung/include/plat/fb-core.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* arch/arm/plat-samsung/include/plat/fb-core.h +* +* Copyright 2010 Samsung Electronics Co., Ltd. +* Pawel Osciak <[email protected]> +* +* Samsung framebuffer driver core functions +* +* 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 __ASM_PLAT_FB_CORE_H +#define __ASM_PLAT_FB_CORE_H __FILE__ + +/* +* These functions are only for use with the core support code, such as +* the CPU-specific initialization code. +*/ + +/* Re-define device name depending on support. */ +static inline void s3c_fb_setname (char *name) +{ +#ifdef CONFIG_S3C_DEV_FB + s3c_device_fb.name = name; +#endif +} + +#endif /* __ASM_PLAT_FB_CORE_H */
Signature · 1 line
1.7.1.240.g225c
PATCH 4/9 s3c-fb: Separate S5PC100 and S5PV210 framebuffer driver data structures
In reply to Pawel OsciakFrom: Pawel Osciak <[email protected]>
S5PC100 and S5PV210 framebuffer devices differ slightly in terms of available registers and their driver data structures have to be separate.
--- drivers/video/s3c-fb.c | 37 ++++++++++++++++++++++++++++++++++--- 1 files changed, 34 insertions(+), 3 deletions(-)
drivers/video/s3c-fb.c +34 -3
@@ -1251,7 +1251,35 @@ static struct s3c_fb_driverdata s3c_fb_data_64xx __devinitdata = { .win[4] = &s3c_fb_data_64xx_wins[4], }; -static struct s3c_fb_driverdata s3c_fb_data_s5p__devinitdata = { +static struct s3c_fb_driverdata s3c_fb_data_s5pc100__devinitdata = { + .variant = { + .nr_windows =5 , + .vidtcon =VIDTCON0 , + .wincon =WINCON (0 ), + .winmap =WINxMAP (0 ), + .keycon =WKEYCON , + .osd =VIDOSD_BASE , + .osd_stride =16 , + .buf_start =VIDW_BUF_START (0 ), + .buf_size =VIDW_BUF_SIZE (0 ), + .buf_end =VIDW_BUF_END (0 ), + + .palette = { + [0 ] =0x2400 , + [1 ] =0x2800 , + [2 ] =0x2c00 , + [3 ] =0x3000 , + [4 ] =0x3400 , + }, + }, + .win[0 ] = &s3c_fb_data_64xx_wins[0 ], + .win[1 ] = &s3c_fb_data_64xx_wins[1 ], + .win[2 ] = &s3c_fb_data_64xx_wins[2 ], + .win[3 ] = &s3c_fb_data_64xx_wins[3 ], + .win[4 ] = &s3c_fb_data_64xx_wins[4 ], +}; + +static struct s3c_fb_driverdata s3c_fb_data_s5pv210__devinitdata = { .variant = { .nr_windows =5 , .vidtcon =VIDTCON0 ,
@@ -1319,8 +1347,11 @@ static struct platform_device_id s3c_fb_driver_ids[] = { .name = "s3c-fb", .driver_data = (unsigned long)&s3c_fb_data_64xx, }, { - .name = "s5p-fb", - .driver_data = (unsigned long)&s3c_fb_data_s5p, + .name = "s5pc100-fb", + .driver_data = (unsigned long)&s3c_fb_data_s5pc100, + }, { + .name = "s5pv210-fb", + .driver_data = (unsigned long)&s3c_fb_data_s5pv210, }, { .name = "s3c2443-fb", .driver_data = (unsigned long)&s3c_fb_data_s3c2443,
Signature · 1 line
1.7.1.240.g225c
PATCH 5/9 s3c-fb: Add support for display panning
In reply to Pawel OsciakFrom: Pawel Osciak <[email protected]>
Supports all bpp modes.
The PRTCON register is used to disable in-hardware updates of registers that store start and end addresses of framebuffer memory. This prevents display corruption in case we do not make it before VSYNC with updating them atomically. With this feature there is no need to wait for a VSYNC interrupt before each such update.
--- arch/arm/plat-samsung/include/plat/regs-fb.h | 5 ++ drivers/video/s3c-fb.c | 71 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 0 deletions(-)
arch/arm/plat-samsung/include/plat/regs-fb.h +5 -0
@@ -112,6 +112,11 @@#define VIDCON2_ORGYCbCr (1 << 8)#define VIDCON2_YUVORDCrCb (1 << 7) +/* PRTCON (S3C6410, S5PC100) */ + +#define PRTCON (0x0c) +#define PRTCON_PROTECT (1 << 11) +/* VIDTCON0 */ #define VIDTCON0_VBPDE_MASK (0xff << 24)
drivers/video/s3c-fb.c +71 -0
113 lines not on this page · raw message
Signature · 1 line
1.7.1.240.g225c
PATCH 6/9 s3c-fb: Add wait for VSYNC ioctl
In reply to Pawel OsciakFrom: Pawel Osciak <[email protected]>
Add VSYNC interrupt support and an ioctl that allows waiting for it. Interrupts are turned on only when needed.
--- arch/arm/plat-samsung/include/plat/regs-fb.h | 1 + drivers/video/s3c-fb.c | 167 +++++++++++++++++++++++++- 2 files changed, 167 insertions(+), 1 deletions(-)
arch/arm/plat-samsung/include/plat/regs-fb.h +1 -0
@@ -298,6 +298,7 @@#define VIDINTCON0_FRAMESEL0_FRONTPORCH (0x3 << 15)#define VIDINTCON0_FRAMESEL1 (1 << 13) +#define VIDINTCON0_FRAMESEL1_MASK (0x3 << 13)#define VIDINTCON0_FRAMESEL1_NONE (0x0 << 13)#define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 13)#define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 13)
drivers/video/s3c-fb.c +166 -1
245 lines not on this page · raw message
Signature · 1 line
1.7.1.240.g225c
PATCH 7/9 s3c-fb: window 3 of 64xx+ does not have an osd_d register
In reply to Pawel OsciakFrom: Pawel Osciak <[email protected]>
Fix incorrectly defined OSD_D register for S3C64xx SoCs.
--- drivers/video/s3c-fb.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/video/s3c-fb.c +0 -1
@@ -1437,7 +1437,6 @@ static struct s3c_fb_win_variant s3c_fb_data_64xx_wins[] __devinitdata = { }, [3 ] = { .has_osd_c =1 , - .has_osd_d =1 , .palette_sz =16 , .palette_16bpp =1 , .valid_bpp = (VALID_BPP124 | VALID_BPP(16) |
Signature · 1 line
1.7.1.240.g225c
PATCH 8/9 s3c-fb: Add SHADOWCON shadow register locking support for S5PV210
In reply to Pawel OsciakFrom: Pawel Osciak <[email protected]>
S5PV210 allows per-window locking of register value updates from shadow registers.
--- arch/arm/plat-samsung/include/plat/regs-fb.h | 3 ++ drivers/video/s3c-fb.c | 46 +++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-)
arch/arm/plat-samsung/include/plat/regs-fb.h +3 -0
@@ -218,6 +218,9 @@#define WINCON1_BPPMODE_25BPP_A1888 (0xd << 2)#define WINCON1_BPPMODE_28BPP_A4888 (0xd << 2) +/* S5PV210 */ +#define SHADOWCON (0x34) +#define SHADOWCON_WINx_PROTECT (_win) (1 << (10 + _win))#define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11)#define VIDOSDxA_TOPLEFT_X_SHIFT (11)
drivers/video/s3c-fb.c +42 -4
82 lines not on this page · raw message
Signature · 1 line
1.7.1.240.g225c
PATCH 9/9 s3c-fb: Correct window osd size and alpha register handling
In reply to Pawel OsciakFrom: Pawel Osciak <[email protected]>
S3C64xx and S5P OSD registers for OSD size and alpha are as follows:
VIDOSDC: win 0 - size, win 1-4: alpha
VIDOSDD: win 1-2 - size; not present for windows 0, 3 and 4
--- drivers/video/s3c-fb.c | 58 ++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 51 insertions(+), 7 deletions(-)
drivers/video/s3c-fb.c +51 -7
@@ -64,6 +64,9 @@ struct s3c_fb;#define VIDOSD_B (win, variant) (OSD_BASE(win, variant) + 0x04)#define VIDOSD_C (win, variant) (OSD_BASE(win, variant) + 0x08)#define VIDOSD_D (win, variant) (OSD_BASE(win, variant) + 0x0C) +#define VIDOSD_SIZE (win, variant, win_variant) \ + (OSD_BASE(win, variant) + (win_variant).osd_size_off) +#define VIDOSD_ALPHA (win, variant, win_variant) VIDOSD_C(win, variant)/** * struct s3c_fb_variant - fb variant information
@@ -112,7 +115,10 @@ struct s3c_fb_variant {struct s3c_fb_win_variant {unsigned int has_osd_c:1 ;unsigned int has_osd_d:1 ; +unsigned int has_osd_size:1 ; +unsigned int has_osd_alpha:1 ;unsigned int palette_16bpp:1 ; +unsigned short osd_size_off;unsigned short palette_sz;u32 valid_bpp; };
@@ -365,6 +371,36 @@ static int s3c_fb_align_word(unsigned int bpp, unsigned int pix) }/** +* vidosd_set_size() - set OSD size for a window +* +* @win: the window to set OSD size for +* @size: OSD size register value +*/ +static void vidosd_set_size (struct s3c_fb_win *win,u32 size) +{ +struct s3c_fb *sfb = win->parent; + +if (win->variant.has_osd_size) +writel (size, sfb->regs +VIDOSD_SIZE (win->index, sfb->variant, + win->variant)); +} + +/** +* vidosd_set_alpha() - set alpha transparency for a window +* +* @win: the window to set OSD size for +* @alpha: alpha register value +*/ +static void vidosd_set_alpha (struct s3c_fb_win *win,u32 alpha) +{ +struct s3c_fb *sfb = win->parent; + +if (win->variant.has_osd_alpha) +writel (alpha, sfb->regs +VIDOSD_ALPHA (win->index, + sfb->variant, win->variant)); +} + +/** * s3c_fb_set_par() - framebuffer request to set new framebuffer state. * @info: The framebuffer to change. *
@@ -378,7 +414,7 @@ static int s3c_fb_set_par(struct fb_info *info)void __iomem *regs = sfb->regs;void __iomem *buf = regs;int win_no = win->index; -u32 osdc_data =0 ; +u32 alpha =0 ;u32 data;u32 pagewidth;int clkdiv;
@@ -481,15 +517,12 @@ static int s3c_fb_set_par(struct fb_info *info) data = var->xres * var->yres; - osdc_data =VIDISD14C_ALPHA1_R (0xf ) | + alpha =VIDISD14C_ALPHA1_R (0xf ) |VIDISD14C_ALPHA1_G (0xf ) |VIDISD14C_ALPHA1_B (0xf ); -if (win->variant.has_osd_d) { -writel (data, regs +VIDOSD_D (win_no, sfb->variant)); -writel (osdc_data, regs +VIDOSD_C (win_no, sfb->variant)); - }else -writel (data, regs +VIDOSD_C (win_no, sfb->variant)); +vidosd_set_alpha (win, alpha); +vidosd_set_size (win, data); data = WINCONx_ENWIN;
@@ -1452,12 +1485,17 @@ static int s3c_fb_resume(struct platform_device *pdev)static struct s3c_fb_win_variant s3c_fb_data_64xx_wins[]__devinitdata = { [0 ] = { .has_osd_c =1 , + .has_osd_size =1 , + .osd_size_off =0x8 , .palette_sz =256 , .valid_bpp =VALID_BPP1248 |VALID_BPP (16 ) |VALID_BPP (24 ), }, [1 ] = { .has_osd_c =1 , .has_osd_d =1 , + .has_osd_size =1 , + .osd_size_off =0x12 , + .has_osd_alpha =1 , .palette_sz =256 , .valid_bpp = (VALID_BPP1248 | VALID_BPP(16) | VALID_BPP(18) | VALID_BPP(19) |
@@ -1466,6 +1504,9 @@ static struct s3c_fb_win_variant s3c_fb_data_64xx_wins[] __devinitdata = { [2 ] = { .has_osd_c =1 , .has_osd_d =1 , + .has_osd_size =1 , + .osd_size_off =0x12 , + .has_osd_alpha =1 , .palette_sz =16 , .palette_16bpp =1 , .valid_bpp = (VALID_BPP1248 | VALID_BPP(16) |
@@ -1474,6 +1515,7 @@ static struct s3c_fb_win_variant s3c_fb_data_64xx_wins[] __devinitdata = { }, [3 ] = { .has_osd_c =1 , + .has_osd_alpha =1 , .palette_sz =16 , .palette_16bpp =1 , .valid_bpp = (VALID_BPP124 | VALID_BPP(16) |
@@ -1482,6 +1524,7 @@ static struct s3c_fb_win_variant s3c_fb_data_64xx_wins[] __devinitdata = { }, [4 ] = { .has_osd_c =1 , + .has_osd_alpha =1 , .palette_sz =4 , .palette_16bpp =1 , .valid_bpp = (VALID_BPP(1) | VALID_BPP(2) |
@@ -1607,6 +1650,7 @@ static struct s3c_fb_driverdata s3c_fb_data_s3c2443 __devinitdata = { }, .win[1] = &(struct s3c_fb_win_variant) { .has_osd_c =1 , + .has_osd_alpha =1 , .palette_sz =256 , .valid_bpp = (VALID_BPP1248 | VALID_BPP(16) | VALID_BPP(18) | VALID_BPP(19) |
Signature · 1 line
1.7.1.240.g225c