Lines Matching +full:col +full:- +full:offset
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright 2001, 2002 - Jani Monoses <jani@iv.ro>
31 #include <linux/i2c-algo-bit.h>
80 MODULE_PARM_DESC(mode_option, "Initial video mode e.g. '648x480-8@60'");
82 MODULE_PARM_DESC(mode, "Initial video mode e.g. '648x480-8@60' (deprecated)");
167 fb_writeb(val, p->io_virt + reg); in t_outb()
172 return fb_readb(p->io_virt + reg); in t_inb()
177 fb_writel(v, par->io_virt + r); in writemmr()
182 return fb_readl(par->io_virt + r); in readmmr()
194 u8 reg = vga_mm_rcrt(par->io_virt, I2C) & DDC_MASK_TGUI; in tridentfb_ddc_setscl_tgui()
197 reg &= ~DDC_SCL_DRIVE_TGUI; /* disable drive - don't drive hi */ in tridentfb_ddc_setscl_tgui()
201 vga_mm_wcrt(par->io_virt, I2C, reg); in tridentfb_ddc_setscl_tgui()
207 u8 reg = vga_mm_rcrt(par->io_virt, I2C) & DDC_MASK_TGUI; in tridentfb_ddc_setsda_tgui()
210 reg &= ~DDC_SDA_DRIVE_TGUI; /* disable drive - don't drive hi */ in tridentfb_ddc_setsda_tgui()
214 vga_mm_wcrt(par->io_virt, I2C, reg); in tridentfb_ddc_setsda_tgui()
221 return !!(vga_mm_rcrt(par->io_virt, I2C) & DDC_SDA_TGUI); in tridentfb_ddc_getsda_tgui()
235 reg = vga_mm_rcrt(par->io_virt, I2C) & DDC_MASK; in tridentfb_ddc_setscl()
240 vga_mm_wcrt(par->io_virt, I2C, reg); in tridentfb_ddc_setscl()
248 reg = vga_mm_rcrt(par->io_virt, I2C) & DDC_MASK; in tridentfb_ddc_setsda()
253 vga_mm_wcrt(par->io_virt, I2C, reg); in tridentfb_ddc_setsda()
260 return !!(vga_mm_rcrt(par->io_virt, I2C) & DDC_SCL_IN); in tridentfb_ddc_getscl()
267 return !!(vga_mm_rcrt(par->io_virt, I2C) & DDC_SDA_IN); in tridentfb_ddc_getsda()
272 struct tridentfb_par *par = info->par; in tridentfb_setup_ddc_bus()
274 strscpy(par->ddc_adapter.name, info->fix.id, in tridentfb_setup_ddc_bus()
275 sizeof(par->ddc_adapter.name)); in tridentfb_setup_ddc_bus()
276 par->ddc_adapter.owner = THIS_MODULE; in tridentfb_setup_ddc_bus()
277 par->ddc_adapter.class = I2C_CLASS_DDC; in tridentfb_setup_ddc_bus()
278 par->ddc_adapter.algo_data = &par->ddc_algo; in tridentfb_setup_ddc_bus()
279 par->ddc_adapter.dev.parent = info->device; in tridentfb_setup_ddc_bus()
280 if (is_oldclock(par->chip_id)) { /* not sure if this check is OK */ in tridentfb_setup_ddc_bus()
281 par->ddc_algo.setsda = tridentfb_ddc_setsda_tgui; in tridentfb_setup_ddc_bus()
282 par->ddc_algo.setscl = tridentfb_ddc_setscl_tgui; in tridentfb_setup_ddc_bus()
283 par->ddc_algo.getsda = tridentfb_ddc_getsda_tgui; in tridentfb_setup_ddc_bus()
286 par->ddc_algo.setsda = tridentfb_ddc_setsda; in tridentfb_setup_ddc_bus()
287 par->ddc_algo.setscl = tridentfb_ddc_setscl; in tridentfb_setup_ddc_bus()
288 par->ddc_algo.getsda = tridentfb_ddc_getsda; in tridentfb_setup_ddc_bus()
289 par->ddc_algo.getscl = tridentfb_ddc_getscl; in tridentfb_setup_ddc_bus()
291 par->ddc_algo.udelay = 10; in tridentfb_setup_ddc_bus()
292 par->ddc_algo.timeout = 20; in tridentfb_setup_ddc_bus()
293 par->ddc_algo.data = par; in tridentfb_setup_ddc_bus()
295 i2c_set_adapdata(&par->ddc_adapter, par); in tridentfb_setup_ddc_bus()
297 return i2c_bit_add_bus(&par->ddc_adapter); in tridentfb_setup_ddc_bus()
337 writemmr(par, DST2, point(x + w - 1, y + h - 1)); in blade_fill_rect()
350 writemmr(par, DST2, point(x + w - 1, y + h - 1)); in blade_image_blit()
352 iowrite32_rep(par->io_virt + 0x10000, data, size); in blade_image_blit()
360 u32 s2 = point(x1 + w - 1, y1 + h - 1); in blade_copy_rect()
362 u32 d2 = point(x2 + w - 1, y2 + h - 1); in blade_copy_rect()
403 par->eng_oper = x | 0x40; in xp_init_accel()
440 t_outb(par, par->eng_oper, 0x2125); in xp_fill_rect()
451 x1_tmp = x1 + w - 1; in xp_copy_rect()
452 x2_tmp = x2 + w - 1; in xp_copy_rect()
460 y1_tmp = y1 + h - 1; in xp_copy_rect()
461 y2_tmp = y2 + h - 1; in xp_copy_rect()
512 writemmr(par, DST2, point(x + w - 1, y + h - 1)); in image_fill_rect()
522 u32 s2 = point(x1 + w - 1, y1 + h - 1); in image_copy_rect()
524 u32 d2 = point(x2 + w - 1, y2 + h - 1); in image_copy_rect()
568 fb_writew(x, par->io_virt + 0x2122); in tgui_init_accel()
577 writemmr(par, OLDDIM, point(w - 1, h - 1)); in tgui_fill_rect()
590 x1_tmp = x1 + w - 1; in tgui_copy_rect()
591 x2_tmp = x2 + w - 1; in tgui_copy_rect()
599 y1_tmp = y1 + h - 1; in tgui_copy_rect()
600 y2_tmp = y2 + h - 1; in tgui_copy_rect()
610 writemmr(par, OLDDIM, point(w - 1, h - 1)); in tgui_copy_rect()
620 struct tridentfb_par *par = info->par; in tridentfb_fillrect()
621 int col; in tridentfb_fillrect() local
623 if (info->flags & FBINFO_HWACCEL_DISABLED) { in tridentfb_fillrect()
627 if (info->var.bits_per_pixel == 8) { in tridentfb_fillrect()
628 col = fr->color; in tridentfb_fillrect()
629 col |= col << 8; in tridentfb_fillrect()
630 col |= col << 16; in tridentfb_fillrect()
632 col = ((u32 *)(info->pseudo_palette))[fr->color]; in tridentfb_fillrect()
634 par->wait_engine(par); in tridentfb_fillrect()
635 par->fill_rect(par, fr->dx, fr->dy, fr->width, in tridentfb_fillrect()
636 fr->height, col, fr->rop); in tridentfb_fillrect()
642 struct tridentfb_par *par = info->par; in tridentfb_imageblit()
643 int col, bgcol; in tridentfb_imageblit() local
645 if ((info->flags & FBINFO_HWACCEL_DISABLED) || img->depth != 1) { in tridentfb_imageblit()
649 if (info->var.bits_per_pixel == 8) { in tridentfb_imageblit()
650 col = img->fg_color; in tridentfb_imageblit()
651 col |= col << 8; in tridentfb_imageblit()
652 col |= col << 16; in tridentfb_imageblit()
653 bgcol = img->bg_color; in tridentfb_imageblit()
657 col = ((u32 *)(info->pseudo_palette))[img->fg_color]; in tridentfb_imageblit()
658 bgcol = ((u32 *)(info->pseudo_palette))[img->bg_color]; in tridentfb_imageblit()
661 par->wait_engine(par); in tridentfb_imageblit()
662 if (par->image_blit) in tridentfb_imageblit()
663 par->image_blit(par, img->data, img->dx, img->dy, in tridentfb_imageblit()
664 img->width, img->height, col, bgcol); in tridentfb_imageblit()
672 struct tridentfb_par *par = info->par; in tridentfb_copyarea()
674 if (info->flags & FBINFO_HWACCEL_DISABLED) { in tridentfb_copyarea()
678 par->wait_engine(par); in tridentfb_copyarea()
679 par->copy_rect(par, ca->sx, ca->sy, ca->dx, ca->dy, in tridentfb_copyarea()
680 ca->width, ca->height); in tridentfb_copyarea()
685 struct tridentfb_par *par = info->par; in tridentfb_sync()
687 if (!(info->flags & FBINFO_HWACCEL_DISABLED)) in tridentfb_sync()
688 par->wait_engine(par); in tridentfb_sync()
698 return vga_mm_rcrt(par->io_virt, reg); in read3X4()
704 vga_mm_wcrt(par->io_virt, reg, val); in write3X4()
710 return vga_mm_rgfx(par->io_virt, reg); in read3CE()
716 fb_readb(par->io_virt + VGA_IS1_RC); /* flip-flop to index */ in writeAttr()
717 vga_mm_wattr(par->io_virt, reg, val); in writeAttr()
723 vga_mm_wgfx(par->io_virt, reg, val); in write3CE()
733 if (!is_oldprotect(par->chip_id)) in enable_mmio()
744 vga_mm_rseq(par->io_virt, 0x0B); in disable_mmio()
747 vga_mm_wseq(par->io_virt, NewMode1, 0x80); in disable_mmio()
748 if (!is_oldprotect(par->chip_id)) in disable_mmio()
749 vga_mm_wseq(par->io_virt, Protection, 0x92); in disable_mmio()
798 if (par->chip_id == TGUI9440 || par->chip_id == CYBER9320) in set_lwidth()
809 if (par->chip_id != CYBERBLADEXPAi1) in screen_stretch()
843 unsigned char shift = !is_oldclock(par->chip_id) ? 2 : 1; in set_vclk()
846 for (k = shift; k >= 0; k--) in set_vclk()
848 n = ((m + 2) << shift) - 8; in set_vclk()
851 di = abs(fi - freq); in set_vclk()
863 if (is_oldclock(par->chip_id)) { in set_vclk()
871 if (is3Dchip(par->chip_id)) { in set_vclk()
872 vga_mm_wseq(par->io_virt, ClockHigh, hi); in set_vclk()
873 vga_mm_wseq(par->io_virt, ClockLow, lo); in set_vclk()
904 if (crt || !iscyber(par->chip_id)) in is_flatpanel()
919 switch (par->chip_id) { in get_memsize()
956 tmp2 = vga_mm_rseq(par->io_virt, 0xC1); in get_memsize()
985 k -= memdiff * Kb; in get_memsize()
994 struct tridentfb_par *par = info->par; in tridentfb_check_var()
995 int bpp = var->bits_per_pixel; in tridentfb_check_var()
1000 if (!var->pixclock) in tridentfb_check_var()
1001 return -EINVAL; in tridentfb_check_var()
1005 bpp = var->bits_per_pixel = 32; in tridentfb_check_var()
1007 return -EINVAL; in tridentfb_check_var()
1008 if (par->chip_id == TGUI9440 && bpp == 32) in tridentfb_check_var()
1009 return -EINVAL; in tridentfb_check_var()
1011 if (par->flatpanel && nativex && var->xres > nativex) in tridentfb_check_var()
1012 return -EINVAL; in tridentfb_check_var()
1014 var->xres = (var->xres + 7) & ~0x7; in tridentfb_check_var()
1015 if (var->xres > var->xres_virtual) in tridentfb_check_var()
1016 var->xres_virtual = var->xres; in tridentfb_check_var()
1017 if (var->yres > var->yres_virtual) in tridentfb_check_var()
1018 var->yres_virtual = var->yres; in tridentfb_check_var()
1019 if (var->xres_virtual > 4095 || var->yres > 2048) in tridentfb_check_var()
1020 return -EINVAL; in tridentfb_check_var()
1022 if (var->yres_virtual > 0xffff) in tridentfb_check_var()
1023 return -EINVAL; in tridentfb_check_var()
1024 line_length = var->xres_virtual * bpp / 8; in tridentfb_check_var()
1026 if (!is3Dchip(par->chip_id) && in tridentfb_check_var()
1027 !(info->flags & FBINFO_HWACCEL_DISABLED)) { in tridentfb_check_var()
1030 var->xres_virtual = 512 * 8 / bpp; in tridentfb_check_var()
1032 var->xres_virtual = 1024 * 8 / bpp; in tridentfb_check_var()
1034 var->xres_virtual = 2048 * 8 / bpp; in tridentfb_check_var()
1036 var->xres_virtual = 4096 * 8 / bpp; in tridentfb_check_var()
1038 var->xres_virtual = 8192 * 8 / bpp; in tridentfb_check_var()
1040 return -EINVAL; in tridentfb_check_var()
1042 line_length = var->xres_virtual * bpp / 8; in tridentfb_check_var()
1046 if (line_length * (var->yres_virtual - var->yres) > (4 << 20)) in tridentfb_check_var()
1047 var->yres_virtual = ((4 << 20) / line_length) + var->yres; in tridentfb_check_var()
1049 if (line_length * var->yres_virtual > info->fix.smem_len) in tridentfb_check_var()
1050 return -EINVAL; in tridentfb_check_var()
1054 var->red.offset = 0; in tridentfb_check_var()
1055 var->red.length = 8; in tridentfb_check_var()
1056 var->green = var->red; in tridentfb_check_var()
1057 var->blue = var->red; in tridentfb_check_var()
1060 var->red.offset = 11; in tridentfb_check_var()
1061 var->green.offset = 5; in tridentfb_check_var()
1062 var->blue.offset = 0; in tridentfb_check_var()
1063 var->red.length = 5; in tridentfb_check_var()
1064 var->green.length = 6; in tridentfb_check_var()
1065 var->blue.length = 5; in tridentfb_check_var()
1068 var->red.offset = 16; in tridentfb_check_var()
1069 var->green.offset = 8; in tridentfb_check_var()
1070 var->blue.offset = 0; in tridentfb_check_var()
1071 var->red.length = 8; in tridentfb_check_var()
1072 var->green.length = 8; in tridentfb_check_var()
1073 var->blue.length = 8; in tridentfb_check_var()
1076 return -EINVAL; in tridentfb_check_var()
1079 if (is_xp(par->chip_id)) in tridentfb_check_var()
1082 switch (par->chip_id) { in tridentfb_check_var()
1102 if (PICOS2KHZ(var->pixclock) > ramdac) in tridentfb_check_var()
1103 return -EINVAL; in tridentfb_check_var()
1115 struct tridentfb_par *par = info->par; in tridentfb_pan_display()
1116 unsigned int offset; in tridentfb_pan_display() local
1119 offset = (var->xoffset + (var->yoffset * info->var.xres_virtual)) in tridentfb_pan_display()
1120 * info->var.bits_per_pixel / 32; in tridentfb_pan_display()
1121 set_screen_start(par, offset); in tridentfb_pan_display()
1134 struct tridentfb_par *par = info->par; in tridentfb_set_par()
1137 struct fb_var_screeninfo *var = &info->var; in tridentfb_set_par()
1138 int bpp = var->bits_per_pixel; in tridentfb_set_par()
1143 hdispend = var->xres / 8 - 1; in tridentfb_set_par()
1144 hsyncstart = (var->xres + var->right_margin) / 8; in tridentfb_set_par()
1145 hsyncend = (var->xres + var->right_margin + var->hsync_len) / 8; in tridentfb_set_par()
1146 htotal = (var->xres + var->left_margin + var->right_margin + in tridentfb_set_par()
1147 var->hsync_len) / 8 - 5; in tridentfb_set_par()
1151 vdispend = var->yres - 1; in tridentfb_set_par()
1152 vsyncstart = var->yres + var->lower_margin; in tridentfb_set_par()
1153 vsyncend = vsyncstart + var->vsync_len; in tridentfb_set_par()
1154 vtotal = var->upper_margin + vsyncend - 2; in tridentfb_set_par()
1158 if (info->var.vmode & FB_VMODE_INTERLACED) { in tridentfb_set_par()
1171 if (var->sync & FB_SYNC_HOR_HIGH_ACT) in tridentfb_set_par()
1173 if (var->sync & FB_SYNC_VERT_HIGH_ACT) in tridentfb_set_par()
1176 if (par->flatpanel && var->xres < nativex) { in tridentfb_set_par()
1241 //FIXME if (info->var.vmode & FB_VMODE_DOUBLE) tmp |= 0x80; /* double scan for 200 line modes */ in tridentfb_set_par()
1250 tmp = (info->var.vmode & FB_VMODE_INTERLACED) ? 0x84 : 0x80; in tridentfb_set_par()
1254 if (info->var.vmode & FB_VMODE_INTERLACED) in tridentfb_set_par()
1279 if (!is_oldprotect(par->chip_id)) in tridentfb_set_par()
1281 if (iscyber(par->chip_id)) in tridentfb_set_par()
1286 if (!is_xp(par->chip_id)) in tridentfb_set_par()
1289 if (par->chip_id != TGUI9440 && par->chip_id != IMAGE975) in tridentfb_set_par()
1292 vga_mm_wseq(par->io_virt, 0, 3); in tridentfb_set_par()
1293 vga_mm_wseq(par->io_virt, 1, 1); /* set char clock 8 dots wide */ in tridentfb_set_par()
1295 vga_mm_wseq(par->io_virt, 2, 0x0F); in tridentfb_set_par()
1296 vga_mm_wseq(par->io_virt, 3, 0); in tridentfb_set_par()
1297 vga_mm_wseq(par->io_virt, 4, 0x0E); /* memory mode enable bitmaps ?? */ in tridentfb_set_par()
1300 vclk = PICOS2KHZ(info->var.pixclock); in tridentfb_set_par()
1304 if (bpp == 32 || (par->chip_id == TGUI9440 && bpp == 16)) { in tridentfb_set_par()
1310 write3CE(par, 0x5, 0x40); /* no CGA compat, allow 256 col */ in tridentfb_set_par()
1322 fb_readb(par->io_virt + VGA_IS1_RC); /* flip-flop to index */ in tridentfb_set_par()
1346 if (par->flatpanel) in tridentfb_set_par()
1347 set_number_of_lines(par, info->var.yres); in tridentfb_set_par()
1348 info->fix.line_length = info->var.xres_virtual * bpp / 8; in tridentfb_set_par()
1349 set_lwidth(par, info->fix.line_length / 8); in tridentfb_set_par()
1351 if (!(info->flags & FBINFO_HWACCEL_DISABLED)) in tridentfb_set_par()
1352 par->init_accel(par, info->var.xres_virtual, bpp); in tridentfb_set_par()
1354 info->fix.visual = (bpp == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; in tridentfb_set_par()
1355 info->cmap.len = (bpp == 8) ? 256 : 16; in tridentfb_set_par()
1365 int bpp = info->var.bits_per_pixel; in tridentfb_setcolreg()
1366 struct tridentfb_par *par = info->par; in tridentfb_setcolreg()
1368 if (regno >= info->cmap.len) in tridentfb_setcolreg()
1381 u32 col; in tridentfb_setcolreg() local
1383 col = (red & 0xF800) | ((green & 0xFC00) >> 5) | in tridentfb_setcolreg()
1385 col |= col << 16; in tridentfb_setcolreg()
1386 ((u32 *)(info->pseudo_palette))[regno] = col; in tridentfb_setcolreg()
1388 ((u32 *)info->pseudo_palette)[regno] = in tridentfb_setcolreg()
1402 struct tridentfb_par *par = info->par; in tridentfb_blank()
1405 if (par->flatpanel) in tridentfb_blank()
1477 info = framebuffer_alloc(sizeof(struct tridentfb_par), &dev->dev); in trident_pci_probe()
1479 return -ENOMEM; in trident_pci_probe()
1480 default_par = info->par; in trident_pci_probe()
1482 chip_id = id->device; in trident_pci_probe()
1523 default_par->init_accel = xp_init_accel; in trident_pci_probe()
1524 default_par->wait_engine = xp_wait_engine; in trident_pci_probe()
1525 default_par->fill_rect = xp_fill_rect; in trident_pci_probe()
1526 default_par->copy_rect = xp_copy_rect; in trident_pci_probe()
1529 default_par->init_accel = blade_init_accel; in trident_pci_probe()
1530 default_par->wait_engine = blade_wait_engine; in trident_pci_probe()
1531 default_par->fill_rect = blade_fill_rect; in trident_pci_probe()
1532 default_par->copy_rect = blade_copy_rect; in trident_pci_probe()
1533 default_par->image_blit = blade_image_blit; in trident_pci_probe()
1536 default_par->init_accel = image_init_accel; in trident_pci_probe()
1537 default_par->wait_engine = image_wait_engine; in trident_pci_probe()
1538 default_par->fill_rect = image_fill_rect; in trident_pci_probe()
1539 default_par->copy_rect = image_copy_rect; in trident_pci_probe()
1542 default_par->init_accel = tgui_init_accel; in trident_pci_probe()
1543 default_par->wait_engine = xp_wait_engine; in trident_pci_probe()
1544 default_par->fill_rect = tgui_fill_rect; in trident_pci_probe()
1545 default_par->copy_rect = tgui_copy_rect; in trident_pci_probe()
1549 default_par->chip_id = chip_id; in trident_pci_probe()
1559 return -1; in trident_pci_probe()
1562 default_par->io_virt = ioremap(tridentfb_fix.mmio_start, in trident_pci_probe()
1565 if (!default_par->io_virt) { in trident_pci_probe()
1567 err = -1; in trident_pci_probe()
1580 disable_mmio(info->par); in trident_pci_probe()
1581 err = -1; in trident_pci_probe()
1585 info->screen_base = ioremap(tridentfb_fix.smem_start, in trident_pci_probe()
1588 if (!info->screen_base) { in trident_pci_probe()
1590 err = -1; in trident_pci_probe()
1594 default_par->flatpanel = is_flatpanel(default_par); in trident_pci_probe()
1596 if (default_par->flatpanel) in trident_pci_probe()
1599 info->fix = tridentfb_fix; in trident_pci_probe()
1600 info->fbops = &tridentfb_ops; in trident_pci_probe()
1601 info->pseudo_palette = default_par->pseudo_pal; in trident_pci_probe()
1603 info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; in trident_pci_probe()
1604 if (!noaccel && default_par->init_accel) { in trident_pci_probe()
1605 info->flags &= ~FBINFO_HWACCEL_DISABLED; in trident_pci_probe()
1606 info->flags |= FBINFO_HWACCEL_COPYAREA; in trident_pci_probe()
1607 info->flags |= FBINFO_HWACCEL_FILLRECT; in trident_pci_probe()
1609 info->flags |= FBINFO_HWACCEL_DISABLED; in trident_pci_probe()
1612 info->flags |= FBINFO_READS_FAST; in trident_pci_probe()
1614 info->pixmap.addr = kmalloc(4096, GFP_KERNEL); in trident_pci_probe()
1615 if (!info->pixmap.addr) { in trident_pci_probe()
1616 err = -ENOMEM; in trident_pci_probe()
1620 info->pixmap.size = 4096; in trident_pci_probe()
1621 info->pixmap.buf_align = 4; in trident_pci_probe()
1622 info->pixmap.scan_align = 1; in trident_pci_probe()
1623 info->pixmap.access_align = 32; in trident_pci_probe()
1624 info->pixmap.flags = FB_PIXMAP_SYSTEM; in trident_pci_probe()
1625 info->var.bits_per_pixel = 8; in trident_pci_probe()
1627 if (default_par->image_blit) { in trident_pci_probe()
1628 info->flags |= FBINFO_HWACCEL_IMAGEBLIT; in trident_pci_probe()
1629 info->pixmap.scan_align = 4; in trident_pci_probe()
1634 info->flags |= FBINFO_HWACCEL_DISABLED; in trident_pci_probe()
1635 info->pixmap.scan_align = 1; in trident_pci_probe()
1639 u8 *edid = fb_ddc_read(&default_par->ddc_adapter); in trident_pci_probe()
1641 default_par->ddc_registered = true; in trident_pci_probe()
1643 fb_edid_to_monspecs(edid, &info->monspecs); in trident_pci_probe()
1645 if (!info->monspecs.modedb) in trident_pci_probe()
1646 dev_err(info->device, "error getting mode database\n"); in trident_pci_probe()
1650 fb_videomode_to_modelist(info->monspecs.modedb, in trident_pci_probe()
1651 info->monspecs.modedb_len, in trident_pci_probe()
1652 &info->modelist); in trident_pci_probe()
1653 m = fb_find_best_display(&info->monspecs, in trident_pci_probe()
1654 &info->modelist); in trident_pci_probe()
1656 fb_videomode_to_var(&info->var, m); in trident_pci_probe()
1657 /* fill all other info->var's fields */ in trident_pci_probe()
1658 if (tridentfb_check_var(&info->var, in trident_pci_probe()
1667 mode_option = "640x480-8@60"; in trident_pci_probe()
1671 err = fb_find_mode(&info->var, info, mode_option, in trident_pci_probe()
1672 info->monspecs.modedb, in trident_pci_probe()
1673 info->monspecs.modedb_len, in trident_pci_probe()
1674 NULL, info->var.bits_per_pixel); in trident_pci_probe()
1676 err = -EINVAL; in trident_pci_probe()
1677 dev_err(info->device, "mode %s not found\n", in trident_pci_probe()
1679 fb_destroy_modedb(info->monspecs.modedb); in trident_pci_probe()
1680 info->monspecs.modedb = NULL; in trident_pci_probe()
1685 fb_destroy_modedb(info->monspecs.modedb); in trident_pci_probe()
1686 info->monspecs.modedb = NULL; in trident_pci_probe()
1688 err = fb_alloc_cmap(&info->cmap, 256, 0); in trident_pci_probe()
1692 info->var.activate |= FB_ACTIVATE_NOW; in trident_pci_probe()
1693 info->device = &dev->dev; in trident_pci_probe()
1696 fb_dealloc_cmap(&info->cmap); in trident_pci_probe()
1697 err = -EINVAL; in trident_pci_probe()
1700 output("fb%d: %s frame buffer device %dx%d-%dbpp\n", in trident_pci_probe()
1701 info->node, info->fix.id, info->var.xres, in trident_pci_probe()
1702 info->var.yres, info->var.bits_per_pixel); in trident_pci_probe()
1708 if (default_par->ddc_registered) in trident_pci_probe()
1709 i2c_del_adapter(&default_par->ddc_adapter); in trident_pci_probe()
1710 kfree(info->pixmap.addr); in trident_pci_probe()
1711 if (info->screen_base) in trident_pci_probe()
1712 iounmap(info->screen_base); in trident_pci_probe()
1713 disable_mmio(info->par); in trident_pci_probe()
1715 if (default_par->io_virt) in trident_pci_probe()
1716 iounmap(default_par->io_virt); in trident_pci_probe()
1724 struct tridentfb_par *par = info->par; in trident_pci_remove()
1727 if (par->ddc_registered) in trident_pci_remove()
1728 i2c_del_adapter(&par->ddc_adapter); in trident_pci_remove()
1729 iounmap(par->io_virt); in trident_pci_remove()
1730 iounmap(info->screen_base); in trident_pci_remove()
1731 kfree(info->pixmap.addr); in trident_pci_remove()
1732 fb_dealloc_cmap(&info->cmap); in trident_pci_remove()
1816 return -ENODEV; in tridentfb_init()