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
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.
Signed-off-by: Pawel Osciak <redacted>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/s3c-fb.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
S5PC100 and S5PV210 framebuffer devices differ slightly in terms of
available registers and their driver data structures have to be separate.
Signed-off-by: Pawel Osciak <redacted>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/s3c-fb.c | 37 ++++++++++++++++++++++++++++++++++---
1 files changed, 34 insertions(+), 3 deletions(-)
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.
Signed-off-by: Pawel Osciak <redacted>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/plat-samsung/include/plat/regs-fb.h | 5 ++
drivers/video/s3c-fb.c | 71 ++++++++++++++++++++++++++
2 files changed, 76 insertions(+), 0 deletions(-)
@@ -379,6 +382,9 @@ static int s3c_fb_set_par(struct fb_info *info)info->fix.line_length=(var->xres_virtual*var->bits_per_pixel)/8;+info->fix.xpanstep=info->var.xres_virtual>info->var.xres?1:0;+info->fix.ypanstep=info->var.yres_virtual>info->var.yres?1:0;+/* disable the window whilst we update it */writel(0,regs+WINCON(win_no));
@@ -735,6 +741,66 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)return0;}+/**+*s3c_fb_pan_display()-Panthedisplay.+*+*Notethattheoffsetscanbewrittentothedeviceatanytime,astheir+*valuesarelatchedateachvsyncautomatically.Thisalsomeansthatonly+*thelastcalltothisfunctionwillhaveanyeffectonnextvsync,but+*thereisnoneedtosleepwaitingforittopreventtearing.+*+*@var:Thescreeninformationtoverify.+*@info:Theframebufferdevice.+*/+staticints3c_fb_pan_display(structfb_var_screeninfo*var,+structfb_info*info)+{+structs3c_fb_win*win=info->par;+structs3c_fb*sfb=win->parent;+void__iomem*buf=sfb->regs+win->index*8;+unsignedintstart_byte_offset,end_byte_offset;++/* Offset in bytes to the start of the displayed area */+start_byte_offset=var->yoffset*info->fix.line_length;+/* X offset depends on the current bpp */+if(info->var.bits_per_pixel>=8){+start_byte_offset++var->xoffset*(info->var.bits_per_pixel>>3);+}else{+switch(info->var.bits_per_pixel){+case4:+start_byte_offset+=var->xoffset>>1;+break;+case2:+start_byte_offset+=var->xoffset>>2;+break;+case1:+start_byte_offset+=var->xoffset>>3;+break;+default:+dev_err(sfb->dev,"invalid bpp\n");+return-EINVAL;+}+}+/* Offset in bytes to the end of the displayed area */+end_byte_offset=start_byte_offset+var->yres*info->fix.line_length;++/* Temporarily turn off per-vsync update from shadow registers until+*bothstartandendaddressesareupdatedtopreventcorruption*/+if(sfb->variant.has_prtcon)+writel(PRTCON_PROTECT,sfb->regs+PRTCON);++writel(info->fix.smem_start+start_byte_offset,+buf+sfb->variant.buf_start);+writel(info->fix.smem_start+end_byte_offset,+buf+sfb->variant.buf_end);++if(sfb->variant.has_prtcon)+writel(0,sfb->regs+PRTCON);++return0;+}+staticstructfb_opss3c_fb_ops={.owner=THIS_MODULE,.fb_check_var=s3c_fb_check_var,
Add VSYNC interrupt support and an ioctl that allows waiting for it.
Interrupts are turned on only when needed.
Signed-off-by: Pawel Osciak <redacted>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/plat-samsung/include/plat/regs-fb.h | 1 +
drivers/video/s3c-fb.c | 171 +++++++++++++++++++++++++-
2 files changed, 171 insertions(+), 1 deletions(-)
@@ -801,6 +829,124 @@ static int s3c_fb_pan_display(struct fb_var_screeninfo *var,return0;}+/**+*s3c_fb_enable_irq()-enableframebufferinterrupts+*@sfb:mainhardwarestate+*/+staticvoids3c_fb_enable_irq(structs3c_fb*sfb)+{+void__iomem*regs=sfb->regs;+u32irq_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()-disableframebufferinterrupts+*@sfb:mainhardwarestate+*/+staticvoids3c_fb_disable_irq(structs3c_fb*sfb)+{+void__iomem*regs=sfb->regs;+u32irq_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);+}+}++staticirqreturn_ts3c_fb_irq(intirq,void*dev_id)+{+structs3c_fb*sfb=dev_id;+void__iomem*regs=sfb->regs;+u32irq_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+*toalwaysdisableirqshere.+*/+s3c_fb_disable_irq(sfb);++returnIRQ_HANDLED;+}++/**+*s3c_fb_wait_for_vsync()-sleepuntilnextVSYNCinterruptortimeout+*@sfb:mainhardwarestate+*@crtc:headindex.+*/+staticints3c_fb_wait_for_vsync(structs3c_fb*sfb,u32crtc)+{+unsignedlongcount;+intret;++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;++return0;+}++staticints3c_fb_ioctl(structfb_info*info,unsignedintcmd,+unsignedlongarg)+{+structs3c_fb_win*win=info->par;+structs3c_fb*sfb=win->parent;+intret;+u32crtc;++switch(cmd){+caseFBIO_WAITFORVSYNC:+if(get_user(crtc,(u32__user*)arg)){+ret=-EFAULT;+break;+}++ret=s3c_fb_wait_for_vsync(sfb,crtc);+break;+default:+ret=-ENOTTY;+}++returnret;+}+staticstructfb_opss3c_fb_ops={.owner=THIS_MODULE,.fb_check_var=s3c_fb_check_var,
On Mon, May 31, 2010 at 11:08:55AM +0200, Pawel Osciak wrote:
quoted hunk
Add VSYNC interrupt support and an ioctl that allows waiting for it.
Interrupts are turned on only when needed.
Signed-off-by: Pawel Osciak <redacted>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/plat-samsung/include/plat/regs-fb.h | 1 +
drivers/video/s3c-fb.c | 171 +++++++++++++++++++++++++-
2 files changed, 171 insertions(+), 1 deletions(-)
@@ -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;
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
Ben Dooks [off-list ref] wrote:
On Mon, May 31, 2010 at 11:08:51AM +0200, Pawel Osciak wrote:
quoted
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
On Mon, May 31, 2010 at 11:08:49AM +0200, Pawel Osciak wrote:
Hello,
This series is rebased onto Ben Dook's framebuffer branch available at:
git://git.fluff.org/bjdooks/linux.git dev/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.
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
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
Hello,
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
--
Marek Szyprowski
Samsung Poland R&D Center
From: Pawel Osciak <redacted>
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.
Signed-off-by: Pawel Osciak <redacted>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
drivers/video/s3c-fb.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
From: Pawel Osciak <redacted>
S5PC100 and S5PV210 framebuffer devices differ slightly in terms of
available registers and their driver data structures have to be separate.
Signed-off-by: Pawel Osciak <redacted>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
drivers/video/s3c-fb.c | 37 ++++++++++++++++++++++++++++++++++---
1 files changed, 34 insertions(+), 3 deletions(-)
From: Pawel Osciak <redacted>
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.
Signed-off-by: Pawel Osciak <redacted>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
arch/arm/plat-samsung/include/plat/regs-fb.h | 5 ++
drivers/video/s3c-fb.c | 71 ++++++++++++++++++++++++++
2 files changed, 76 insertions(+), 0 deletions(-)
@@ -379,6 +382,9 @@ static int s3c_fb_set_par(struct fb_info *info)info->fix.line_length=(var->xres_virtual*var->bits_per_pixel)/8;+info->fix.xpanstep=info->var.xres_virtual>info->var.xres?1:0;+info->fix.ypanstep=info->var.yres_virtual>info->var.yres?1:0;+/* disable the window whilst we update it */writel(0,regs+WINCON(win_no));
@@ -735,6 +741,66 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)return0;}+/**+*s3c_fb_pan_display()-Panthedisplay.+*+*Notethattheoffsetscanbewrittentothedeviceatanytime,astheir+*valuesarelatchedateachvsyncautomatically.Thisalsomeansthatonly+*thelastcalltothisfunctionwillhaveanyeffectonnextvsync,but+*thereisnoneedtosleepwaitingforittopreventtearing.+*+*@var:Thescreeninformationtoverify.+*@info:Theframebufferdevice.+*/+staticints3c_fb_pan_display(structfb_var_screeninfo*var,+structfb_info*info)+{+structs3c_fb_win*win=info->par;+structs3c_fb*sfb=win->parent;+void__iomem*buf=sfb->regs+win->index*8;+unsignedintstart_byte_offset,end_byte_offset;++/* Offset in bytes to the start of the displayed area */+start_byte_offset=var->yoffset*info->fix.line_length;+/* X offset depends on the current bpp */+if(info->var.bits_per_pixel>=8){+start_byte_offset++var->xoffset*(info->var.bits_per_pixel>>3);+}else{+switch(info->var.bits_per_pixel){+case4:+start_byte_offset+=var->xoffset>>1;+break;+case2:+start_byte_offset+=var->xoffset>>2;+break;+case1:+start_byte_offset+=var->xoffset>>3;+break;+default:+dev_err(sfb->dev,"invalid bpp\n");+return-EINVAL;+}+}+/* Offset in bytes to the end of the displayed area */+end_byte_offset=start_byte_offset+var->yres*info->fix.line_length;++/* Temporarily turn off per-vsync update from shadow registers until+*bothstartandendaddressesareupdatedtopreventcorruption*/+if(sfb->variant.has_prtcon)+writel(PRTCON_PROTECT,sfb->regs+PRTCON);++writel(info->fix.smem_start+start_byte_offset,+buf+sfb->variant.buf_start);+writel(info->fix.smem_start+end_byte_offset,+buf+sfb->variant.buf_end);++if(sfb->variant.has_prtcon)+writel(0,sfb->regs+PRTCON);++return0;+}+staticstructfb_opss3c_fb_ops={.owner=THIS_MODULE,.fb_check_var=s3c_fb_check_var,
From: Pawel Osciak <redacted>
Add VSYNC interrupt support and an ioctl that allows waiting for it.
Interrupts are turned on only when needed.
Signed-off-by: Pawel Osciak <redacted>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
arch/arm/plat-samsung/include/plat/regs-fb.h | 1 +
drivers/video/s3c-fb.c | 167 +++++++++++++++++++++++++-
2 files changed, 167 insertions(+), 1 deletions(-)
@@ -801,6 +825,124 @@ static int s3c_fb_pan_display(struct fb_var_screeninfo *var,return0;}+/**+*s3c_fb_enable_irq()-enableframebufferinterrupts+*@sfb:mainhardwarestate+*/+staticvoids3c_fb_enable_irq(structs3c_fb*sfb)+{+void__iomem*regs=sfb->regs;+u32irq_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()-disableframebufferinterrupts+*@sfb:mainhardwarestate+*/+staticvoids3c_fb_disable_irq(structs3c_fb*sfb)+{+void__iomem*regs=sfb->regs;+u32irq_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);+}+}++staticirqreturn_ts3c_fb_irq(intirq,void*dev_id)+{+structs3c_fb*sfb=dev_id;+void__iomem*regs=sfb->regs;+u32irq_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+*toalwaysdisableirqshere.+*/+s3c_fb_disable_irq(sfb);++returnIRQ_HANDLED;+}++/**+*s3c_fb_wait_for_vsync()-sleepuntilnextVSYNCinterruptortimeout+*@sfb:mainhardwarestate+*@crtc:headindex.+*/+staticints3c_fb_wait_for_vsync(structs3c_fb*sfb,u32crtc)+{+unsignedlongcount;+intret;++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;++return0;+}++staticints3c_fb_ioctl(structfb_info*info,unsignedintcmd,+unsignedlongarg)+{+structs3c_fb_win*win=info->par;+structs3c_fb*sfb=win->parent;+intret;+u32crtc;++switch(cmd){+caseFBIO_WAITFORVSYNC:+if(get_user(crtc,(u32__user*)arg)){+ret=-EFAULT;+break;+}++ret=s3c_fb_wait_for_vsync(sfb,crtc);+break;+default:+ret=-ENOTTY;+}++returnret;+}+staticstructfb_opss3c_fb_ops={.owner=THIS_MODULE,.fb_check_var=s3c_fb_check_var,
@@ -365,6 +371,36 @@ static int s3c_fb_align_word(unsigned int bpp, unsigned int pix)}/**+*vidosd_set_size()-setOSDsizeforawindow+*+*@win:thewindowtosetOSDsizefor+*@size:OSDsizeregistervalue+*/+staticvoidvidosd_set_size(structs3c_fb_win*win,u32size)+{+structs3c_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()-setalphatransparencyforawindow+*+*@win:thewindowtosetOSDsizefor+*@alpha:alpharegistervalue+*/+staticvoidvidosd_set_alpha(structs3c_fb_win*win,u32alpha)+{+structs3c_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()-framebufferrequesttosetnewframebufferstate.*@info:Theframebuffertochange.*
@@ -378,7 +414,7 @@ static int s3c_fb_set_par(struct fb_info *info)void__iomem*regs=sfb->regs;void__iomem*buf=regs;intwin_no=win->index;-u32osdc_data=0;+u32alpha=0;u32data;u32pagewidth;intclkdiv;
@@ -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)staticstructs3c_fb_win_variants3c_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)|