Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208499
b: refs/heads/master
c: f5ec546
h: refs/heads/master
i:
  208497: 533e372
  208495: 7871046
v: v3
  • Loading branch information
Pawel Osciak authored and Linus Torvalds committed Aug 11, 2010
1 parent 755c49c commit 9a398e4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4787291fb9ce93f346f307c211af967d29cccad
refs/heads/master: f5ec546f1f5e21bfc84ce7a1ac7408702082c65a
3 changes: 3 additions & 0 deletions trunk/arch/arm/plat-samsung/include/plat/regs-fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,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)
Expand Down
40 changes: 36 additions & 4 deletions trunk/drivers/video/s3c-fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct s3c_fb;
* @osd: The base for the OSD registers.
* @palette: Address of palette memory, or 0 if none.
* @has_prtcon: Set if has PRTCON register.
* @has_shadowcon: Set if has SHADOWCON register.
*/
struct s3c_fb_variant {
unsigned int is_2443:1;
Expand All @@ -95,6 +96,7 @@ struct s3c_fb_variant {
unsigned short palette[S3C_FB_MAX_WIN];

unsigned int has_prtcon:1;
unsigned int has_shadowcon:1;
};

/**
Expand Down Expand Up @@ -362,6 +364,36 @@ static int s3c_fb_align_word(unsigned int bpp, unsigned int pix)
return ALIGN(pix, pix_per_word);
}

/**
* shadow_protect_win() - disable updating values from shadow registers at vsync
*
* @win: window to protect registers for
* @protect: 1 to protect (disable updates)
*/
static void shadow_protect_win(struct s3c_fb_win *win, bool protect)
{
struct s3c_fb *sfb = win->parent;
u32 reg;

if (protect) {
if (sfb->variant.has_prtcon) {
writel(PRTCON_PROTECT, sfb->regs + PRTCON);
} else if (sfb->variant.has_shadowcon) {
reg = readl(sfb->regs + SHADOWCON);
writel(reg | SHADOWCON_WINx_PROTECT(win->index),
sfb->regs + SHADOWCON);
}
} else {
if (sfb->variant.has_prtcon) {
writel(0, sfb->regs + PRTCON);
} else if (sfb->variant.has_shadowcon) {
reg = readl(sfb->regs + SHADOWCON);
writel(reg & ~SHADOWCON_WINx_PROTECT(win->index),
sfb->regs + SHADOWCON);
}
}
}

/**
* s3c_fb_set_par() - framebuffer request to set new framebuffer state.
* @info: The framebuffer to change.
Expand Down Expand Up @@ -810,14 +842,12 @@ static int s3c_fb_pan_display(struct fb_var_screeninfo *var,

/* Temporarily turn off per-vsync update from shadow registers until
* both start and end addresses are updated to prevent corruption */
if (sfb->variant.has_prtcon)
writel(PRTCON_PROTECT, sfb->regs + PRTCON);
shadow_protect_win(win, 1);

writel(info->fix.smem_start + start_boff, buf + sfb->variant.buf_start);
writel(info->fix.smem_start + end_boff, buf + sfb->variant.buf_end);

if (sfb->variant.has_prtcon)
writel(0, sfb->regs + PRTCON);
shadow_protect_win(win, 0);

return 0;
}
Expand Down Expand Up @@ -1530,6 +1560,8 @@ static struct s3c_fb_driverdata s3c_fb_data_s5pv210 __devinitdata = {
[3] = 0x3000,
[4] = 0x3400,
},

.has_shadowcon = 1,
},
.win[0] = &s3c_fb_data_64xx_wins[0],
.win[1] = &s3c_fb_data_64xx_wins[1],
Expand Down

0 comments on commit 9a398e4

Please sign in to comment.