Lines Matching refs:info
115 static void vt8623fb_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor)
117 struct vt8623fb_info *par = info->par;
119 svga_tilecursor(par->state.vgabase, info, cursor);
142 static void vt8623fb_iplan_imageblit(struct fb_info *info, const struct fb_image *image)
153 dst1 = info->screen_base + (image->dy * info->fix.line_length)
165 dst1 += info->fix.line_length;
170 static void vt8623fb_iplan_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
177 dst1 = info->screen_base + (rect->dy * info->fix.line_length)
185 dst1 += info->fix.line_length;
198 static void vt8623fb_cfb4_imageblit(struct fb_info *info, const struct fb_image *image)
209 dst1 = info->screen_base + (image->dy * info->fix.line_length)
221 dst1 += info->fix.line_length;
225 static void vt8623fb_imageblit(struct fb_info *info, const struct fb_image *image)
227 if ((info->var.bits_per_pixel == 4) && (image->depth == 1)
229 if (info->fix.type == FB_TYPE_INTERLEAVED_PLANES)
230 vt8623fb_iplan_imageblit(info, image);
232 vt8623fb_cfb4_imageblit(info, image);
234 cfb_imageblit(info, image);
237 static void vt8623fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
239 if ((info->var.bits_per_pixel == 4)
241 && (info->fix.type == FB_TYPE_INTERLEAVED_PLANES))
242 vt8623fb_iplan_fillrect(info, rect);
244 cfb_fillrect(info, rect);
251 static void vt8623_set_pixclock(struct fb_info *info, u32 pixclock)
253 struct vt8623fb_info *par = info->par;
258 rv = svga_compute_pll(&vt8623_pll, 1000000000 / pixclock, &m, &n, &r, info->node);
260 fb_err(info, "cannot set requested pixclock, keeping old value\n");
280 static int vt8623fb_open(struct fb_info *info, int user)
282 struct vt8623fb_info *par = info->par;
302 static int vt8623fb_release(struct fb_info *info, int user)
304 struct vt8623fb_info *par = info->par;
321 static int vt8623fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
332 fb_err(info, "unsupported mode requested\n");
349 if (mem > info->screen_size)
351 fb_err(info, "not enough framebuffer memory (%d kB requested, %d kB available)\n",
352 mem >> 10, (unsigned int) (info->screen_size >> 10));
359 fb_err(info, "text framebuffer size too large (%d kB requested, 256 kB possible)\n",
364 rv = svga_check_timings (&vt8623_timing_regs, var, info->node);
367 fb_err(info, "invalid timings requested\n");
379 static int vt8623fb_set_par(struct fb_info *info)
382 struct vt8623fb_info *par = info->par;
383 u32 bpp = info->var.bits_per_pixel;
386 info->fix.ypanstep = 1;
387 info->fix.line_length = (info->var.xres_virtual * bpp) / 8;
389 info->flags &= ~FBINFO_MISC_TILEBLITTING;
390 info->tileops = NULL;
393 info->pixmap.blit_x = (bpp == 4) ? (1 << (8 - 1)) : (~(u32)0);
394 info->pixmap.blit_y = ~(u32)0;
396 offset_value = (info->var.xres_virtual * bpp) / 64;
397 fetch_value = ((info->var.xres * bpp) / 128) + 4;
400 fetch_value = (info->var.xres / 8) + 8; /* + 0 is OK */
402 screen_size = info->var.yres_virtual * info->fix.line_length;
404 info->fix.ypanstep = 16;
405 info->fix.line_length = 0;
407 info->flags |= FBINFO_MISC_TILEBLITTING;
408 info->tileops = &vt8623fb_tile_ops;
411 info->pixmap.blit_x = 1 << (8 - 1);
412 info->pixmap.blit_y = 1 << (16 - 1);
414 offset_value = info->var.xres_virtual / 16;
415 fetch_value = (info->var.xres / 8) + 8;
416 screen_size = (info->var.xres_virtual * info->var.yres_virtual) / 64;
419 info->var.xoffset = 0;
420 info->var.yoffset = 0;
421 info->var.activate = FB_ACTIVATE_NOW;
448 if (info->var.vmode & FB_VMODE_DOUBLE)
470 mode = svga_match_format(vt8623fb_formats, &(info->var), &(info->fix));
473 fb_dbg(info, "text mode\n");
479 fb_dbg(info, "4 bit pseudocolor\n");
485 fb_dbg(info, "4 bit pseudocolor, planar\n");
490 fb_dbg(info, "8 bit pseudocolor\n");
494 fb_dbg(info, "5/6/5 truecolor\n");
498 fb_dbg(info, "8/8/8 truecolor\n");
506 vt8623_set_pixclock(info, info->var.pixclock);
507 svga_set_timings(par->state.vgabase, &vt8623_timing_regs, &(info->var), 1, 1,
508 (info->var.vmode & FB_VMODE_DOUBLE) ? 2 : 1, 1,
509 1, info->node);
511 if (screen_size > info->screen_size)
512 screen_size = info->screen_size;
513 memset_io(info->screen_base, 0x00, screen_size);
579 static int vt8623fb_blank(int blank_mode, struct fb_info *info)
581 struct vt8623fb_info *par = info->par;
585 fb_dbg(info, "unblank\n");
590 fb_dbg(info, "blank\n");
595 fb_dbg(info, "DPMS standby (hsync off)\n");
600 fb_dbg(info, "DPMS suspend (vsync off)\n");
605 fb_dbg(info, "DPMS off (no sync)\n");
615 static int vt8623fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
617 struct vt8623fb_info *par = info->par;
621 if (info->var.bits_per_pixel == 0) {
622 offset = (var->yoffset / 16) * info->var.xres_virtual
626 offset = (var->yoffset * info->fix.line_length) +
627 (var->xoffset * info->var.bits_per_pixel / 8);
628 offset = offset >> ((info->var.bits_per_pixel == 4) ? 2 : 1);
665 struct fb_info *info;
681 info = framebuffer_alloc(sizeof(struct vt8623fb_info), &(dev->dev));
682 if (!info)
685 par = info->par;
688 info->flags = FBINFO_PARTIAL_PAN_OK | FBINFO_HWACCEL_YPAN;
689 info->fbops = &vt8623fb_ops;
695 dev_err(info->device, "cannot enable PCI device\n");
701 dev_err(info->device, "cannot reserve framebuffer region\n");
705 info->fix.smem_start = pci_resource_start(dev, 0);
706 info->fix.smem_len = pci_resource_len(dev, 0);
707 info->fix.mmio_start = pci_resource_start(dev, 1);
708 info->fix.mmio_len = pci_resource_len(dev, 1);
711 info->screen_base = pci_iomap_wc(dev, 0, 0);
712 if (! info->screen_base) {
714 dev_err(info->device, "iomap for framebuffer failed\n");
721 dev_err(info->device, "iomap for MMIO failed\n");
739 info->screen_size = memsize1 << 20;
741 dev_err(info->device, "memory size detection failed (%x %x), suppose 16 MB\n", memsize1, memsize2);
742 info->screen_size = 16 << 20;
745 info->fix.smem_len = info->screen_size;
746 strcpy(info->fix.id, "VIA VT8623");
747 info->fix.type = FB_TYPE_PACKED_PIXELS;
748 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
749 info->fix.ypanstep = 0;
750 info->fix.accel = FB_ACCEL_NONE;
751 info->pseudo_palette = (void*)par->pseudo_palette;
756 rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8);
760 dev_err(info->device, "mode %s not found\n", mode_option);
764 rc = fb_alloc_cmap(&info->cmap, 256, 0);
766 dev_err(info->device, "cannot allocate colormap\n");
770 rc = register_framebuffer(info);
772 dev_err(info->device, "cannot register framebuffer\n");
776 fb_info(info, "%s on %s, %d MB RAM\n",
777 info->fix.id, pci_name(dev), info->fix.smem_len >> 20);
780 pci_set_drvdata(dev, info);
783 par->wc_cookie = arch_phys_wc_add(info->fix.smem_start,
784 info->fix.smem_len);
790 fb_dealloc_cmap(&info->cmap);
795 pci_iounmap(dev, info->screen_base);
801 framebuffer_release(info);
809 struct fb_info *info = pci_get_drvdata(dev);
811 if (info) {
812 struct vt8623fb_info *par = info->par;
815 unregister_framebuffer(info);
816 fb_dealloc_cmap(&info->cmap);
818 pci_iounmap(dev, info->screen_base);
823 framebuffer_release(info);
832 struct fb_info *info = dev_get_drvdata(dev);
833 struct vt8623fb_info *par = info->par;
835 dev_info(info->device, "suspend\n");
846 fb_set_suspend(info, 1);
859 struct fb_info *info = dev_get_drvdata(dev);
860 struct vt8623fb_info *par = info->par;
862 dev_info(info->device, "resume\n");
870 vt8623fb_set_par(info);
871 fb_set_suspend(info, 0);