Lines Matching refs:win
60 #define OSD_BASE(win, variant) ((variant).osd + ((win) * (variant).osd_stride)) argument
61 #define VIDOSD_A(win, variant) (OSD_BASE(win, variant) + 0x00) argument
62 #define VIDOSD_B(win, variant) (OSD_BASE(win, variant) + 0x04) argument
63 #define VIDOSD_C(win, variant) (OSD_BASE(win, variant) + 0x08) argument
64 #define VIDOSD_D(win, variant) (OSD_BASE(win, variant) + 0x0C) argument
137 struct s3c_fb_win_variant *win[S3C_FB_MAX_WIN]; member
227 static bool s3c_fb_validate_win_bpp(struct s3c_fb_win *win, unsigned int bpp) in s3c_fb_validate_win_bpp() argument
229 return win->variant.valid_bpp & VALID_BPP(bpp); in s3c_fb_validate_win_bpp()
243 struct s3c_fb_win *win = info->par; in s3c_fb_check_var() local
244 struct s3c_fb *sfb = win->parent; in s3c_fb_check_var()
251 if (!s3c_fb_validate_win_bpp(win, var->bits_per_pixel)) { in s3c_fb_check_var()
253 win->index, var->bits_per_pixel); in s3c_fb_check_var()
266 if (sfb->variant.palette[win->index] != 0) { in s3c_fb_check_var()
393 static void vidosd_set_size(struct s3c_fb_win *win, u32 size) in vidosd_set_size() argument
395 struct s3c_fb *sfb = win->parent; in vidosd_set_size()
398 if (win->variant.osd_size_off) in vidosd_set_size()
399 writel(size, sfb->regs + OSD_BASE(win->index, sfb->variant) in vidosd_set_size()
400 + win->variant.osd_size_off); in vidosd_set_size()
409 static void vidosd_set_alpha(struct s3c_fb_win *win, u32 alpha) in vidosd_set_alpha() argument
411 struct s3c_fb *sfb = win->parent; in vidosd_set_alpha()
413 if (win->variant.has_osd_alpha) in vidosd_set_alpha()
414 writel(alpha, sfb->regs + VIDOSD_C(win->index, sfb->variant)); in vidosd_set_alpha()
423 static void shadow_protect_win(struct s3c_fb_win *win, bool protect) in shadow_protect_win() argument
425 struct s3c_fb *sfb = win->parent; in shadow_protect_win()
433 writel(reg | SHADOWCON_WINx_PROTECT(win->index), in shadow_protect_win()
441 writel(reg & ~SHADOWCON_WINx_PROTECT(win->index), in shadow_protect_win()
489 struct s3c_fb_win *win = info->par; in s3c_fb_set_par() local
490 struct s3c_fb *sfb = win->parent; in s3c_fb_set_par()
493 int win_no = win->index; in s3c_fb_set_par()
502 shadow_protect_win(win, 1); in s3c_fb_set_par()
512 if (win->variant.palette_sz >= 256) in s3c_fb_set_par()
574 vidosd_set_alpha(win, alpha); in s3c_fb_set_par()
575 vidosd_set_size(win, data); in s3c_fb_set_par()
585 sfb->enabled |= (1 << win->index); in s3c_fb_set_par()
676 shadow_protect_win(win, 0); in s3c_fb_set_par()
698 struct s3c_fb_win *win, in s3c_fb_update_palette() argument
705 palreg = sfb->regs + sfb->variant.palette[win->index]; in s3c_fb_update_palette()
708 __func__, win->index, reg, palreg, value); in s3c_fb_update_palette()
710 win->palette_buffer[reg] = value; in s3c_fb_update_palette()
715 if (win->variant.palette_16bpp) in s3c_fb_update_palette()
744 struct s3c_fb_win *win = info->par; in s3c_fb_setcolreg() local
745 struct s3c_fb *sfb = win->parent; in s3c_fb_setcolreg()
749 __func__, win->index, regno, red, green, blue); in s3c_fb_setcolreg()
769 if (regno < win->variant.palette_sz) { in s3c_fb_setcolreg()
770 val = chan_to_field(red, &win->palette.r); in s3c_fb_setcolreg()
771 val |= chan_to_field(green, &win->palette.g); in s3c_fb_setcolreg()
772 val |= chan_to_field(blue, &win->palette.b); in s3c_fb_setcolreg()
774 s3c_fb_update_palette(sfb, win, regno, val); in s3c_fb_setcolreg()
797 struct s3c_fb_win *win = info->par; in s3c_fb_blank() local
798 struct s3c_fb *sfb = win->parent; in s3c_fb_blank()
799 unsigned int index = win->index; in s3c_fb_blank()
817 shadow_protect_win(win, 1); in s3c_fb_blank()
820 shadow_protect_win(win, 0); in s3c_fb_blank()
824 shadow_protect_win(win, 1); in s3c_fb_blank()
826 shadow_protect_win(win, 0); in s3c_fb_blank()
838 shadow_protect_win(win, 1); in s3c_fb_blank()
847 shadow_protect_win(win, 0); in s3c_fb_blank()
868 struct s3c_fb_win *win = info->par; in s3c_fb_pan_display() local
869 struct s3c_fb *sfb = win->parent; in s3c_fb_pan_display()
870 void __iomem *buf = sfb->regs + win->index * 8; in s3c_fb_pan_display()
902 shadow_protect_win(win, 1); in s3c_fb_pan_display()
907 shadow_protect_win(win, 0); in s3c_fb_pan_display()
1018 struct s3c_fb_win *win = info->par; in s3c_fb_ioctl() local
1019 struct s3c_fb *sfb = win->parent; in s3c_fb_ioctl()
1081 static int s3c_fb_alloc_memory(struct s3c_fb *sfb, struct s3c_fb_win *win) in s3c_fb_alloc_memory() argument
1083 struct s3c_fb_pd_win *windata = win->windata; in s3c_fb_alloc_memory()
1085 struct fb_info *fbi = win->fbinfo; in s3c_fb_alloc_memory()
1126 static void s3c_fb_free_memory(struct s3c_fb *sfb, struct s3c_fb_win *win) in s3c_fb_free_memory() argument
1128 struct fb_info *fbi = win->fbinfo; in s3c_fb_free_memory()
1143 static void s3c_fb_release_win(struct s3c_fb *sfb, struct s3c_fb_win *win) in s3c_fb_release_win() argument
1147 if (win->fbinfo) { in s3c_fb_release_win()
1150 data &= ~SHADOWCON_CHx_ENABLE(win->index); in s3c_fb_release_win()
1151 data &= ~SHADOWCON_CHx_LOCAL_ENABLE(win->index); in s3c_fb_release_win()
1154 unregister_framebuffer(win->fbinfo); in s3c_fb_release_win()
1155 if (win->fbinfo->cmap.len) in s3c_fb_release_win()
1156 fb_dealloc_cmap(&win->fbinfo->cmap); in s3c_fb_release_win()
1157 s3c_fb_free_memory(sfb, win); in s3c_fb_release_win()
1158 framebuffer_release(win->fbinfo); in s3c_fb_release_win()
1178 struct s3c_fb_win *win; in s3c_fb_probe_win() local
1194 windata = sfb->pdata->win[win_no]; in s3c_fb_probe_win()
1201 win = fbinfo->par; in s3c_fb_probe_win()
1202 *res = win; in s3c_fb_probe_win()
1203 win->variant = *variant; in s3c_fb_probe_win()
1204 win->fbinfo = fbinfo; in s3c_fb_probe_win()
1205 win->parent = sfb; in s3c_fb_probe_win()
1206 win->windata = windata; in s3c_fb_probe_win()
1207 win->index = win_no; in s3c_fb_probe_win()
1208 win->palette_buffer = (u32 *)(win + 1); in s3c_fb_probe_win()
1210 ret = s3c_fb_alloc_memory(sfb, win); in s3c_fb_probe_win()
1217 if (win->variant.palette_16bpp) { in s3c_fb_probe_win()
1219 win->palette.r.offset = 11; in s3c_fb_probe_win()
1220 win->palette.r.length = 5; in s3c_fb_probe_win()
1221 win->palette.g.offset = 5; in s3c_fb_probe_win()
1222 win->palette.g.length = 6; in s3c_fb_probe_win()
1223 win->palette.b.offset = 0; in s3c_fb_probe_win()
1224 win->palette.b.length = 5; in s3c_fb_probe_win()
1228 win->palette.r.offset = 16; in s3c_fb_probe_win()
1229 win->palette.r.length = 8; in s3c_fb_probe_win()
1230 win->palette.g.offset = 8; in s3c_fb_probe_win()
1231 win->palette.g.length = 8; in s3c_fb_probe_win()
1232 win->palette.b.offset = 0; in s3c_fb_probe_win()
1233 win->palette.b.length = 8; in s3c_fb_probe_win()
1248 fbinfo->pseudo_palette = &win->pseudo_palette; in s3c_fb_probe_win()
1260 ret = fb_alloc_cmap(&fbinfo->cmap, win->variant.palette_sz, 1); in s3c_fb_probe_win()
1337 static void s3c_fb_clear_win(struct s3c_fb *sfb, int win) in s3c_fb_clear_win() argument
1342 writel(0, regs + sfb->variant.wincon + (win * 4)); in s3c_fb_clear_win()
1343 writel(0, regs + VIDOSD_A(win, sfb->variant)); in s3c_fb_clear_win()
1344 writel(0, regs + VIDOSD_B(win, sfb->variant)); in s3c_fb_clear_win()
1345 writel(0, regs + VIDOSD_C(win, sfb->variant)); in s3c_fb_clear_win()
1349 reg &= ~(SHADOWCON_WINx_PROTECT(win) | in s3c_fb_clear_win()
1350 SHADOWCON_CHx_ENABLE(win) | in s3c_fb_clear_win()
1351 SHADOWCON_CHx_LOCAL_ENABLE(win)); in s3c_fb_clear_win()
1364 int win; in s3c_fb_probe() local
1456 for (win = 0; win < fbdrv->variant.nr_windows; win++) in s3c_fb_probe()
1457 s3c_fb_clear_win(sfb, win); in s3c_fb_probe()
1460 for (win = 0; win < (fbdrv->variant.nr_windows - 1); win++) { in s3c_fb_probe()
1463 regs += (win * 8); in s3c_fb_probe()
1472 for (win = 0; win < fbdrv->variant.nr_windows; win++) { in s3c_fb_probe()
1473 if (!pd->win[win]) in s3c_fb_probe()
1476 ret = s3c_fb_probe_win(sfb, win, fbdrv->win[win], in s3c_fb_probe()
1477 &sfb->windows[win]); in s3c_fb_probe()
1479 dev_err(dev, "failed to create window %d\n", win); in s3c_fb_probe()
1480 for (; win >= 0; win--) in s3c_fb_probe()
1481 s3c_fb_release_win(sfb, sfb->windows[win]); in s3c_fb_probe()
1516 int win; in s3c_fb_remove() local
1520 for (win = 0; win < S3C_FB_MAX_WIN; win++) in s3c_fb_remove()
1521 if (sfb->windows[win]) in s3c_fb_remove()
1522 s3c_fb_release_win(sfb, sfb->windows[win]); in s3c_fb_remove()
1539 struct s3c_fb_win *win; in s3c_fb_suspend() local
1545 win = sfb->windows[win_no]; in s3c_fb_suspend()
1546 if (!win) in s3c_fb_suspend()
1550 s3c_fb_blank(FB_BLANK_POWERDOWN, win->fbinfo); in s3c_fb_suspend()
1567 struct s3c_fb_win *win; in s3c_fb_resume() local
1596 win = sfb->windows[win_no]; in s3c_fb_resume()
1597 if (!win) in s3c_fb_resume()
1600 shadow_protect_win(win, 1); in s3c_fb_resume()
1604 shadow_protect_win(win, 0); in s3c_fb_resume()
1611 win = sfb->windows[win_no]; in s3c_fb_resume()
1612 if (!win) in s3c_fb_resume()
1616 s3c_fb_set_par(win->fbinfo); in s3c_fb_resume()
1736 .win[0] = &s3c_fb_data_64xx_wins[0],
1737 .win[1] = &s3c_fb_data_64xx_wins[1],
1738 .win[2] = &s3c_fb_data_64xx_wins[2],
1739 .win[3] = &s3c_fb_data_64xx_wins[3],
1740 .win[4] = &s3c_fb_data_64xx_wins[4],
1765 .win[0] = &(struct s3c_fb_win_variant) {
1769 .win[1] = &(struct s3c_fb_win_variant) {