Lines Matching +full:scaled +full:- +full:sync

8  * Copyright (c) 1998-2000 Ilario Nardinocchi (nardinoc@CS.UniBO.IT)
14 * I have a Creative Graphics Blaster Exxtreme card - pm2fb on x86. I
16 * hopefully other big-endian) devices now work, thanks to a lot of
71 * support on TVP4010 and similar where there is no RAMDAC - see
72 * comment in set_video) always request +ve sync regardless of what
74 * fixed-frequency monitor which absolutely has to have -ve sync. So
75 * these flags allow the user to specify that requests for +ve sync
76 * should be silently turned in -ve sync.
128 .height = -1,
129 .width = -1,
147 return fb_readl(p->v_regs + off); in pm2_RD()
152 fb_writel(v, p->v_regs + off); in pm2_WR()
268 curr = (clk > f) ? clk - f : f - clk; in pm2_mnp()
295 if (clk > f - delta && clk < f + delta) { in pm2v_mnp()
296 delta = (clk > f) ? clk - f : f - clk; in pm2v_mnp()
313 while (i--) { in clear_palette()
323 if (p->type == PM2_TYPE_PERMEDIA2V) in reset_card()
338 pm2_WR(p, PM2R_MEM_CONTROL, p->mem_control); in reset_card()
339 pm2_WR(p, PM2R_BOOT_ADDRESS, p->boot_address); in reset_card()
341 pm2_WR(p, PM2R_MEM_CONFIG, p->mem_config); in reset_card()
384 switch (p->type) { in reset_config()
404 * The hardware is little-endian. When used in big-endian in set_aperture()
405 * hosts, the on-chip aperture settings are used where in set_aperture()
413 case 24: /* RGB->BGR */ in set_aperture()
419 case 8: /* B->B */ in set_aperture()
422 case 16: /* HL->LH */ in set_aperture()
425 case 32: /* RGBA->ABGR */ in set_aperture()
453 switch (par->type) { in set_memclock()
464 for (i = 256; i; i--) in set_memclock()
478 for (i = 256; i; i--) in set_memclock()
490 switch (par->type) { in set_pixclock()
500 for (i = 256; i; i--) in set_pixclock()
527 * the RAMDAC to invert the sync if necessary. in set_video()
535 switch (p->type) { in set_video()
556 * pm2fb_check_var - Optional function. Validates a var passed in.
569 if (var->bits_per_pixel != 8 && var->bits_per_pixel != 16 && in pm2fb_check_var()
570 var->bits_per_pixel != 24 && var->bits_per_pixel != 32) { in pm2fb_check_var()
571 DPRINTK("depth not supported: %u\n", var->bits_per_pixel); in pm2fb_check_var()
572 return -EINVAL; in pm2fb_check_var()
575 if (var->xres != var->xres_virtual) { in pm2fb_check_var()
578 return -EINVAL; in pm2fb_check_var()
581 if (var->yres > var->yres_virtual) { in pm2fb_check_var()
584 return -EINVAL; in pm2fb_check_var()
588 if (var->yres_virtual > 2047) { in pm2fb_check_var()
589 var->yres_virtual = 2047; in pm2fb_check_var()
592 if (var->xoffset) { in pm2fb_check_var()
594 return -EINVAL; in pm2fb_check_var()
597 if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) { in pm2fb_check_var()
599 return -EINVAL; in pm2fb_check_var()
602 var->xres = (var->xres + 15) & ~15; /* could sometimes be 8 */ in pm2fb_check_var()
603 lpitch = var->xres * ((var->bits_per_pixel + 7) >> 3); in pm2fb_check_var()
605 if (var->xres < 320 || var->xres > 1600) { in pm2fb_check_var()
606 DPRINTK("width not supported: %u\n", var->xres); in pm2fb_check_var()
607 return -EINVAL; in pm2fb_check_var()
610 if (var->yres < 200 || var->yres > 1200) { in pm2fb_check_var()
611 DPRINTK("height not supported: %u\n", var->yres); in pm2fb_check_var()
612 return -EINVAL; in pm2fb_check_var()
615 if (lpitch * var->yres_virtual > info->fix.smem_len) { in pm2fb_check_var()
617 var->xres, var->yres_virtual, var->bits_per_pixel); in pm2fb_check_var()
618 return -EINVAL; in pm2fb_check_var()
621 if (!var->pixclock) { in pm2fb_check_var()
623 return -EINVAL; in pm2fb_check_var()
626 if (PICOS2KHZ(var->pixclock) > PM2_MAX_PIXCLOCK) { in pm2fb_check_var()
628 PICOS2KHZ(var->pixclock)); in pm2fb_check_var()
629 return -EINVAL; in pm2fb_check_var()
632 var->transp.offset = 0; in pm2fb_check_var()
633 var->transp.length = 0; in pm2fb_check_var()
634 switch (var->bits_per_pixel) { in pm2fb_check_var()
636 var->red.length = 8; in pm2fb_check_var()
637 var->green.length = 8; in pm2fb_check_var()
638 var->blue.length = 8; in pm2fb_check_var()
641 var->red.offset = 11; in pm2fb_check_var()
642 var->red.length = 5; in pm2fb_check_var()
643 var->green.offset = 5; in pm2fb_check_var()
644 var->green.length = 6; in pm2fb_check_var()
645 var->blue.offset = 0; in pm2fb_check_var()
646 var->blue.length = 5; in pm2fb_check_var()
649 var->transp.offset = 24; in pm2fb_check_var()
650 var->transp.length = 8; in pm2fb_check_var()
651 var->red.offset = 16; in pm2fb_check_var()
652 var->green.offset = 8; in pm2fb_check_var()
653 var->blue.offset = 0; in pm2fb_check_var()
654 var->red.length = 8; in pm2fb_check_var()
655 var->green.length = 8; in pm2fb_check_var()
656 var->blue.length = 8; in pm2fb_check_var()
660 var->red.offset = 0; in pm2fb_check_var()
661 var->blue.offset = 16; in pm2fb_check_var()
663 var->red.offset = 16; in pm2fb_check_var()
664 var->blue.offset = 0; in pm2fb_check_var()
666 var->green.offset = 8; in pm2fb_check_var()
667 var->red.length = 8; in pm2fb_check_var()
668 var->green.length = 8; in pm2fb_check_var()
669 var->blue.length = 8; in pm2fb_check_var()
672 var->height = -1; in pm2fb_check_var()
673 var->width = -1; in pm2fb_check_var()
675 var->accel_flags = 0; /* Can't mmap if this is on */ in pm2fb_check_var()
678 var->xres, var->yres, var->bits_per_pixel); in pm2fb_check_var()
683 * pm2fb_set_par - Alters the hardware state.
691 struct pm2fb_par *par = info->par; in pm2fb_set_par()
693 u32 width = (info->var.xres_virtual + 7) & ~7; in pm2fb_set_par()
694 u32 height = info->var.yres_virtual; in pm2fb_set_par()
695 u32 depth = (info->var.bits_per_pixel + 7) & ~7; in pm2fb_set_par()
705 u32 misc = 1; /* 8-bit DAC */ in pm2fb_set_par()
706 u32 xres = (info->var.xres + 31) & ~31; in pm2fb_set_par()
712 if (par->memclock) in pm2fb_set_par()
713 set_memclock(par, par->memclock); in pm2fb_set_par()
716 data64 = depth > 8 || par->type == PM2_TYPE_PERMEDIA2V; in pm2fb_set_par()
718 pixclock = PICOS2KHZ(info->var.pixclock); in pm2fb_set_par()
721 return -EINVAL; in pm2fb_set_par()
724 hsstart = to3264(info->var.right_margin, depth, data64); in pm2fb_set_par()
725 hsend = hsstart + to3264(info->var.hsync_len, depth, data64); in pm2fb_set_par()
726 hbend = hsend + to3264(info->var.left_margin, depth, data64); in pm2fb_set_par()
727 htotal = to3264(xres, depth, data64) + hbend - 1; in pm2fb_set_par()
728 vsstart = (info->var.lower_margin) in pm2fb_set_par()
729 ? info->var.lower_margin - 1 in pm2fb_set_par()
731 vsend = info->var.lower_margin + info->var.vsync_len - 1; in pm2fb_set_par()
732 vbend = info->var.lower_margin + info->var.vsync_len + in pm2fb_set_par()
733 info->var.upper_margin; in pm2fb_set_par()
734 vtotal = info->var.yres + vbend - 1; in pm2fb_set_par()
736 base = to3264(info->var.yoffset * xres + info->var.xoffset, depth, 1); in pm2fb_set_par()
740 if (info->var.sync & FB_SYNC_HOR_HIGH_ACT) { in pm2fb_set_par()
742 DPRINTK("ignoring +hsync, using -hsync.\n"); in pm2fb_set_par()
749 if (info->var.sync & FB_SYNC_VERT_HIGH_ACT) { in pm2fb_set_par()
751 DPRINTK("ignoring +vsync, using -vsync.\n"); in pm2fb_set_par()
758 if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) { in pm2fb_set_par()
760 return -EINVAL; in pm2fb_set_par()
762 if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) in pm2fb_set_par()
764 if ((info->var.activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) in pm2fb_set_par()
766 par->video = video; in pm2fb_set_par()
768 info->fix.visual = in pm2fb_set_par()
770 info->fix.line_length = info->var.xres * depth / 8; in pm2fb_set_par()
771 info->cmap.len = 256; in pm2fb_set_par()
776 if (par->type == PM2_TYPE_PERMEDIA2V) { in pm2fb_set_par()
838 switch (par->type) { in pm2fb_set_par()
854 info->var.xres, info->var.yres, info->var.bits_per_pixel); in pm2fb_set_par()
859 * pm2fb_setcolreg - Sets a color register.
868 * magnitude which needs to be scaled in this function for the hardware.
877 struct pm2fb_par *par = info->par; in pm2fb_setcolreg()
879 if (regno >= info->cmap.len) /* no. of hw registers */ in pm2fb_setcolreg()
880 return -EINVAL; in pm2fb_setcolreg()
887 if (info->var.grayscale) in pm2fb_setcolreg()
891 * var->{color}.offset contains start of bitfield in pm2fb_setcolreg()
892 * var->{color}.length contains length of bitfield in pm2fb_setcolreg()
900 * var->{color}.offset is 0 in pm2fb_setcolreg()
901 * var->{color}.length contains width of DAC in pm2fb_setcolreg()
906 * var->{color}.offset contains start of bitfield in pm2fb_setcolreg()
907 * var->{color}.length contains length of bitfield in pm2fb_setcolreg()
913 #define CNVT_TOHW(val, width) ((((val) << (width)) + 0x7FFF -(val)) >> 16) in pm2fb_setcolreg()
914 switch (info->fix.visual) { in pm2fb_setcolreg()
917 red = CNVT_TOHW(red, info->var.red.length); in pm2fb_setcolreg()
918 green = CNVT_TOHW(green, info->var.green.length); in pm2fb_setcolreg()
919 blue = CNVT_TOHW(blue, info->var.blue.length); in pm2fb_setcolreg()
920 transp = CNVT_TOHW(transp, info->var.transp.length); in pm2fb_setcolreg()
934 if (info->fix.visual == FB_VISUAL_TRUECOLOR) { in pm2fb_setcolreg()
938 return -EINVAL; in pm2fb_setcolreg()
940 v = (red << info->var.red.offset) | in pm2fb_setcolreg()
941 (green << info->var.green.offset) | in pm2fb_setcolreg()
942 (blue << info->var.blue.offset) | in pm2fb_setcolreg()
943 (transp << info->var.transp.offset); in pm2fb_setcolreg()
945 switch (info->var.bits_per_pixel) { in pm2fb_setcolreg()
951 par->palette[regno] = v; in pm2fb_setcolreg()
955 } else if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR) in pm2fb_setcolreg()
962 * pm2fb_pan_display - Pans the display.
968 * If the values don't fit, return -EINVAL.
976 struct pm2fb_par *p = info->par; in pm2fb_pan_display()
978 u32 depth = (info->var.bits_per_pixel + 7) & ~7; in pm2fb_pan_display()
979 u32 xres = (info->var.xres + 31) & ~31; in pm2fb_pan_display()
982 base = to3264(var->yoffset * xres + var->xoffset, depth, 1); in pm2fb_pan_display()
989 * pm2fb_blank - Blanks the display.
994 * blanking succeeded, != 0 if un-/blanking failed due to e.g. a
1006 struct pm2fb_par *par = info->par; in pm2fb_blank()
1007 u32 video = par->video; in pm2fb_blank()
1039 struct pm2fb_par *par = info->par; in pm2fb_sync()
1055 struct pm2fb_par *par = info->par; in pm2fb_fillrect()
1058 u32 color = (info->fix.visual == FB_VISUAL_TRUECOLOR) ? in pm2fb_fillrect()
1059 ((u32 *)info->pseudo_palette)[region->color] : region->color; in pm2fb_fillrect()
1061 if (info->state != FBINFO_STATE_RUNNING) in pm2fb_fillrect()
1063 if ((info->flags & FBINFO_HWACCEL_DISABLED) || in pm2fb_fillrect()
1064 region->rop != ROP_COPY ) { in pm2fb_fillrect()
1069 vxres = info->var.xres_virtual; in pm2fb_fillrect()
1070 vyres = info->var.yres_virtual; in pm2fb_fillrect()
1079 modded.width = vxres - modded.dx; in pm2fb_fillrect()
1081 modded.height = vyres - modded.dy; in pm2fb_fillrect()
1083 if (info->var.bits_per_pixel == 8) in pm2fb_fillrect()
1085 if (info->var.bits_per_pixel <= 16) in pm2fb_fillrect()
1092 if (info->var.bits_per_pixel != 24) { in pm2fb_fillrect()
1113 struct pm2fb_par *par = info->par; in pm2fb_copyarea()
1117 if (info->state != FBINFO_STATE_RUNNING) in pm2fb_copyarea()
1119 if (info->flags & FBINFO_HWACCEL_DISABLED) { in pm2fb_copyarea()
1126 vxres = info->var.xres_virtual; in pm2fb_copyarea()
1127 vyres = info->var.yres_virtual; in pm2fb_copyarea()
1135 modded.width = vxres - modded.sx; in pm2fb_copyarea()
1137 modded.width = vxres - modded.dx; in pm2fb_copyarea()
1139 modded.height = vyres - modded.sy; in pm2fb_copyarea()
1141 modded.height = vyres - modded.dy; in pm2fb_copyarea()
1147 ((modded.sy - modded.dy) & 0xfff) << 16 | in pm2fb_copyarea()
1148 ((modded.sx - modded.dx) & 0xfff)); in pm2fb_copyarea()
1159 struct pm2fb_par *par = info->par; in pm2fb_imageblit()
1160 u32 height = image->height; in pm2fb_imageblit()
1162 const u32 *src = (const u32 *)image->data; in pm2fb_imageblit()
1163 u32 xres = (info->var.xres + 31) & ~31; in pm2fb_imageblit()
1170 if (info->state != FBINFO_STATE_RUNNING) in pm2fb_imageblit()
1172 if (info->flags & FBINFO_HWACCEL_DISABLED || image->depth != 1) { in pm2fb_imageblit()
1176 switch (info->fix.visual) { in pm2fb_imageblit()
1178 fgx = image->fg_color; in pm2fb_imageblit()
1179 bgx = image->bg_color; in pm2fb_imageblit()
1183 fgx = par->palette[image->fg_color]; in pm2fb_imageblit()
1184 bgx = par->palette[image->bg_color]; in pm2fb_imageblit()
1187 if (info->var.bits_per_pixel == 8) { in pm2fb_imageblit()
1191 if (info->var.bits_per_pixel <= 16) { in pm2fb_imageblit()
1199 ((image->dy & 0xfff) << 16) | (image->dx & 0x0fff)); in pm2fb_imageblit()
1201 (((image->dy + image->height) & 0x0fff) << 16) | in pm2fb_imageblit()
1202 ((image->dx + image->width) & 0x0fff)); in pm2fb_imageblit()
1207 ((image->dy & 0xfff) << 16) | (image->dx & 0x0fff)); in pm2fb_imageblit()
1209 ((image->height & 0x0fff) << 16) | in pm2fb_imageblit()
1210 ((image->width) & 0x0fff)); in pm2fb_imageblit()
1211 if (info->var.bits_per_pixel == 24) { in pm2fb_imageblit()
1242 while (height--) { in pm2fb_imageblit()
1243 int width = ((image->width + 7) >> 3) in pm2fb_imageblit()
1244 + info->pixmap.scan_align - 1; in pm2fb_imageblit()
1247 while (width--) { in pm2fb_imageblit()
1268 struct pm2fb_par *par = info->par; in pm2vfb_cursor()
1270 int x = cursor->image.dx - info->var.xoffset; in pm2vfb_cursor()
1271 int y = cursor->image.dy - info->var.yoffset; in pm2vfb_cursor()
1273 if (cursor->enable) in pm2vfb_cursor()
1278 if (!cursor->enable) in pm2vfb_cursor()
1290 if (!cursor->set) in pm2vfb_cursor()
1293 if (cursor->set & FB_CUR_SETHOT) { in pm2vfb_cursor()
1295 cursor->hot.x & 0x3f); in pm2vfb_cursor()
1297 cursor->hot.y & 0x3f); in pm2vfb_cursor()
1300 if (cursor->set & FB_CUR_SETCMAP) { in pm2vfb_cursor()
1301 u32 fg_idx = cursor->image.fg_color; in pm2vfb_cursor()
1302 u32 bg_idx = cursor->image.bg_color; in pm2vfb_cursor()
1303 struct fb_cmap cmap = info->cmap; in pm2vfb_cursor()
1323 if (cursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) { in pm2vfb_cursor()
1324 u8 *bitmap = (u8 *)cursor->image.data; in pm2vfb_cursor()
1325 u8 *mask = (u8 *)cursor->mask; in pm2vfb_cursor()
1329 for (i = 0; i < cursor->image.height; i++) { in pm2vfb_cursor()
1330 int j = (cursor->image.width + 7) >> 3; in pm2vfb_cursor()
1331 int k = 8 - j; in pm2vfb_cursor()
1335 for (; j > 0; j--) { in pm2vfb_cursor()
1338 if (cursor->rop == ROP_COPY) in pm2vfb_cursor()
1351 for (; k > 0; k--) { in pm2vfb_cursor()
1369 struct pm2fb_par *par = info->par; in pm2fb_cursor()
1373 return -EINVAL; /* just to force soft_cursor() call */ in pm2fb_cursor()
1375 /* Too large of a cursor or wrong bpp :-( */ in pm2fb_cursor()
1376 if (cursor->image.width > 64 || in pm2fb_cursor()
1377 cursor->image.height > 64 || in pm2fb_cursor()
1378 cursor->image.depth > 1) in pm2fb_cursor()
1379 return -EINVAL; in pm2fb_cursor()
1381 if (par->type == PM2_TYPE_PERMEDIA2V) in pm2fb_cursor()
1385 if (cursor->enable) in pm2fb_cursor()
1395 if (!cursor->set) in pm2fb_cursor()
1398 if (cursor->set & FB_CUR_SETPOS) { in pm2fb_cursor()
1399 int x = cursor->image.dx - info->var.xoffset + 63; in pm2fb_cursor()
1400 int y = cursor->image.dy - info->var.yoffset + 63; in pm2fb_cursor()
1409 if (cursor->set & FB_CUR_SETCMAP) { in pm2fb_cursor()
1410 u32 fg_idx = cursor->image.fg_color; in pm2fb_cursor()
1411 u32 bg_idx = cursor->image.bg_color; in pm2fb_cursor()
1416 info->cmap.red[bg_idx] >> 8); in pm2fb_cursor()
1418 info->cmap.green[bg_idx] >> 8); in pm2fb_cursor()
1420 info->cmap.blue[bg_idx] >> 8); in pm2fb_cursor()
1423 info->cmap.red[fg_idx] >> 8); in pm2fb_cursor()
1425 info->cmap.green[fg_idx] >> 8); in pm2fb_cursor()
1427 info->cmap.blue[fg_idx] >> 8); in pm2fb_cursor()
1430 if (cursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) { in pm2fb_cursor()
1431 u8 *bitmap = (u8 *)cursor->image.data; in pm2fb_cursor()
1432 u8 *mask = (u8 *)cursor->mask; in pm2fb_cursor()
1438 for (i = 0; i < cursor->image.height; i++) { in pm2fb_cursor()
1439 int j = (cursor->image.width + 7) >> 3; in pm2fb_cursor()
1440 int k = 8 - j; in pm2fb_cursor()
1443 for (; j > 0; j--) { in pm2fb_cursor()
1446 if (cursor->rop == ROP_COPY) in pm2fb_cursor()
1453 for (; k > 0; k--) in pm2fb_cursor()
1459 while (j-- > 0) in pm2fb_cursor()
1463 mask = (u8 *)cursor->mask; in pm2fb_cursor()
1464 for (i = 0; i < cursor->image.height; i++) { in pm2fb_cursor()
1465 int j = (cursor->image.width + 7) >> 3; in pm2fb_cursor()
1466 int k = 8 - j; in pm2fb_cursor()
1469 for (; j > 0; j--) { in pm2fb_cursor()
1474 for (; k > 0; k--) in pm2fb_cursor()
1480 while (j-- > 0) in pm2fb_cursor()
1487 /* ------------ Hardware Independent Functions ------------ */
1515 * pm2fb_probe - Initialise and allocate resource for PCI device.
1525 int retval = -ENXIO; in pm2fb_probe()
1537 info = framebuffer_alloc(sizeof(struct pm2fb_par), &pdev->dev); in pm2fb_probe()
1539 err = -ENOMEM; in pm2fb_probe()
1542 default_par = info->par; in pm2fb_probe()
1544 switch (pdev->device) { in pm2fb_probe()
1547 default_par->type = PM2_TYPE_PERMEDIA2; in pm2fb_probe()
1551 default_par->type = PM2_TYPE_PERMEDIA2; in pm2fb_probe()
1555 default_par->type = PM2_TYPE_PERMEDIA2V; in pm2fb_probe()
1565 * map is little-endian, upper map is big-endian. in pm2fb_probe()
1568 DPRINTK("Adjusting register base for big-endian.\n"); in pm2fb_probe()
1572 /* Registers - request region and map it. */ in pm2fb_probe()
1578 default_par->v_regs = in pm2fb_probe()
1580 if (!default_par->v_regs) { in pm2fb_probe()
1588 default_par->mem_control = pm2_RD(default_par, PM2R_MEM_CONTROL); in pm2fb_probe()
1589 default_par->boot_address = pm2_RD(default_par, PM2R_BOOT_ADDRESS); in pm2fb_probe()
1590 default_par->mem_config = pm2_RD(default_par, PM2R_MEM_CONFIG); in pm2fb_probe()
1592 default_par->mem_control, default_par->boot_address, in pm2fb_probe()
1593 default_par->mem_config); in pm2fb_probe()
1595 if (default_par->mem_control == 0 && in pm2fb_probe()
1596 default_par->boot_address == 0x31 && in pm2fb_probe()
1597 default_par->mem_config == 0x259fffff) { in pm2fb_probe()
1598 default_par->memclock = CVPPC_MEMCLOCK; in pm2fb_probe()
1599 default_par->mem_control = 0; in pm2fb_probe()
1600 default_par->boot_address = 0x20; in pm2fb_probe()
1601 default_par->mem_config = 0xe6002021; in pm2fb_probe()
1602 if (pdev->subsystem_vendor == 0x1048 && in pm2fb_probe()
1603 pdev->subsystem_device == 0x0a31) { in pm2fb_probe()
1606 pdev->subsystem_vendor, pdev->subsystem_device); in pm2fb_probe()
1610 default_par->memclock = 100000; in pm2fb_probe()
1612 if (pdev->subsystem_vendor == 0x3d3d && in pm2fb_probe()
1613 pdev->subsystem_device == 0x0100) { in pm2fb_probe()
1616 pdev->subsystem_vendor, pdev->subsystem_device); in pm2fb_probe()
1620 default_par->memclock = 74894; in pm2fb_probe()
1625 switch (default_par->mem_config & PM2F_MEM_CONFIG_RAM_MASK) { in pm2fb_probe()
1641 /* Linear frame buffer - request region and map it. */ in pm2fb_probe()
1647 info->screen_base = in pm2fb_probe()
1649 if (!info->screen_base) { in pm2fb_probe()
1656 default_par->wc_cookie = arch_phys_wc_add(pm2fb_fix.smem_start, in pm2fb_probe()
1659 info->fbops = &pm2fb_ops; in pm2fb_probe()
1660 info->fix = pm2fb_fix; in pm2fb_probe()
1661 info->pseudo_palette = default_par->palette; in pm2fb_probe()
1662 info->flags = FBINFO_HWACCEL_YPAN | in pm2fb_probe()
1667 info->pixmap.addr = kmalloc(PM2_PIXMAP_SIZE, GFP_KERNEL); in pm2fb_probe()
1668 if (!info->pixmap.addr) { in pm2fb_probe()
1669 retval = -ENOMEM; in pm2fb_probe()
1672 info->pixmap.size = PM2_PIXMAP_SIZE; in pm2fb_probe()
1673 info->pixmap.buf_align = 4; in pm2fb_probe()
1674 info->pixmap.scan_align = 4; in pm2fb_probe()
1675 info->pixmap.access_align = 32; in pm2fb_probe()
1676 info->pixmap.flags = FB_PIXMAP_SYSTEM; in pm2fb_probe()
1680 info->flags |= FBINFO_HWACCEL_DISABLED; in pm2fb_probe()
1681 info->pixmap.scan_align = 1; in pm2fb_probe()
1687 err = fb_find_mode(&info->var, info, mode_option, NULL, 0, NULL, 8); in pm2fb_probe()
1689 info->var = pm2fb_var; in pm2fb_probe()
1691 retval = fb_alloc_cmap(&info->cmap, 256, 0); in pm2fb_probe()
1700 info->fix.id, pm2fb_fix.smem_len / 1024); in pm2fb_probe()
1710 fb_dealloc_cmap(&info->cmap); in pm2fb_probe()
1712 kfree(info->pixmap.addr); in pm2fb_probe()
1714 iounmap(info->screen_base); in pm2fb_probe()
1717 iounmap(default_par->v_regs); in pm2fb_probe()
1727 * pm2fb_remove - Release all device resources.
1734 struct fb_fix_screeninfo *fix = &info->fix; in pm2fb_remove()
1735 struct pm2fb_par *par = info->par; in pm2fb_remove()
1738 arch_phys_wc_del(par->wc_cookie); in pm2fb_remove()
1739 iounmap(info->screen_base); in pm2fb_remove()
1740 release_mem_region(fix->smem_start, fix->smem_len); in pm2fb_remove()
1741 iounmap(par->v_regs); in pm2fb_remove()
1742 release_mem_region(fix->mmio_start, fix->mmio_len); in pm2fb_remove()
1744 fb_dealloc_cmap(&info->cmap); in pm2fb_remove()
1745 kfree(info->pixmap.addr); in pm2fb_remove()
1774 * This is, comma-separated options following `video=pm2fb:'.
1811 return -ENODEV; in pm2fb_init()
1815 return -ENODEV; in pm2fb_init()
1839 MODULE_PARM_DESC(mode_option, "Initial video mode e.g. '648x480-8@60'");
1841 MODULE_PARM_DESC(mode, "Initial video mode e.g. '648x480-8@60' (deprecated)");
1843 MODULE_PARM_DESC(lowhsync, "Force horizontal sync low regardless of mode");
1845 MODULE_PARM_DESC(lowvsync, "Force vertical sync low regardless of mode");