aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/s3c-fb.c
diff options
context:
space:
mode:
authorPawel Osciak <p.osciak@samsung.com>2010-08-10 21:02:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 11:59:11 -0400
commitf5ec546f1f5e21bfc84ce7a1ac7408702082c65a (patch)
tree9525ade4ee40c8c4bfc8c408ed643d484b953dfa /drivers/video/s3c-fb.c
parentd4787291fb9ce93f346f307c211af967d29cccad (diff)
s3c-fb: add SHADOWCON shadow register locking support for S5PV210
S5PV210 allows per-window locking of register value updates from shadow registers. Signed-off-by: Pawel Osciak <p.osciak@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: InKi Dae <inki.dae@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/s3c-fb.c')
-rw-r--r--drivers/video/s3c-fb.c40
1 files changed, 36 insertions, 4 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 6cbddc445f03..f76791180dbe 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -79,6 +79,7 @@ struct s3c_fb;
79 * @osd: The base for the OSD registers. 79 * @osd: The base for the OSD registers.
80 * @palette: Address of palette memory, or 0 if none. 80 * @palette: Address of palette memory, or 0 if none.
81 * @has_prtcon: Set if has PRTCON register. 81 * @has_prtcon: Set if has PRTCON register.
82 * @has_shadowcon: Set if has SHADOWCON register.
82 */ 83 */
83struct s3c_fb_variant { 84struct s3c_fb_variant {
84 unsigned int is_2443:1; 85 unsigned int is_2443:1;
@@ -95,6 +96,7 @@ struct s3c_fb_variant {
95 unsigned short palette[S3C_FB_MAX_WIN]; 96 unsigned short palette[S3C_FB_MAX_WIN];
96 97
97 unsigned int has_prtcon:1; 98 unsigned int has_prtcon:1;
99 unsigned int has_shadowcon:1;
98}; 100};
99 101
100/** 102/**
@@ -363,6 +365,36 @@ static int s3c_fb_align_word(unsigned int bpp, unsigned int pix)
363} 365}
364 366
365/** 367/**
368 * shadow_protect_win() - disable updating values from shadow registers at vsync
369 *
370 * @win: window to protect registers for
371 * @protect: 1 to protect (disable updates)
372 */
373static void shadow_protect_win(struct s3c_fb_win *win, bool protect)
374{
375 struct s3c_fb *sfb = win->parent;
376 u32 reg;
377
378 if (protect) {
379 if (sfb->variant.has_prtcon) {
380 writel(PRTCON_PROTECT, sfb->regs + PRTCON);
381 } else if (sfb->variant.has_shadowcon) {
382 reg = readl(sfb->regs + SHADOWCON);
383 writel(reg | SHADOWCON_WINx_PROTECT(win->index),
384 sfb->regs + SHADOWCON);
385 }
386 } else {
387 if (sfb->variant.has_prtcon) {
388 writel(0, sfb->regs + PRTCON);
389 } else if (sfb->variant.has_shadowcon) {
390 reg = readl(sfb->regs + SHADOWCON);
391 writel(reg & ~SHADOWCON_WINx_PROTECT(win->index),
392 sfb->regs + SHADOWCON);
393 }
394 }
395}
396
397/**
366 * s3c_fb_set_par() - framebuffer request to set new framebuffer state. 398 * s3c_fb_set_par() - framebuffer request to set new framebuffer state.
367 * @info: The framebuffer to change. 399 * @info: The framebuffer to change.
368 * 400 *
@@ -810,14 +842,12 @@ static int s3c_fb_pan_display(struct fb_var_screeninfo *var,
810 842
811 /* Temporarily turn off per-vsync update from shadow registers until 843 /* Temporarily turn off per-vsync update from shadow registers until
812 * both start and end addresses are updated to prevent corruption */ 844 * both start and end addresses are updated to prevent corruption */
813 if (sfb->variant.has_prtcon) 845 shadow_protect_win(win, 1);
814 writel(PRTCON_PROTECT, sfb->regs + PRTCON);
815 846
816 writel(info->fix.smem_start + start_boff, buf + sfb->variant.buf_start); 847 writel(info->fix.smem_start + start_boff, buf + sfb->variant.buf_start);
817 writel(info->fix.smem_start + end_boff, buf + sfb->variant.buf_end); 848 writel(info->fix.smem_start + end_boff, buf + sfb->variant.buf_end);
818 849
819 if (sfb->variant.has_prtcon) 850 shadow_protect_win(win, 0);
820 writel(0, sfb->regs + PRTCON);
821 851
822 return 0; 852 return 0;
823} 853}
@@ -1530,6 +1560,8 @@ static struct s3c_fb_driverdata s3c_fb_data_s5pv210 __devinitdata = {
1530 [3] = 0x3000, 1560 [3] = 0x3000,
1531 [4] = 0x3400, 1561 [4] = 0x3400,
1532 }, 1562 },
1563
1564 .has_shadowcon = 1,
1533 }, 1565 },
1534 .win[0] = &s3c_fb_data_64xx_wins[0], 1566 .win[0] = &s3c_fb_data_64xx_wins[0],
1535 .win[1] = &s3c_fb_data_64xx_wins[1], 1567 .win[1] = &s3c_fb_data_64xx_wins[1],