Lines Matching refs:info
258 static int s3fb_setup_ddc_bus(struct fb_info *info) in s3fb_setup_ddc_bus() argument
260 struct s3fb_info *par = info->par; in s3fb_setup_ddc_bus()
262 strlcpy(par->ddc_adapter.name, info->fix.id, in s3fb_setup_ddc_bus()
267 par->ddc_adapter.dev.parent = info->device; in s3fb_setup_ddc_bus()
301 static void s3fb_settile_fast(struct fb_info *info, struct fb_tilemap *map) in s3fb_settile_fast() argument
304 u8 __iomem *fb = (u8 __iomem *) info->screen_base; in s3fb_settile_fast()
309 fb_err(info, "unsupported font parameters: width %d, height %d, depth %d, length %d\n", in s3fb_settile_fast()
323 static void s3fb_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor) in s3fb_tilecursor() argument
325 struct s3fb_info *par = info->par; in s3fb_tilecursor()
327 svga_tilecursor(par->state.vgabase, info, cursor); in s3fb_tilecursor()
358 static void s3fb_iplan_imageblit(struct fb_info *info, const struct fb_image *image) in s3fb_iplan_imageblit() argument
369 dst1 = info->screen_base + (image->dy * info->fix.line_length) in s3fb_iplan_imageblit()
381 dst1 += info->fix.line_length; in s3fb_iplan_imageblit()
387 static void s3fb_iplan_fillrect(struct fb_info *info, const struct fb_fillrect *rect) in s3fb_iplan_fillrect() argument
394 dst1 = info->screen_base + (rect->dy * info->fix.line_length) in s3fb_iplan_fillrect()
402 dst1 += info->fix.line_length; in s3fb_iplan_fillrect()
415 static void s3fb_cfb4_imageblit(struct fb_info *info, const struct fb_image *image) in s3fb_cfb4_imageblit() argument
426 dst1 = info->screen_base + (image->dy * info->fix.line_length) in s3fb_cfb4_imageblit()
438 dst1 += info->fix.line_length; in s3fb_cfb4_imageblit()
442 static void s3fb_imageblit(struct fb_info *info, const struct fb_image *image) in s3fb_imageblit() argument
444 if ((info->var.bits_per_pixel == 4) && (image->depth == 1) in s3fb_imageblit()
446 if (info->fix.type == FB_TYPE_INTERLEAVED_PLANES) in s3fb_imageblit()
447 s3fb_iplan_imageblit(info, image); in s3fb_imageblit()
449 s3fb_cfb4_imageblit(info, image); in s3fb_imageblit()
451 cfb_imageblit(info, image); in s3fb_imageblit()
454 static void s3fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) in s3fb_fillrect() argument
456 if ((info->var.bits_per_pixel == 4) in s3fb_fillrect()
458 && (info->fix.type == FB_TYPE_INTERLEAVED_PLANES)) in s3fb_fillrect()
459 s3fb_iplan_fillrect(info, rect); in s3fb_fillrect()
461 cfb_fillrect(info, rect); in s3fb_fillrect()
469 static void s3_set_pixclock(struct fb_info *info, u32 pixclock) in s3_set_pixclock() argument
471 struct s3fb_info *par = info->par; in s3_set_pixclock()
477 1000000000 / pixclock, &m, &n, &r, info->node); in s3_set_pixclock()
479 fb_err(info, "cannot set requested pixclock, keeping old value\n"); in s3_set_pixclock()
512 static int s3fb_open(struct fb_info *info, int user) in s3fb_open() argument
514 struct s3fb_info *par = info->par; in s3fb_open()
536 static int s3fb_release(struct fb_info *info, int user) in s3fb_release() argument
538 struct s3fb_info *par = info->par; in s3fb_release()
557 static int s3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) in s3fb_check_var() argument
559 struct s3fb_info *par = info->par; in s3fb_check_var()
572 fb_err(info, "unsupported mode requested\n"); in s3fb_check_var()
589 if (mem > info->screen_size) { in s3fb_check_var()
590 fb_err(info, "not enough framebuffer memory (%d kB requested , %u kB available)\n", in s3fb_check_var()
591 mem >> 10, (unsigned int) (info->screen_size >> 10)); in s3fb_check_var()
595 rv = svga_check_timings (&s3_timing_regs, var, info->node); in s3fb_check_var()
597 fb_err(info, "invalid timings requested\n"); in s3fb_check_var()
602 info->node); in s3fb_check_var()
604 fb_err(info, "invalid pixclock value requested\n"); in s3fb_check_var()
613 static int s3fb_set_par(struct fb_info *info) in s3fb_set_par() argument
615 struct s3fb_info *par = info->par; in s3fb_set_par()
617 u32 bpp = info->var.bits_per_pixel; in s3fb_set_par()
621 info->fix.ypanstep = 1; in s3fb_set_par()
622 info->fix.line_length = (info->var.xres_virtual * bpp) / 8; in s3fb_set_par()
624 info->flags &= ~FBINFO_MISC_TILEBLITTING; in s3fb_set_par()
625 info->tileops = NULL; in s3fb_set_par()
628 info->pixmap.blit_x = (bpp == 4) ? (1 << (8 - 1)) : (~(u32)0); in s3fb_set_par()
629 info->pixmap.blit_y = ~(u32)0; in s3fb_set_par()
631 offset_value = (info->var.xres_virtual * bpp) / 64; in s3fb_set_par()
632 screen_size = info->var.yres_virtual * info->fix.line_length; in s3fb_set_par()
634 info->fix.ypanstep = 16; in s3fb_set_par()
635 info->fix.line_length = 0; in s3fb_set_par()
637 info->flags |= FBINFO_MISC_TILEBLITTING; in s3fb_set_par()
638 info->tileops = fasttext ? &s3fb_fast_tile_ops : &s3fb_tile_ops; in s3fb_set_par()
641 info->pixmap.blit_x = 1 << (8 - 1); in s3fb_set_par()
642 info->pixmap.blit_y = 1 << (16 - 1); in s3fb_set_par()
644 offset_value = info->var.xres_virtual / 16; in s3fb_set_par()
645 screen_size = (info->var.xres_virtual * info->var.yres_virtual) / 64; in s3fb_set_par()
648 info->var.xoffset = 0; in s3fb_set_par()
649 info->var.yoffset = 0; in s3fb_set_par()
650 info->var.activate = FB_ACTIVATE_NOW; in s3fb_set_par()
688 fb_dbg(info, "offset register : %d\n", offset_value); in s3fb_set_par()
706 if (info->var.vmode & FB_VMODE_DOUBLE) in s3fb_set_par()
711 if (info->var.vmode & FB_VMODE_INTERLACED) in s3fb_set_par()
721 mode = svga_match_format(s3fb_formats, &(info->var), &(info->fix)); in s3fb_set_par()
747 dbytes = info->var.xres * ((bpp+7)/8); in s3fb_set_par()
771 fb_dbg(info, "text mode\n"); in s3fb_set_par()
782 fb_dbg(info, "high speed text mode set\n"); in s3fb_set_par()
787 fb_dbg(info, "4 bit pseudocolor\n"); in s3fb_set_par()
798 fb_dbg(info, "4 bit pseudocolor, planar\n"); in s3fb_set_par()
808 fb_dbg(info, "8 bit pseudocolor\n"); in s3fb_set_par()
810 if (info->var.pixclock > 20000 || in s3fb_set_par()
824 fb_dbg(info, "5/5/5 truecolor\n"); in s3fb_set_par()
826 if (info->var.pixclock > 20000) in s3fb_set_par()
832 if (info->var.pixclock > 8695) { in s3fb_set_par()
852 fb_dbg(info, "5/6/5 truecolor\n"); in s3fb_set_par()
854 if (info->var.pixclock > 20000) in s3fb_set_par()
860 if (info->var.pixclock > 8695) { in s3fb_set_par()
881 fb_dbg(info, "8/8/8 truecolor\n"); in s3fb_set_par()
885 fb_dbg(info, "8/8/8/8 truecolor\n"); in s3fb_set_par()
890 fb_err(info, "unsupported mode - bug\n"); in s3fb_set_par()
899 s3_set_pixclock(info, info->var.pixclock); in s3fb_set_par()
900 svga_set_timings(par->state.vgabase, &s3_timing_regs, &(info->var), hmul, 1, in s3fb_set_par()
901 (info->var.vmode & FB_VMODE_DOUBLE) ? 2 : 1, in s3fb_set_par()
902 (info->var.vmode & FB_VMODE_INTERLACED) ? 2 : 1, in s3fb_set_par()
903 hmul, info->node); in s3fb_set_par()
906 htotal = info->var.xres + info->var.left_margin + info->var.right_margin + info->var.hsync_len; in s3fb_set_par()
911 hsstart = ((info->var.xres + info->var.right_margin) * hmul) / 8; in s3fb_set_par()
916 memset_io(info->screen_base, 0x00, screen_size); in s3fb_set_par()
987 static int s3fb_blank(int blank_mode, struct fb_info *info) in s3fb_blank() argument
989 struct s3fb_info *par = info->par; in s3fb_blank()
993 fb_dbg(info, "unblank\n"); in s3fb_blank()
998 fb_dbg(info, "blank\n"); in s3fb_blank()
1003 fb_dbg(info, "hsync\n"); in s3fb_blank()
1008 fb_dbg(info, "vsync\n"); in s3fb_blank()
1013 fb_dbg(info, "sync down\n"); in s3fb_blank()
1025 static int s3fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) in s3fb_pan_display() argument
1027 struct s3fb_info *par = info->par; in s3fb_pan_display()
1031 if (info->var.bits_per_pixel == 0) { in s3fb_pan_display()
1032 offset = (var->yoffset / 16) * (info->var.xres_virtual / 2) in s3fb_pan_display()
1036 offset = (var->yoffset * info->fix.line_length) + in s3fb_pan_display()
1037 (var->xoffset * info->var.bits_per_pixel / 8); in s3fb_pan_display()
1128 struct fb_info *info; in s3_pci_probe() local
1141 info = framebuffer_alloc(sizeof(struct s3fb_info), &(dev->dev)); in s3_pci_probe()
1142 if (!info) { in s3_pci_probe()
1147 par = info->par; in s3_pci_probe()
1150 info->flags = FBINFO_PARTIAL_PAN_OK | FBINFO_HWACCEL_YPAN; in s3_pci_probe()
1151 info->fbops = &s3fb_ops; in s3_pci_probe()
1156 dev_err(info->device, "cannot enable PCI device\n"); in s3_pci_probe()
1162 dev_err(info->device, "cannot reserve framebuffer region\n"); in s3_pci_probe()
1167 info->fix.smem_start = pci_resource_start(dev, 0); in s3_pci_probe()
1168 info->fix.smem_len = pci_resource_len(dev, 0); in s3_pci_probe()
1171 info->screen_base = pci_iomap(dev, 0, 0); in s3_pci_probe()
1172 if (! info->screen_base) { in s3_pci_probe()
1174 dev_err(info->device, "iomap for framebuffer failed\n"); in s3_pci_probe()
1211 info->screen_size = 4 << 20; in s3_pci_probe()
1215 info->screen_size = 2 << 20; in s3_pci_probe()
1223 info->screen_size = 4 << 20; in s3_pci_probe()
1226 info->screen_size = 2 << 20; in s3_pci_probe()
1232 info->screen_size = 2 << 20; in s3_pci_probe()
1235 info->screen_size = 4 << 20; in s3_pci_probe()
1238 info->screen_size = 6 << 20; in s3_pci_probe()
1241 info->screen_size = 8 << 20; in s3_pci_probe()
1248 info->screen_size -= 4 << 20; in s3_pci_probe()
1251 info->screen_size -= 2 << 20; in s3_pci_probe()
1255 info->screen_size = s3_memsizes[regval >> 5] << 10; in s3_pci_probe()
1256 info->fix.smem_len = info->screen_size; in s3_pci_probe()
1267 strcpy(info->fix.id, s3_names [par->chip]); in s3_pci_probe()
1268 info->fix.mmio_start = 0; in s3_pci_probe()
1269 info->fix.mmio_len = 0; in s3_pci_probe()
1270 info->fix.type = FB_TYPE_PACKED_PIXELS; in s3_pci_probe()
1271 info->fix.visual = FB_VISUAL_PSEUDOCOLOR; in s3_pci_probe()
1272 info->fix.ypanstep = 0; in s3_pci_probe()
1273 info->fix.accel = FB_ACCEL_NONE; in s3_pci_probe()
1274 info->pseudo_palette = (void*) (par->pseudo_palette); in s3_pci_probe()
1275 info->var.bits_per_pixel = 8; in s3_pci_probe()
1280 par->mmio = ioremap(info->fix.smem_start + MMIO_OFFSET, MMIO_SIZE); in s3_pci_probe()
1284 dev_err(info->device, "unable to map MMIO at 0x%lx, disabling DDC", in s3_pci_probe()
1285 info->fix.smem_start + MMIO_OFFSET); in s3_pci_probe()
1288 if (s3fb_setup_ddc_bus(info) == 0) { in s3_pci_probe()
1292 fb_edid_to_monspecs(edid, &info->monspecs); in s3_pci_probe()
1294 if (!info->monspecs.modedb) in s3_pci_probe()
1295 dev_err(info->device, "error getting mode database\n"); in s3_pci_probe()
1299 fb_videomode_to_modelist(info->monspecs.modedb, in s3_pci_probe()
1300 info->monspecs.modedb_len, in s3_pci_probe()
1301 &info->modelist); in s3_pci_probe()
1302 m = fb_find_best_display(&info->monspecs, &info->modelist); in s3_pci_probe()
1304 fb_videomode_to_var(&info->var, m); in s3_pci_probe()
1306 if (s3fb_check_var(&info->var, info) == 0) in s3_pci_probe()
1318 rc = fb_find_mode(&info->var, info, mode_option, in s3_pci_probe()
1319 info->monspecs.modedb, info->monspecs.modedb_len, in s3_pci_probe()
1320 NULL, info->var.bits_per_pixel); in s3_pci_probe()
1323 dev_err(info->device, "mode %s not found\n", mode_option); in s3_pci_probe()
1324 fb_destroy_modedb(info->monspecs.modedb); in s3_pci_probe()
1325 info->monspecs.modedb = NULL; in s3_pci_probe()
1330 fb_destroy_modedb(info->monspecs.modedb); in s3_pci_probe()
1331 info->monspecs.modedb = NULL; in s3_pci_probe()
1334 info->var.yres_virtual = info->fix.smem_len * 8 / in s3_pci_probe()
1335 (info->var.bits_per_pixel * info->var.xres_virtual); in s3_pci_probe()
1336 if (info->var.yres_virtual < info->var.yres) { in s3_pci_probe()
1337 dev_err(info->device, "virtual vertical size smaller than real\n"); in s3_pci_probe()
1342 rc = fb_alloc_cmap(&info->cmap, 256, 0); in s3_pci_probe()
1344 dev_err(info->device, "cannot allocate colormap\n"); in s3_pci_probe()
1348 rc = register_framebuffer(info); in s3_pci_probe()
1350 dev_err(info->device, "cannot register framebuffer\n"); in s3_pci_probe()
1354 fb_info(info, "%s on %s, %d MB RAM, %d MHz MCLK\n", in s3_pci_probe()
1355 info->fix.id, pci_name(dev), in s3_pci_probe()
1356 info->fix.smem_len >> 20, (par->mclk_freq + 500) / 1000); in s3_pci_probe()
1359 fb_info(info, "unknown chip, CR2D=%x, CR2E=%x, CRT2F=%x, CRT30=%x\n", in s3_pci_probe()
1366 pci_set_drvdata(dev, info); in s3_pci_probe()
1371 par->mtrr_reg = mtrr_add(info->fix.smem_start, info->fix.smem_len, MTRR_TYPE_WRCOMB, 1); in s3_pci_probe()
1379 fb_dealloc_cmap(&info->cmap); in s3_pci_probe()
1388 pci_iounmap(dev, info->screen_base); in s3_pci_probe()
1394 framebuffer_release(info); in s3_pci_probe()
1403 struct fb_info *info = pci_get_drvdata(dev); in s3_pci_remove() local
1406 if (info) { in s3_pci_remove()
1407 par = info->par; in s3_pci_remove()
1416 unregister_framebuffer(info); in s3_pci_remove()
1417 fb_dealloc_cmap(&info->cmap); in s3_pci_remove()
1426 pci_iounmap(dev, info->screen_base); in s3_pci_remove()
1430 framebuffer_release(info); in s3_pci_remove()
1438 struct fb_info *info = pci_get_drvdata(dev); in s3_pci_suspend() local
1439 struct s3fb_info *par = info->par; in s3_pci_suspend()
1441 dev_info(info->device, "suspend\n"); in s3_pci_suspend()
1452 fb_set_suspend(info, 1); in s3_pci_suspend()
1469 struct fb_info *info = pci_get_drvdata(dev); in s3_pci_resume() local
1470 struct s3fb_info *par = info->par; in s3_pci_resume()
1473 dev_info(info->device, "resume\n"); in s3_pci_resume()
1490 dev_err(info->device, "error %d enabling device for resume\n", err); in s3_pci_resume()
1495 s3fb_set_par(info); in s3_pci_resume()
1496 fb_set_suspend(info, 0); in s3_pci_resume()