本文整理汇总了C++中S3C_WINCON函数的典型用法代码示例。如果您正苦于以下问题:C++ S3C_WINCON函数的具体用法?C++ S3C_WINCON怎么用?C++ S3C_WINCON使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了S3C_WINCON函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: s3cfb_window_off
int s3cfb_window_off(struct s3cfb_global *ctrl, int id)
{
unsigned int cfg;
cfg = readl(ctrl->regs + S3C_WINCON(id));
cfg &= ~S3C_WINCON_ENWIN_ENABLE;
writel(cfg, ctrl->regs + S3C_WINCON(id));
dev_dbg(ctrl->dev, "[fb%d] turn off\n", id);
return 0;
}
示例2: s3cfb_window_on
int s3cfb_window_on(struct s3cfb_global *ctrl, int id)
{
struct s3c_platform_fb *pdata = to_fb_plat(ctrl->dev);
u32 cfg;
cfg = readl(ctrl->regs + S3C_WINCON(id));
cfg |= S3C_WINCON_ENWIN_ENABLE;
writel(cfg, ctrl->regs + S3C_WINCON(id));
if (pdata->hw_ver == 0x62) {
cfg = readl(ctrl->regs + S3C_WINSHMAP);
cfg |= S3C_WINSHMAP_CH_ENABLE(id);
writel(cfg, ctrl->regs + S3C_WINSHMAP);
}
dev_dbg(ctrl->dev, "[fb%d] turn on\n", id);
return 0;
}
示例3: s3cfb_window_off
int s3cfb_window_off(struct s3cfb_global *ctrl, int id)
{
struct s3c_platform_fb *pdata = to_fb_plat(ctrl->dev);
u32 cfg;
cfg = readl(ctrl->regs + S3C_WINCON(id));
cfg &= ~(S3C_WINCON_ENWIN_ENABLE | S3C_WINCON_DATAPATH_MASK);
cfg |= S3C_WINCON_DATAPATH_DMA;
writel(cfg, ctrl->regs + S3C_WINCON(id));
if ((pdata->hw_ver == 0x62) || (pdata->hw_ver == 0x70)) {
cfg = readl(ctrl->regs + S3C_WINSHMAP);
cfg &= ~S3C_WINSHMAP_CH_DISABLE(id);
writel(cfg, ctrl->regs + S3C_WINSHMAP);
}
dev_dbg(ctrl->dev, "[fb%d] turn off\n", id);
return 0;
}
示例4: s3cfb_set_alpha_blending
int s3cfb_set_alpha_blending(struct s3cfb_global *ctrl, int id)
{
struct s3cfb_window *win = ctrl->fb[id]->par;
struct s3cfb_alpha *alpha = &win->alpha;
u32 avalue = 0, cfg;
if (id == 0) {
dev_err(ctrl->dev, "[fb%d] does not support alpha blending\n",
id);
return -EINVAL;
}
cfg = readl(ctrl->regs + S3C_WINCON(id));
cfg &= ~(S3C_WINCON_BLD_MASK | S3C_WINCON_ALPHA_SEL_MASK);
if (alpha->mode == PIXEL_BLENDING) {
dev_dbg(ctrl->dev, "[fb%d] alpha mode: pixel blending\n", id);
/* fixing to DATA[31:24] for alpha value */
cfg |= (S3C_WINCON_BLD_PIXEL | S3C_WINCON_ALPHA1_SEL);
} else {
dev_dbg(ctrl->dev, "[fb%d] alpha mode: plane %d blending\n",
id, alpha->channel);
cfg |= S3C_WINCON_BLD_PLANE;
if (alpha->channel == 0) {
cfg |= S3C_WINCON_ALPHA0_SEL;
avalue = (alpha->value << S3C_VIDOSD_ALPHA0_SHIFT);
} else {
cfg |= S3C_WINCON_ALPHA1_SEL;
avalue = (alpha->value << S3C_VIDOSD_ALPHA1_SHIFT);
}
}
writel(cfg, ctrl->regs + S3C_WINCON(id));
writel(avalue, ctrl->regs + S3C_VIDOSD_C(id));
return 0;
}
示例5: s3cfb_set_window_control
int s3cfb_set_window_control(struct s3cfb_global *ctrl, int id)
{
struct s3c_platform_fb *pdata = to_fb_plat(ctrl->dev);
struct fb_info *fb = ctrl->fb[id];
struct fb_var_screeninfo *var = &fb->var;
struct s3cfb_window *win = fb->par;
u32 cfg;
cfg = readl(ctrl->regs + S3C_WINCON(id));
cfg &= ~(S3C_WINCON_BITSWP_ENABLE | S3C_WINCON_BYTESWP_ENABLE |
S3C_WINCON_HAWSWP_ENABLE | S3C_WINCON_WSWP_ENABLE |
S3C_WINCON_BURSTLEN_MASK | S3C_WINCON_BPPMODE_MASK |
S3C_WINCON_INRGB_MASK | S3C_WINCON_DATAPATH_MASK);
if (win->path != DATA_PATH_DMA) {
dev_dbg(ctrl->dev, "[fb%d] data path: fifo\n", id);
cfg |= S3C_WINCON_DATAPATH_LOCAL;
if (win->path == DATA_PATH_FIFO) {
cfg |= S3C_WINCON_INRGB_RGB;
cfg |= S3C_WINCON_BPPMODE_24BPP_888;
} else if (win->path == DATA_PATH_IPC) {
cfg |= S3C_WINCON_INRGB_YUV;
cfg |= S3C_WINCON_BPPMODE_24BPP_888;
}
if (id == 1) {
cfg &= ~(S3C_WINCON1_LOCALSEL_MASK |
S3C_WINCON1_VP_ENABLE);
if (win->local_channel == 0) {
cfg |= S3C_WINCON1_LOCALSEL_FIMC1;
} else {
cfg |= (S3C_WINCON1_LOCALSEL_VP |
S3C_WINCON1_VP_ENABLE);
}
}
} else {
dev_dbg(ctrl->dev, "[fb%d] data path: dma\n", id);
cfg |= S3C_WINCON_DATAPATH_DMA;
if (fb->var.bits_per_pixel == 16 && pdata->swap & FB_SWAP_HWORD)
cfg |= S3C_WINCON_HAWSWP_ENABLE;
if (fb->var.bits_per_pixel == 32 && pdata->swap & FB_SWAP_WORD)
cfg |= S3C_WINCON_WSWP_ENABLE;
/* dma burst */
if (win->dma_burst == 4)
cfg |= S3C_WINCON_BURSTLEN_4WORD;
else if (win->dma_burst == 8)
cfg |= S3C_WINCON_BURSTLEN_8WORD;
else
cfg |= S3C_WINCON_BURSTLEN_16WORD;
/* bpp mode set */
switch (fb->var.bits_per_pixel) {
case 16:
if (var->transp.length == 1) {
dev_dbg(ctrl->dev,
"[fb%d] bpp mode: A1-R5-G5-B5\n", id);
cfg |= S3C_WINCON_BPPMODE_16BPP_A555;
} else if (var->transp.length == 4) {
dev_dbg(ctrl->dev,
"[fb%d] bpp mode: A4-R4-G4-B4\n", id);
cfg |= S3C_WINCON_BPPMODE_16BPP_A444;
} else {
dev_dbg(ctrl->dev,
"[fb%d] bpp mode: R5-G6-B5\n", id);
cfg |= S3C_WINCON_BPPMODE_16BPP_565;
}
break;
case 24: /* packed 24 bpp: nothing to do for 6.x fimd */
break;
case 32:
if (var->transp.length == 0) {
dev_dbg(ctrl->dev,
"[fb%d] bpp mode: R8-G8-B8\n", id);
cfg |= S3C_WINCON_BPPMODE_24BPP_888;
} else {
dev_dbg(ctrl->dev,
"[fb%d] bpp mode: A8-R8-G8-B8\n", id);
cfg |= S3C_WINCON_BPPMODE_32BPP;
}
break;
}
}
writel(cfg, ctrl->regs + S3C_WINCON(id));
return 0;
}