Lines Matching refs:info

247 static int s3fb_setup_ddc_bus(struct fb_info *info)  in s3fb_setup_ddc_bus()  argument
249 struct s3fb_info *par = info->par; in s3fb_setup_ddc_bus()
251 strlcpy(par->ddc_adapter.name, info->fix.id, in s3fb_setup_ddc_bus()
256 par->ddc_adapter.dev.parent = info->device; in s3fb_setup_ddc_bus()
290 static void s3fb_settile_fast(struct fb_info *info, struct fb_tilemap *map) in s3fb_settile_fast() argument
293 u8 __iomem *fb = (u8 __iomem *) info->screen_base; in s3fb_settile_fast()
298 fb_err(info, "unsupported font parameters: width %d, height %d, depth %d, length %d\n", in s3fb_settile_fast()
312 static void s3fb_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor) in s3fb_tilecursor() argument
314 struct s3fb_info *par = info->par; in s3fb_tilecursor()
316 svga_tilecursor(par->state.vgabase, info, cursor); in s3fb_tilecursor()
347 static void s3fb_iplan_imageblit(struct fb_info *info, const struct fb_image *image) in s3fb_iplan_imageblit() argument
358 dst1 = info->screen_base + (image->dy * info->fix.line_length) in s3fb_iplan_imageblit()
370 dst1 += info->fix.line_length; in s3fb_iplan_imageblit()
376 static void s3fb_iplan_fillrect(struct fb_info *info, const struct fb_fillrect *rect) in s3fb_iplan_fillrect() argument
383 dst1 = info->screen_base + (rect->dy * info->fix.line_length) in s3fb_iplan_fillrect()
391 dst1 += info->fix.line_length; in s3fb_iplan_fillrect()
404 static void s3fb_cfb4_imageblit(struct fb_info *info, const struct fb_image *image) in s3fb_cfb4_imageblit() argument
415 dst1 = info->screen_base + (image->dy * info->fix.line_length) in s3fb_cfb4_imageblit()
427 dst1 += info->fix.line_length; in s3fb_cfb4_imageblit()
431 static void s3fb_imageblit(struct fb_info *info, const struct fb_image *image) in s3fb_imageblit() argument
433 if ((info->var.bits_per_pixel == 4) && (image->depth == 1) in s3fb_imageblit()
435 if (info->fix.type == FB_TYPE_INTERLEAVED_PLANES) in s3fb_imageblit()
436 s3fb_iplan_imageblit(info, image); in s3fb_imageblit()
438 s3fb_cfb4_imageblit(info, image); in s3fb_imageblit()
440 cfb_imageblit(info, image); in s3fb_imageblit()
443 static void s3fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) in s3fb_fillrect() argument
445 if ((info->var.bits_per_pixel == 4) in s3fb_fillrect()
447 && (info->fix.type == FB_TYPE_INTERLEAVED_PLANES)) in s3fb_fillrect()
448 s3fb_iplan_fillrect(info, rect); in s3fb_fillrect()
450 cfb_fillrect(info, rect); in s3fb_fillrect()
458 static void s3_set_pixclock(struct fb_info *info, u32 pixclock) in s3_set_pixclock() argument
460 struct s3fb_info *par = info->par; in s3_set_pixclock()
466 1000000000 / pixclock, &m, &n, &r, info->node); in s3_set_pixclock()
468 fb_err(info, "cannot set requested pixclock, keeping old value\n"); in s3_set_pixclock()
501 static int s3fb_open(struct fb_info *info, int user) in s3fb_open() argument
503 struct s3fb_info *par = info->par; in s3fb_open()
525 static int s3fb_release(struct fb_info *info, int user) in s3fb_release() argument
527 struct s3fb_info *par = info->par; in s3fb_release()
546 static int s3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) in s3fb_check_var() argument
548 struct s3fb_info *par = info->par; in s3fb_check_var()
561 fb_err(info, "unsupported mode requested\n"); in s3fb_check_var()
578 if (mem > info->screen_size) { in s3fb_check_var()
579 fb_err(info, "not enough framebuffer memory (%d kB requested , %u kB available)\n", in s3fb_check_var()
580 mem >> 10, (unsigned int) (info->screen_size >> 10)); in s3fb_check_var()
584 rv = svga_check_timings (&s3_timing_regs, var, info->node); in s3fb_check_var()
586 fb_err(info, "invalid timings requested\n"); in s3fb_check_var()
591 info->node); in s3fb_check_var()
593 fb_err(info, "invalid pixclock value requested\n"); in s3fb_check_var()
602 static int s3fb_set_par(struct fb_info *info) in s3fb_set_par() argument
604 struct s3fb_info *par = info->par; in s3fb_set_par()
606 u32 bpp = info->var.bits_per_pixel; in s3fb_set_par()
610 info->fix.ypanstep = 1; in s3fb_set_par()
611 info->fix.line_length = (info->var.xres_virtual * bpp) / 8; in s3fb_set_par()
613 info->flags &= ~FBINFO_MISC_TILEBLITTING; in s3fb_set_par()
614 info->tileops = NULL; in s3fb_set_par()
617 info->pixmap.blit_x = (bpp == 4) ? (1 << (8 - 1)) : (~(u32)0); in s3fb_set_par()
618 info->pixmap.blit_y = ~(u32)0; in s3fb_set_par()
620 offset_value = (info->var.xres_virtual * bpp) / 64; in s3fb_set_par()
621 screen_size = info->var.yres_virtual * info->fix.line_length; in s3fb_set_par()
623 info->fix.ypanstep = 16; in s3fb_set_par()
624 info->fix.line_length = 0; in s3fb_set_par()
626 info->flags |= FBINFO_MISC_TILEBLITTING; in s3fb_set_par()
627 info->tileops = fasttext ? &s3fb_fast_tile_ops : &s3fb_tile_ops; in s3fb_set_par()
630 info->pixmap.blit_x = 1 << (8 - 1); in s3fb_set_par()
631 info->pixmap.blit_y = 1 << (16 - 1); in s3fb_set_par()
633 offset_value = info->var.xres_virtual / 16; in s3fb_set_par()
634 screen_size = (info->var.xres_virtual * info->var.yres_virtual) / 64; in s3fb_set_par()
637 info->var.xoffset = 0; in s3fb_set_par()
638 info->var.yoffset = 0; in s3fb_set_par()
639 info->var.activate = FB_ACTIVATE_NOW; in s3fb_set_par()
677 fb_dbg(info, "offset register : %d\n", offset_value); in s3fb_set_par()
695 if (info->var.vmode & FB_VMODE_DOUBLE) in s3fb_set_par()
700 if (info->var.vmode & FB_VMODE_INTERLACED) in s3fb_set_par()
710 mode = svga_match_format(s3fb_formats, &(info->var), &(info->fix)); in s3fb_set_par()
736 dbytes = info->var.xres * ((bpp+7)/8); in s3fb_set_par()
760 fb_dbg(info, "text mode\n"); in s3fb_set_par()
771 fb_dbg(info, "high speed text mode set\n"); in s3fb_set_par()
776 fb_dbg(info, "4 bit pseudocolor\n"); in s3fb_set_par()
787 fb_dbg(info, "4 bit pseudocolor, planar\n"); in s3fb_set_par()
797 fb_dbg(info, "8 bit pseudocolor\n"); in s3fb_set_par()
799 if (info->var.pixclock > 20000 || in s3fb_set_par()
813 fb_dbg(info, "5/5/5 truecolor\n"); in s3fb_set_par()
815 if (info->var.pixclock > 20000) in s3fb_set_par()
821 if (info->var.pixclock > 8695) { in s3fb_set_par()
841 fb_dbg(info, "5/6/5 truecolor\n"); in s3fb_set_par()
843 if (info->var.pixclock > 20000) in s3fb_set_par()
849 if (info->var.pixclock > 8695) { in s3fb_set_par()
870 fb_dbg(info, "8/8/8 truecolor\n"); in s3fb_set_par()
874 fb_dbg(info, "8/8/8/8 truecolor\n"); in s3fb_set_par()
879 fb_err(info, "unsupported mode - bug\n"); in s3fb_set_par()
888 s3_set_pixclock(info, info->var.pixclock); in s3fb_set_par()
889 svga_set_timings(par->state.vgabase, &s3_timing_regs, &(info->var), hmul, 1, in s3fb_set_par()
890 (info->var.vmode & FB_VMODE_DOUBLE) ? 2 : 1, in s3fb_set_par()
891 (info->var.vmode & FB_VMODE_INTERLACED) ? 2 : 1, in s3fb_set_par()
892 hmul, info->node); in s3fb_set_par()
895 htotal = info->var.xres + info->var.left_margin + info->var.right_margin + info->var.hsync_len; in s3fb_set_par()
900 hsstart = ((info->var.xres + info->var.right_margin) * hmul) / 8; in s3fb_set_par()
905 memset_io(info->screen_base, 0x00, screen_size); in s3fb_set_par()
976 static int s3fb_blank(int blank_mode, struct fb_info *info) in s3fb_blank() argument
978 struct s3fb_info *par = info->par; in s3fb_blank()
982 fb_dbg(info, "unblank\n"); in s3fb_blank()
987 fb_dbg(info, "blank\n"); in s3fb_blank()
992 fb_dbg(info, "hsync\n"); in s3fb_blank()
997 fb_dbg(info, "vsync\n"); in s3fb_blank()
1002 fb_dbg(info, "sync down\n"); in s3fb_blank()
1014 static int s3fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) in s3fb_pan_display() argument
1016 struct s3fb_info *par = info->par; in s3fb_pan_display()
1020 if (info->var.bits_per_pixel == 0) { in s3fb_pan_display()
1021 offset = (var->yoffset / 16) * (info->var.xres_virtual / 2) in s3fb_pan_display()
1025 offset = (var->yoffset * info->fix.line_length) + in s3fb_pan_display()
1026 (var->xoffset * info->var.bits_per_pixel / 8); in s3fb_pan_display()
1117 struct fb_info *info; in s3_pci_probe() local
1130 info = framebuffer_alloc(sizeof(struct s3fb_info), &(dev->dev)); in s3_pci_probe()
1131 if (!info) { in s3_pci_probe()
1136 par = info->par; in s3_pci_probe()
1139 info->flags = FBINFO_PARTIAL_PAN_OK | FBINFO_HWACCEL_YPAN; in s3_pci_probe()
1140 info->fbops = &s3fb_ops; in s3_pci_probe()
1145 dev_err(info->device, "cannot enable PCI device\n"); in s3_pci_probe()
1151 dev_err(info->device, "cannot reserve framebuffer region\n"); in s3_pci_probe()
1156 info->fix.smem_start = pci_resource_start(dev, 0); in s3_pci_probe()
1157 info->fix.smem_len = pci_resource_len(dev, 0); in s3_pci_probe()
1160 info->screen_base = pci_iomap_wc(dev, 0, 0); in s3_pci_probe()
1161 if (! info->screen_base) { in s3_pci_probe()
1163 dev_err(info->device, "iomap for framebuffer failed\n"); in s3_pci_probe()
1200 info->screen_size = 4 << 20; in s3_pci_probe()
1204 info->screen_size = 2 << 20; in s3_pci_probe()
1212 info->screen_size = 4 << 20; in s3_pci_probe()
1215 info->screen_size = 2 << 20; in s3_pci_probe()
1221 info->screen_size = 2 << 20; in s3_pci_probe()
1224 info->screen_size = 4 << 20; in s3_pci_probe()
1227 info->screen_size = 6 << 20; in s3_pci_probe()
1230 info->screen_size = 8 << 20; in s3_pci_probe()
1237 info->screen_size -= 4 << 20; in s3_pci_probe()
1240 info->screen_size -= 2 << 20; in s3_pci_probe()
1244 info->screen_size = s3_memsizes[regval >> 5] << 10; in s3_pci_probe()
1245 info->fix.smem_len = info->screen_size; in s3_pci_probe()
1256 strcpy(info->fix.id, s3_names [par->chip]); in s3_pci_probe()
1257 info->fix.mmio_start = 0; in s3_pci_probe()
1258 info->fix.mmio_len = 0; in s3_pci_probe()
1259 info->fix.type = FB_TYPE_PACKED_PIXELS; in s3_pci_probe()
1260 info->fix.visual = FB_VISUAL_PSEUDOCOLOR; in s3_pci_probe()
1261 info->fix.ypanstep = 0; in s3_pci_probe()
1262 info->fix.accel = FB_ACCEL_NONE; in s3_pci_probe()
1263 info->pseudo_palette = (void*) (par->pseudo_palette); in s3_pci_probe()
1264 info->var.bits_per_pixel = 8; in s3_pci_probe()
1269 par->mmio = ioremap(info->fix.smem_start + MMIO_OFFSET, MMIO_SIZE); in s3_pci_probe()
1273 dev_err(info->device, "unable to map MMIO at 0x%lx, disabling DDC", in s3_pci_probe()
1274 info->fix.smem_start + MMIO_OFFSET); in s3_pci_probe()
1277 if (s3fb_setup_ddc_bus(info) == 0) { in s3_pci_probe()
1281 fb_edid_to_monspecs(edid, &info->monspecs); in s3_pci_probe()
1283 if (!info->monspecs.modedb) in s3_pci_probe()
1284 dev_err(info->device, "error getting mode database\n"); in s3_pci_probe()
1288 fb_videomode_to_modelist(info->monspecs.modedb, in s3_pci_probe()
1289 info->monspecs.modedb_len, in s3_pci_probe()
1290 &info->modelist); in s3_pci_probe()
1291 m = fb_find_best_display(&info->monspecs, &info->modelist); in s3_pci_probe()
1293 fb_videomode_to_var(&info->var, m); in s3_pci_probe()
1295 if (s3fb_check_var(&info->var, info) == 0) in s3_pci_probe()
1307 rc = fb_find_mode(&info->var, info, mode_option, in s3_pci_probe()
1308 info->monspecs.modedb, info->monspecs.modedb_len, in s3_pci_probe()
1309 NULL, info->var.bits_per_pixel); in s3_pci_probe()
1312 dev_err(info->device, "mode %s not found\n", mode_option); in s3_pci_probe()
1313 fb_destroy_modedb(info->monspecs.modedb); in s3_pci_probe()
1314 info->monspecs.modedb = NULL; in s3_pci_probe()
1319 fb_destroy_modedb(info->monspecs.modedb); in s3_pci_probe()
1320 info->monspecs.modedb = NULL; in s3_pci_probe()
1323 info->var.yres_virtual = info->fix.smem_len * 8 / in s3_pci_probe()
1324 (info->var.bits_per_pixel * info->var.xres_virtual); in s3_pci_probe()
1325 if (info->var.yres_virtual < info->var.yres) { in s3_pci_probe()
1326 dev_err(info->device, "virtual vertical size smaller than real\n"); in s3_pci_probe()
1331 rc = fb_alloc_cmap(&info->cmap, 256, 0); in s3_pci_probe()
1333 dev_err(info->device, "cannot allocate colormap\n"); in s3_pci_probe()
1337 rc = register_framebuffer(info); in s3_pci_probe()
1339 dev_err(info->device, "cannot register framebuffer\n"); in s3_pci_probe()
1343 fb_info(info, "%s on %s, %d MB RAM, %d MHz MCLK\n", in s3_pci_probe()
1344 info->fix.id, pci_name(dev), in s3_pci_probe()
1345 info->fix.smem_len >> 20, (par->mclk_freq + 500) / 1000); in s3_pci_probe()
1348 fb_info(info, "unknown chip, CR2D=%x, CR2E=%x, CRT2F=%x, CRT30=%x\n", in s3_pci_probe()
1355 pci_set_drvdata(dev, info); in s3_pci_probe()
1358 par->wc_cookie = arch_phys_wc_add(info->fix.smem_start, in s3_pci_probe()
1359 info->fix.smem_len); in s3_pci_probe()
1365 fb_dealloc_cmap(&info->cmap); in s3_pci_probe()
1374 pci_iounmap(dev, info->screen_base); in s3_pci_probe()
1380 framebuffer_release(info); in s3_pci_probe()
1389 struct fb_info *info = pci_get_drvdata(dev); in s3_pci_remove() local
1392 if (info) { in s3_pci_remove()
1393 par = info->par; in s3_pci_remove()
1395 unregister_framebuffer(info); in s3_pci_remove()
1396 fb_dealloc_cmap(&info->cmap); in s3_pci_remove()
1405 pci_iounmap(dev, info->screen_base); in s3_pci_remove()
1409 framebuffer_release(info); in s3_pci_remove()
1417 struct fb_info *info = pci_get_drvdata(dev); in s3_pci_suspend() local
1418 struct s3fb_info *par = info->par; in s3_pci_suspend()
1420 dev_info(info->device, "suspend\n"); in s3_pci_suspend()
1431 fb_set_suspend(info, 1); in s3_pci_suspend()
1448 struct fb_info *info = pci_get_drvdata(dev); in s3_pci_resume() local
1449 struct s3fb_info *par = info->par; in s3_pci_resume()
1452 dev_info(info->device, "resume\n"); in s3_pci_resume()
1469 dev_err(info->device, "error %d enabling device for resume\n", err); in s3_pci_resume()
1474 s3fb_set_par(info); in s3_pci_resume()
1475 fb_set_suspend(info, 0); in s3_pci_resume()