Lines Matching refs:fbi
29 static int mxcfb_map_video_memory(struct fb_info *fbi);
30 static int mxcfb_unmap_video_memory(struct fb_info *fbi);
91 static uint32_t bpp_to_pixfmt(struct fb_info *fbi) in bpp_to_pixfmt() argument
95 debug("bpp_to_pixfmt: %d\n", fbi->var.bits_per_pixel); in bpp_to_pixfmt()
97 if (fbi->var.nonstd) in bpp_to_pixfmt()
98 return fbi->var.nonstd; in bpp_to_pixfmt()
100 switch (fbi->var.bits_per_pixel) { in bpp_to_pixfmt()
135 static int setup_disp_channel1(struct fb_info *fbi) in setup_disp_channel1() argument
138 struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par; in setup_disp_channel1()
148 if (fbi->var.vmode & FB_VMODE_INTERLACED) { in setup_disp_channel1()
161 params.mem_dp_bg_sync.in_pixel_fmt = bpp_to_pixfmt(fbi); in setup_disp_channel1()
170 static int setup_disp_channel2(struct fb_info *fbi) in setup_disp_channel2() argument
173 struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par; in setup_disp_channel2()
179 fbi->var.xoffset = fbi->var.yoffset = 0; in setup_disp_channel2()
184 fbi->var.xres, in setup_disp_channel2()
185 fbi->var.yres, in setup_disp_channel2()
186 fbi->fix.line_length, in setup_disp_channel2()
187 fbi->fix.smem_start, in setup_disp_channel2()
188 fbi->fix.smem_start + in setup_disp_channel2()
189 (fbi->fix.line_length * fbi->var.yres)); in setup_disp_channel2()
192 bpp_to_pixfmt(fbi), in setup_disp_channel2()
193 fbi->var.xres, fbi->var.yres, in setup_disp_channel2()
194 fbi->fix.line_length, in setup_disp_channel2()
195 fbi->fix.smem_start + in setup_disp_channel2()
196 (fbi->fix.line_length * fbi->var.yres), in setup_disp_channel2()
197 fbi->fix.smem_start, in setup_disp_channel2()
210 static int mxcfb_set_par(struct fb_info *fbi) in mxcfb_set_par() argument
215 struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par; in mxcfb_set_par()
220 mxcfb_set_fix(fbi); in mxcfb_set_par()
222 mem_len = fbi->var.yres_virtual * fbi->fix.line_length; in mxcfb_set_par()
223 if (!fbi->fix.smem_start || (mem_len > fbi->fix.smem_len)) { in mxcfb_set_par()
224 if (fbi->fix.smem_start) in mxcfb_set_par()
225 mxcfb_unmap_video_memory(fbi); in mxcfb_set_par()
227 if (mxcfb_map_video_memory(fbi) < 0) in mxcfb_set_par()
231 setup_disp_channel1(fbi); in mxcfb_set_par()
234 if (fbi->var.vmode & FB_VMODE_INTERLACED) { in mxcfb_set_par()
243 if (fbi->var.vmode & FB_VMODE_ODD_FLD_FIRST) /* PAL */ in mxcfb_set_par()
245 if ((fbi->var.sync & FB_SYNC_EXT) || ext_clk_used) in mxcfb_set_par()
247 if (fbi->var.sync & FB_SYNC_HOR_HIGH_ACT) in mxcfb_set_par()
249 if (fbi->var.sync & FB_SYNC_VERT_HIGH_ACT) in mxcfb_set_par()
251 if (!(fbi->var.sync & FB_SYNC_CLK_LAT_FALL)) in mxcfb_set_par()
253 if (fbi->var.sync & FB_SYNC_DATA_INVERT) in mxcfb_set_par()
255 if (!(fbi->var.sync & FB_SYNC_OE_LOW_ACT)) in mxcfb_set_par()
257 if (fbi->var.sync & FB_SYNC_CLK_IDLE_EN) in mxcfb_set_par()
260 debug("pixclock = %lu Hz\n", PICOS2KHZ(fbi->var.pixclock) * 1000UL); in mxcfb_set_par()
263 (PICOS2KHZ(fbi->var.pixclock)) * 1000UL, in mxcfb_set_par()
264 fbi->var.xres, fbi->var.yres, in mxcfb_set_par()
266 fbi->var.left_margin, in mxcfb_set_par()
267 fbi->var.hsync_len, in mxcfb_set_par()
268 fbi->var.right_margin, in mxcfb_set_par()
269 fbi->var.upper_margin, in mxcfb_set_par()
270 fbi->var.vsync_len, in mxcfb_set_par()
271 fbi->var.lower_margin, in mxcfb_set_par()
277 retval = setup_disp_channel2(fbi); in mxcfb_set_par()
397 static int mxcfb_map_video_memory(struct fb_info *fbi) in mxcfb_map_video_memory() argument
399 if (fbi->fix.smem_len < fbi->var.yres_virtual * fbi->fix.line_length) { in mxcfb_map_video_memory()
400 fbi->fix.smem_len = fbi->var.yres_virtual * in mxcfb_map_video_memory()
401 fbi->fix.line_length; in mxcfb_map_video_memory()
403 fbi->fix.smem_len = roundup(fbi->fix.smem_len, ARCH_DMA_MINALIGN); in mxcfb_map_video_memory()
404 fbi->screen_base = (char *)memalign(ARCH_DMA_MINALIGN, in mxcfb_map_video_memory()
405 fbi->fix.smem_len); in mxcfb_map_video_memory()
406 fbi->fix.smem_start = (unsigned long)fbi->screen_base; in mxcfb_map_video_memory()
407 if (fbi->screen_base == 0) { in mxcfb_map_video_memory()
409 fbi->fix.smem_len = 0; in mxcfb_map_video_memory()
410 fbi->fix.smem_start = 0; in mxcfb_map_video_memory()
415 (uint32_t) fbi->fix.smem_start, fbi->fix.smem_len); in mxcfb_map_video_memory()
417 fbi->screen_size = fbi->fix.smem_len; in mxcfb_map_video_memory()
419 gd->fb_base = fbi->fix.smem_start; in mxcfb_map_video_memory()
422 memset((char *)fbi->screen_base, 0, fbi->fix.smem_len); in mxcfb_map_video_memory()
427 static int mxcfb_unmap_video_memory(struct fb_info *fbi) in mxcfb_unmap_video_memory() argument
429 fbi->screen_base = 0; in mxcfb_unmap_video_memory()
430 fbi->fix.smem_start = 0; in mxcfb_unmap_video_memory()
431 fbi->fix.smem_len = 0; in mxcfb_unmap_video_memory()
448 struct fb_info *fbi; in mxcfb_init_fbinfo() local
470 fbi = (struct fb_info *)p; in mxcfb_init_fbinfo()
471 fbi->par = p + sizeof(struct fb_info) + PADDING; in mxcfb_init_fbinfo()
473 mxcfbi = (struct mxcfb_info *)fbi->par; in mxcfb_init_fbinfo()
475 (unsigned int)fbi, (unsigned int)mxcfbi); in mxcfb_init_fbinfo()
477 fbi->var.activate = FB_ACTIVATE_NOW; in mxcfb_init_fbinfo()
479 fbi->flags = FBINFO_FLAG_DEFAULT; in mxcfb_init_fbinfo()
480 fbi->pseudo_palette = mxcfbi->pseudo_palette; in mxcfb_init_fbinfo()
482 return fbi; in mxcfb_init_fbinfo()
496 struct fb_info *fbi; in mxcfb_probe() local
503 fbi = mxcfb_init_fbinfo(); in mxcfb_probe()
504 if (!fbi) { in mxcfb_probe()
508 mxcfbi = (struct mxcfb_info *)fbi->par; in mxcfb_probe()
522 strcpy(fbi->fix.id, "DISP3 BG"); in mxcfb_probe()
526 mxcfb_info[mxcfbi->ipu_di] = fbi; in mxcfb_probe()
531 fb_videomode_to_var(&fbi->var, mode); in mxcfb_probe()
532 fbi->var.bits_per_pixel = 16; in mxcfb_probe()
533 fbi->fix.line_length = fbi->var.xres * (fbi->var.bits_per_pixel / 8); in mxcfb_probe()
534 fbi->fix.smem_len = fbi->var.yres_virtual * fbi->fix.line_length; in mxcfb_probe()
536 mxcfb_check_var(&fbi->var, fbi); in mxcfb_probe()
539 fbi->var.yres_virtual = fbi->var.yres * 2; in mxcfb_probe()
541 mxcfb_set_fix(fbi); in mxcfb_probe()
544 if (mxcfb_map_video_memory(fbi) < 0) in mxcfb_probe()
547 mxcfb_set_par(fbi); in mxcfb_probe()
554 panel.frameAdrs = (u32)fbi->screen_base; in mxcfb_probe()
555 panel.memSize = fbi->screen_size; in mxcfb_probe()
577 struct fb_info *fbi = mxcfb_info[i]; in ipuv3_fb_shutdown() local
578 if (fbi) { in ipuv3_fb_shutdown()
579 struct mxcfb_info *mxc_fbi = fbi->par; in ipuv3_fb_shutdown()