Lines Matching refs:info
114 static void vt8623fb_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor)
116 struct vt8623fb_info *par = info->par;
118 svga_tilecursor(par->state.vgabase, info, cursor);
141 static void vt8623fb_iplan_imageblit(struct fb_info *info, const struct fb_image *image)
152 dst1 = info->screen_base + (image->dy * info->fix.line_length)
164 dst1 += info->fix.line_length;
169 static void vt8623fb_iplan_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
176 dst1 = info->screen_base + (rect->dy * info->fix.line_length)
184 dst1 += info->fix.line_length;
197 static void vt8623fb_cfb4_imageblit(struct fb_info *info, const struct fb_image *image)
208 dst1 = info->screen_base + (image->dy * info->fix.line_length)
220 dst1 += info->fix.line_length;
224 static void vt8623fb_imageblit(struct fb_info *info, const struct fb_image *image)
226 if ((info->var.bits_per_pixel == 4) && (image->depth == 1)
228 if (info->fix.type == FB_TYPE_INTERLEAVED_PLANES)
229 vt8623fb_iplan_imageblit(info, image);
231 vt8623fb_cfb4_imageblit(info, image);
233 cfb_imageblit(info, image);
236 static void vt8623fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
238 if ((info->var.bits_per_pixel == 4)
240 && (info->fix.type == FB_TYPE_INTERLEAVED_PLANES))
241 vt8623fb_iplan_fillrect(info, rect);
243 cfb_fillrect(info, rect);
250 static void vt8623_set_pixclock(struct fb_info *info, u32 pixclock)
252 struct vt8623fb_info *par = info->par;
257 rv = svga_compute_pll(&vt8623_pll, 1000000000 / pixclock, &m, &n, &r, info->node);
259 fb_err(info, "cannot set requested pixclock, keeping old value\n");
279 static int vt8623fb_open(struct fb_info *info, int user)
281 struct vt8623fb_info *par = info->par;
301 static int vt8623fb_release(struct fb_info *info, int user)
303 struct vt8623fb_info *par = info->par;
320 static int vt8623fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
328 fb_err(info, "unsupported mode requested\n");
345 if (mem > info->screen_size)
347 fb_err(info, "not enough framebuffer memory (%d kB requested, %d kB available)\n",
348 mem >> 10, (unsigned int) (info->screen_size >> 10));
355 fb_err(info, "text framebuffer size too large (%d kB requested, 256 kB possible)\n",
360 rv = svga_check_timings (&vt8623_timing_regs, var, info->node);
363 fb_err(info, "invalid timings requested\n");
375 static int vt8623fb_set_par(struct fb_info *info)
378 struct vt8623fb_info *par = info->par;
379 u32 bpp = info->var.bits_per_pixel;
382 info->fix.ypanstep = 1;
383 info->fix.line_length = (info->var.xres_virtual * bpp) / 8;
385 info->flags &= ~FBINFO_MISC_TILEBLITTING;
386 info->tileops = NULL;
389 info->pixmap.blit_x = (bpp == 4) ? (1 << (8 - 1)) : (~(u32)0);
390 info->pixmap.blit_y = ~(u32)0;
392 offset_value = (info->var.xres_virtual * bpp) / 64;
393 fetch_value = ((info->var.xres * bpp) / 128) + 4;
396 fetch_value = (info->var.xres / 8) + 8; /* + 0 is OK */
398 screen_size = info->var.yres_virtual * info->fix.line_length;
400 info->fix.ypanstep = 16;
401 info->fix.line_length = 0;
403 info->flags |= FBINFO_MISC_TILEBLITTING;
404 info->tileops = &vt8623fb_tile_ops;
407 info->pixmap.blit_x = 1 << (8 - 1);
408 info->pixmap.blit_y = 1 << (16 - 1);
410 offset_value = info->var.xres_virtual / 16;
411 fetch_value = (info->var.xres / 8) + 8;
412 screen_size = (info->var.xres_virtual * info->var.yres_virtual) / 64;
415 info->var.xoffset = 0;
416 info->var.yoffset = 0;
417 info->var.activate = FB_ACTIVATE_NOW;
444 if (info->var.vmode & FB_VMODE_DOUBLE)
466 mode = svga_match_format(vt8623fb_formats, &(info->var), &(info->fix));
469 fb_dbg(info, "text mode\n");
475 fb_dbg(info, "4 bit pseudocolor\n");
481 fb_dbg(info, "4 bit pseudocolor, planar\n");
486 fb_dbg(info, "8 bit pseudocolor\n");
490 fb_dbg(info, "5/6/5 truecolor\n");
494 fb_dbg(info, "8/8/8 truecolor\n");
502 vt8623_set_pixclock(info, info->var.pixclock);
503 svga_set_timings(par->state.vgabase, &vt8623_timing_regs, &(info->var), 1, 1,
504 (info->var.vmode & FB_VMODE_DOUBLE) ? 2 : 1, 1,
505 1, info->node);
507 if (screen_size > info->screen_size)
508 screen_size = info->screen_size;
509 memset_io(info->screen_base, 0x00, screen_size);
575 static int vt8623fb_blank(int blank_mode, struct fb_info *info)
577 struct vt8623fb_info *par = info->par;
581 fb_dbg(info, "unblank\n");
586 fb_dbg(info, "blank\n");
591 fb_dbg(info, "DPMS standby (hsync off)\n");
596 fb_dbg(info, "DPMS suspend (vsync off)\n");
601 fb_dbg(info, "DPMS off (no sync)\n");
611 static int vt8623fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
613 struct vt8623fb_info *par = info->par;
617 if (info->var.bits_per_pixel == 0) {
618 offset = (var->yoffset / 16) * info->var.xres_virtual
622 offset = (var->yoffset * info->fix.line_length) +
623 (var->xoffset * info->var.bits_per_pixel / 8);
624 offset = offset >> ((info->var.bits_per_pixel == 4) ? 2 : 1);
661 struct fb_info *info;
673 info = framebuffer_alloc(sizeof(struct vt8623fb_info), &(dev->dev));
674 if (!info)
677 par = info->par;
680 info->flags = FBINFO_PARTIAL_PAN_OK | FBINFO_HWACCEL_YPAN;
681 info->fbops = &vt8623fb_ops;
687 dev_err(info->device, "cannot enable PCI device\n");
693 dev_err(info->device, "cannot reserve framebuffer region\n");
697 info->fix.smem_start = pci_resource_start(dev, 0);
698 info->fix.smem_len = pci_resource_len(dev, 0);
699 info->fix.mmio_start = pci_resource_start(dev, 1);
700 info->fix.mmio_len = pci_resource_len(dev, 1);
703 info->screen_base = pci_iomap_wc(dev, 0, 0);
704 if (! info->screen_base) {
706 dev_err(info->device, "iomap for framebuffer failed\n");
713 dev_err(info->device, "iomap for MMIO failed\n");
731 info->screen_size = memsize1 << 20;
733 dev_err(info->device, "memory size detection failed (%x %x), suppose 16 MB\n", memsize1, memsize2);
734 info->screen_size = 16 << 20;
737 info->fix.smem_len = info->screen_size;
738 strcpy(info->fix.id, "VIA VT8623");
739 info->fix.type = FB_TYPE_PACKED_PIXELS;
740 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
741 info->fix.ypanstep = 0;
742 info->fix.accel = FB_ACCEL_NONE;
743 info->pseudo_palette = (void*)par->pseudo_palette;
748 rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8);
752 dev_err(info->device, "mode %s not found\n", mode_option);
756 rc = fb_alloc_cmap(&info->cmap, 256, 0);
758 dev_err(info->device, "cannot allocate colormap\n");
762 rc = register_framebuffer(info);
764 dev_err(info->device, "cannot register framebuffer\n");
768 fb_info(info, "%s on %s, %d MB RAM\n",
769 info->fix.id, pci_name(dev), info->fix.smem_len >> 20);
772 pci_set_drvdata(dev, info);
775 par->wc_cookie = arch_phys_wc_add(info->fix.smem_start,
776 info->fix.smem_len);
782 fb_dealloc_cmap(&info->cmap);
787 pci_iounmap(dev, info->screen_base);
793 framebuffer_release(info);
801 struct fb_info *info = pci_get_drvdata(dev);
803 if (info) {
804 struct vt8623fb_info *par = info->par;
807 unregister_framebuffer(info);
808 fb_dealloc_cmap(&info->cmap);
810 pci_iounmap(dev, info->screen_base);
815 framebuffer_release(info);
824 struct fb_info *info = dev_get_drvdata(dev);
825 struct vt8623fb_info *par = info->par;
827 dev_info(info->device, "suspend\n");
838 fb_set_suspend(info, 1);
851 struct fb_info *info = dev_get_drvdata(dev);
852 struct vt8623fb_info *par = info->par;
854 dev_info(info->device, "resume\n");
862 vt8623fb_set_par(info);
863 fb_set_suspend(info, 0);