Lines Matching refs:fb_info

172 	struct fb_info fb_info;
209 #define to_imxfb_host(x) (container_of(x, struct mxsfb_info, fb_info))
268 struct fb_info *fb_info)
270 struct mxsfb_info *host = to_imxfb_host(fb_info);
317 static void mxsfb_enable_controller(struct fb_info *fb_info)
319 struct mxsfb_info *host = to_imxfb_host(fb_info);
335 clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U);
350 static void mxsfb_disable_controller(struct fb_info *fb_info)
352 struct mxsfb_info *host = to_imxfb_host(fb_info);
388 static int mxsfb_set_par(struct fb_info *fb_info)
390 struct mxsfb_info *host = to_imxfb_host(fb_info);
395 line_size = fb_info->var.xres * (fb_info->var.bits_per_pixel >> 3);
396 fb_size = fb_info->var.yres_virtual * line_size;
398 if (fb_size > fb_info->fix.smem_len)
401 fb_info->fix.line_length = line_size;
410 mxsfb_disable_controller(fb_info);
419 switch (fb_info->var.bits_per_pixel) {
444 fb_info->var.bits_per_pixel);
450 writel(TRANSFER_COUNT_SET_VCOUNT(fb_info->var.yres) |
451 TRANSFER_COUNT_SET_HCOUNT(fb_info->var.xres),
457 VDCTRL0_SET_VSYNC_PULSE_WIDTH(fb_info->var.vsync_len);
458 if (fb_info->var.sync & FB_SYNC_HOR_HIGH_ACT)
460 if (fb_info->var.sync & FB_SYNC_VERT_HIGH_ACT)
470 writel(fb_info->var.upper_margin + fb_info->var.vsync_len +
471 fb_info->var.lower_margin + fb_info->var.yres,
475 writel(set_hsync_pulse_width(host, fb_info->var.hsync_len) |
476 VDCTRL2_SET_HSYNC_PERIOD(fb_info->var.left_margin +
477 fb_info->var.hsync_len + fb_info->var.right_margin +
478 fb_info->var.xres),
481 writel(SET_HOR_WAIT_CNT(fb_info->var.left_margin +
482 fb_info->var.hsync_len) |
483 SET_VERT_WAIT_CNT(fb_info->var.upper_margin +
484 fb_info->var.vsync_len),
487 vdctrl4 = SET_DOTCLK_H_VALID_DATA_CNT(fb_info->var.xres);
492 writel(fb_info->fix.smem_start +
493 fb_info->fix.line_length * fb_info->var.yoffset,
497 mxsfb_enable_controller(fb_info);
503 u_int transp, struct fb_info *fb_info)
512 if (fb_info->var.grayscale)
516 switch (fb_info->fix.visual) {
523 u32 *pal = fb_info->pseudo_palette;
525 val = chan_to_field(red, &fb_info->var.red);
526 val |= chan_to_field(green, &fb_info->var.green);
527 val |= chan_to_field(blue, &fb_info->var.blue);
542 static int mxsfb_blank(int blank, struct fb_info *fb_info)
544 struct mxsfb_info *host = to_imxfb_host(fb_info);
552 mxsfb_disable_controller(fb_info);
557 mxsfb_enable_controller(fb_info);
564 struct fb_info *fb_info)
566 struct mxsfb_info *host = to_imxfb_host(fb_info);
572 offset = fb_info->fix.line_length * var->yoffset;
575 writel(fb_info->fix.smem_start + offset,
596 struct fb_info *fb_info = &host->fb_info;
630 fb_info->var.bits_per_pixel = bits_per_pixel;
661 fb_info->fix.line_length = vmode->xres * (bits_per_pixel >> 3);
664 fbsize = fb_info->fix.line_length * vmode->yres;
665 if (pa < fb_info->fix.smem_start)
667 if (pa + fbsize > fb_info->fix.smem_start + fb_info->fix.smem_len)
669 ofs = pa - fb_info->fix.smem_start;
671 memmove(fb_info->screen_base, fb_info->screen_base + ofs, fbsize);
672 writel(fb_info->fix.smem_start, host->base + host->devdata->next_buf);
675 line_count = fb_info->fix.smem_len / fb_info->fix.line_length;
676 fb_info->fix.ypanstep = 1;
687 struct fb_info *fb_info = &host->fb_info;
688 struct fb_var_screeninfo *var = &fb_info->var;
758 struct fb_info *fb_info = &host->fb_info;
759 struct fb_var_screeninfo *var = &fb_info->var;
764 fb_info->fbops = &mxsfb_ops;
765 fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST;
766 strlcpy(fb_info->fix.id, "mxs", sizeof(fb_info->fix.id));
767 fb_info->fix.type = FB_TYPE_PACKED_PIXELS;
768 fb_info->fix.ypanstep = 1;
769 fb_info->fix.visual = FB_VISUAL_TRUECOLOR,
770 fb_info->fix.accel = FB_ACCEL_NONE;
789 fb_info->fix.smem_start = fb_phys;
790 fb_info->screen_base = fb_virt;
791 fb_info->screen_size = fb_info->fix.smem_len = fb_size;
801 struct fb_info *fb_info = &host->fb_info;
803 free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len);
832 struct fb_info *fb_info;
839 fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), &pdev->dev);
840 if (!fb_info) {
850 host = to_imxfb_host(fb_info);
874 fb_info->pseudo_palette = devm_kzalloc(&pdev->dev, sizeof(u32) * 16,
876 if (!fb_info->pseudo_palette) {
885 fb_videomode_to_var(&fb_info->var, mode);
888 mxsfb_check_var(&fb_info->var, fb_info);
890 platform_set_drvdata(pdev, fb_info);
892 ret = register_framebuffer(fb_info);
900 mxsfb_set_par(fb_info);
901 mxsfb_enable_controller(fb_info);
912 framebuffer_release(fb_info);
919 struct fb_info *fb_info = platform_get_drvdata(pdev);
920 struct mxsfb_info *host = to_imxfb_host(fb_info);
923 mxsfb_disable_controller(fb_info);
925 unregister_framebuffer(fb_info);
928 framebuffer_release(fb_info);
935 struct fb_info *fb_info = platform_get_drvdata(pdev);
936 struct mxsfb_info *host = to_imxfb_host(fb_info);