diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/sstfb.c | 170 |
1 files changed, 55 insertions, 115 deletions
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c index dad54e73147b..711cb11d6eb3 100644 --- a/drivers/video/sstfb.c +++ b/drivers/video/sstfb.c | |||
@@ -17,7 +17,10 @@ | |||
17 | * (port driver to new frambuffer infrastructure) | 17 | * (port driver to new frambuffer infrastructure) |
18 | * 01/2003 Helge Deller <deller@gmx.de> | 18 | * 01/2003 Helge Deller <deller@gmx.de> |
19 | * (initial work on fb hardware acceleration for voodoo2) | 19 | * (initial work on fb hardware acceleration for voodoo2) |
20 | * | 20 | * 08/2006 Alan Cox <alan@redhat.com> |
21 | * Remove never finished and bogus 24/32bit support | ||
22 | * Clean up macro abuse | ||
23 | * Minor tidying for format. | ||
21 | */ | 24 | */ |
22 | 25 | ||
23 | /* | 26 | /* |
@@ -40,6 +43,7 @@ | |||
40 | through the fifo. warning: issuing a nop command seems to need pci_fifo | 43 | through the fifo. warning: issuing a nop command seems to need pci_fifo |
41 | -FIXME: in case of failure in the init sequence, be sure we return to a safe | 44 | -FIXME: in case of failure in the init sequence, be sure we return to a safe |
42 | state. | 45 | state. |
46 | - FIXME: Use accelerator for 2D scroll | ||
43 | -FIXME: 4MB boards have banked memory (FbiInit2 bits 1 & 20) | 47 | -FIXME: 4MB boards have banked memory (FbiInit2 bits 1 & 20) |
44 | */ | 48 | */ |
45 | 49 | ||
@@ -67,9 +71,6 @@ | |||
67 | 71 | ||
68 | #undef SST_DEBUG | 72 | #undef SST_DEBUG |
69 | 73 | ||
70 | /* enable 24/32 bpp functions ? (completely untested!) */ | ||
71 | #undef EN_24_32_BPP | ||
72 | |||
73 | /* | 74 | /* |
74 | Default video mode . | 75 | Default video mode . |
75 | 0 800x600@60 took from glide | 76 | 0 800x600@60 took from glide |
@@ -377,7 +378,11 @@ static void sstfb_clear_screen(struct fb_info *info) | |||
377 | * sstfb_check_var - Optional function. Validates a var passed in. | 378 | * sstfb_check_var - Optional function. Validates a var passed in. |
378 | * @var: frame buffer variable screen structure | 379 | * @var: frame buffer variable screen structure |
379 | * @info: frame buffer structure that represents a single frame buffer | 380 | * @info: frame buffer structure that represents a single frame buffer |
381 | * | ||
382 | * Limit to the abilities of a single chip as SLI is not supported | ||
383 | * by this driver. | ||
380 | */ | 384 | */ |
385 | |||
381 | static int sstfb_check_var(struct fb_var_screeninfo *var, | 386 | static int sstfb_check_var(struct fb_var_screeninfo *var, |
382 | struct fb_info *info) | 387 | struct fb_info *info) |
383 | { | 388 | { |
@@ -390,7 +395,7 @@ static int sstfb_check_var(struct fb_var_screeninfo *var, | |||
390 | unsigned int freq; | 395 | unsigned int freq; |
391 | 396 | ||
392 | if (sst_calc_pll(PICOS2KHZ(var->pixclock), &freq, &par->pll)) { | 397 | if (sst_calc_pll(PICOS2KHZ(var->pixclock), &freq, &par->pll)) { |
393 | eprintk("Pixclock at %ld KHZ out of range\n", | 398 | printk(KERN_ERR "sstfb: Pixclock at %ld KHZ out of range\n", |
394 | PICOS2KHZ(var->pixclock)); | 399 | PICOS2KHZ(var->pixclock)); |
395 | return -EINVAL; | 400 | return -EINVAL; |
396 | } | 401 | } |
@@ -409,27 +414,15 @@ static int sstfb_check_var(struct fb_var_screeninfo *var, | |||
409 | case 0 ... 16 : | 414 | case 0 ... 16 : |
410 | var->bits_per_pixel = 16; | 415 | var->bits_per_pixel = 16; |
411 | break; | 416 | break; |
412 | #ifdef EN_24_32_BPP | ||
413 | case 17 ... 24 : | ||
414 | var->bits_per_pixel = 24; | ||
415 | break; | ||
416 | case 25 ... 32 : | ||
417 | var->bits_per_pixel = 32; | ||
418 | break; | ||
419 | #endif | ||
420 | default : | 417 | default : |
421 | eprintk("Unsupported bpp %d\n", var->bits_per_pixel); | 418 | printk(KERN_ERR "sstfb: Unsupported bpp %d\n", var->bits_per_pixel); |
422 | return -EINVAL; | 419 | return -EINVAL; |
423 | } | 420 | } |
424 | 421 | ||
425 | /* validity tests */ | 422 | /* validity tests */ |
426 | if ((var->xres <= 1) || (yDim <= 0 ) | 423 | if (var->xres <= 1 || yDim <= 0 || var->hsync_len <= 1 || |
427 | || (var->hsync_len <= 1) | 424 | hSyncOff <= 1 || var->left_margin <= 2 || vSyncOn <= 0 || |
428 | || (hSyncOff <= 1) | 425 | vSyncOff <= 0 || vBackPorch <= 0) { |
429 | || (var->left_margin <= 2) | ||
430 | || (vSyncOn <= 0) | ||
431 | || (vSyncOff <= 0) | ||
432 | || (vBackPorch <= 0)) { | ||
433 | return -EINVAL; | 426 | return -EINVAL; |
434 | } | 427 | } |
435 | 428 | ||
@@ -437,21 +430,17 @@ static int sstfb_check_var(struct fb_var_screeninfo *var, | |||
437 | /* Voodoo 2 limits */ | 430 | /* Voodoo 2 limits */ |
438 | tiles_in_X = (var->xres + 63 ) / 64 * 2; | 431 | tiles_in_X = (var->xres + 63 ) / 64 * 2; |
439 | 432 | ||
440 | if (((var->xres - 1) >= POW2(11)) || (yDim >= POW2(11))) { | 433 | if (var->xres > POW2(11) || yDim >= POW2(11)) { |
441 | eprintk("Unsupported resolution %dx%d\n", | 434 | printk(KERN_ERR "sstfb: Unsupported resolution %dx%d\n", |
442 | var->xres, var->yres); | 435 | var->xres, var->yres); |
443 | return -EINVAL; | 436 | return -EINVAL; |
444 | } | 437 | } |
445 | 438 | ||
446 | if (((var->hsync_len-1) >= POW2(9)) | 439 | if (var->hsync_len > POW2(9) || hSyncOff > POW2(11) || |
447 | || ((hSyncOff-1) >= POW2(11)) | 440 | var->left_margin - 2 >= POW2(9) || vSyncOn >= POW2(13) || |
448 | || ((var->left_margin - 2) >= POW2(9)) | 441 | vSyncOff >= POW2(13) || vBackPorch >= POW2(9) || |
449 | || (vSyncOn >= POW2(13)) | 442 | tiles_in_X >= POW2(6) || tiles_in_X <= 0) { |
450 | || (vSyncOff >= POW2(13)) | 443 | printk(KERN_ERR "sstfb: Unsupported timings\n"); |
451 | || (vBackPorch >= POW2(9)) | ||
452 | || (tiles_in_X >= POW2(6)) | ||
453 | || (tiles_in_X <= 0)) { | ||
454 | eprintk("Unsupported Timings\n"); | ||
455 | return -EINVAL; | 444 | return -EINVAL; |
456 | } | 445 | } |
457 | } else { | 446 | } else { |
@@ -459,24 +448,20 @@ static int sstfb_check_var(struct fb_var_screeninfo *var, | |||
459 | tiles_in_X = (var->xres + 63 ) / 64; | 448 | tiles_in_X = (var->xres + 63 ) / 64; |
460 | 449 | ||
461 | if (var->vmode) { | 450 | if (var->vmode) { |
462 | eprintk("Interlace/Doublescan not supported %#x\n", | 451 | printk(KERN_ERR "sstfb: Interlace/doublescan not supported %#x\n", |
463 | var->vmode); | 452 | var->vmode); |
464 | return -EINVAL; | 453 | return -EINVAL; |
465 | } | 454 | } |
466 | if (((var->xres - 1) >= POW2(10)) || (var->yres >= POW2(10))) { | 455 | if (var->xres > POW2(10) || var->yres >= POW2(10)) { |
467 | eprintk("Unsupported resolution %dx%d\n", | 456 | printk(KERN_ERR "sstfb: Unsupported resolution %dx%d\n", |
468 | var->xres, var->yres); | 457 | var->xres, var->yres); |
469 | return -EINVAL; | 458 | return -EINVAL; |
470 | } | 459 | } |
471 | if (((var->hsync_len - 1) >= POW2(8)) | 460 | if (var->hsync_len > POW2(8) || hSyncOff - 1 > POW2(10) || |
472 | || ((hSyncOff-1) >= POW2(10)) | 461 | var->left_margin - 2 >= POW2(8) || vSyncOn >= POW2(12) || |
473 | || ((var->left_margin - 2) >= POW2(8)) | 462 | vSyncOff >= POW2(12) || vBackPorch >= POW2(8) || |
474 | || (vSyncOn >= POW2(12)) | 463 | tiles_in_X >= POW2(4) || tiles_in_X <= 0) { |
475 | || (vSyncOff >= POW2(12)) | 464 | printk(KERN_ERR "sstfb: Unsupported timings\n"); |
476 | || (vBackPorch >= POW2(8)) | ||
477 | || (tiles_in_X >= POW2(4)) | ||
478 | || (tiles_in_X <= 0)) { | ||
479 | eprintk("Unsupported Timings\n"); | ||
480 | return -EINVAL; | 465 | return -EINVAL; |
481 | } | 466 | } |
482 | } | 467 | } |
@@ -486,8 +471,8 @@ static int sstfb_check_var(struct fb_var_screeninfo *var, | |||
486 | real_length = tiles_in_X * (IS_VOODOO2(par) ? 32 : 64 ) | 471 | real_length = tiles_in_X * (IS_VOODOO2(par) ? 32 : 64 ) |
487 | * ((var->bits_per_pixel == 16) ? 2 : 4); | 472 | * ((var->bits_per_pixel == 16) ? 2 : 4); |
488 | 473 | ||
489 | if ((real_length * yDim) > info->fix.smem_len) { | 474 | if (real_length * yDim > info->fix.smem_len) { |
490 | eprintk("Not enough video memory\n"); | 475 | printk(KERN_ERR "sstfb: Not enough video memory\n"); |
491 | return -ENOMEM; | 476 | return -ENOMEM; |
492 | } | 477 | } |
493 | 478 | ||
@@ -515,20 +500,6 @@ static int sstfb_check_var(struct fb_var_screeninfo *var, | |||
515 | var->blue.offset = 0; | 500 | var->blue.offset = 0; |
516 | var->transp.offset = 0; | 501 | var->transp.offset = 0; |
517 | break; | 502 | break; |
518 | #ifdef EN_24_32_BPP | ||
519 | case 24: /* RGB 888 LfbMode 4 */ | ||
520 | case 32: /* ARGB 8888 LfbMode 5 */ | ||
521 | var->red.length = 8; | ||
522 | var->green.length = 8; | ||
523 | var->blue.length = 8; | ||
524 | var->transp.length = 0; | ||
525 | |||
526 | var->red.offset = 16; | ||
527 | var->green.offset = 8; | ||
528 | var->blue.offset = 0; | ||
529 | var->transp.offset = 0; /* in 24bpp we fake a 32 bpp mode */ | ||
530 | break; | ||
531 | #endif | ||
532 | default: | 503 | default: |
533 | return -EINVAL; | 504 | return -EINVAL; |
534 | } | 505 | } |
@@ -653,13 +624,6 @@ static int sstfb_set_par(struct fb_info *info) | |||
653 | case 16: | 624 | case 16: |
654 | fbiinit1 |= SEL_SOURCE_VCLK_2X_SEL; | 625 | fbiinit1 |= SEL_SOURCE_VCLK_2X_SEL; |
655 | break; | 626 | break; |
656 | #ifdef EN_24_32_BPP | ||
657 | case 24: | ||
658 | case 32: | ||
659 | /* sst_set_bits(FBIINIT1, SEL_SOURCE_VCLK_2X_DIV2 | EN_24BPP);*/ | ||
660 | fbiinit1 |= SEL_SOURCE_VCLK_2X_SEL | EN_24BPP; | ||
661 | break; | ||
662 | #endif | ||
663 | default: | 627 | default: |
664 | return -EINVAL; | 628 | return -EINVAL; |
665 | } | 629 | } |
@@ -690,14 +654,6 @@ static int sstfb_set_par(struct fb_info *info) | |||
690 | case 16: | 654 | case 16: |
691 | lfbmode = LFB_565; | 655 | lfbmode = LFB_565; |
692 | break; | 656 | break; |
693 | #ifdef EN_24_32_BPP | ||
694 | case 24: | ||
695 | lfbmode = LFB_888; | ||
696 | break; | ||
697 | case 32: | ||
698 | lfbmode = LFB_8888; | ||
699 | break; | ||
700 | #endif | ||
701 | default: | 657 | default: |
702 | return -EINVAL; | 658 | return -EINVAL; |
703 | } | 659 | } |
@@ -789,8 +745,7 @@ static int sstfb_ioctl(struct fb_info *info, u_int cmd, u_long arg) | |||
789 | return -EFAULT; | 745 | return -EFAULT; |
790 | if (val > info->fix.smem_len) | 746 | if (val > info->fix.smem_len) |
791 | val = info->fix.smem_len; | 747 | val = info->fix.smem_len; |
792 | printk("filling %#x \n", val); | 748 | for (p = 0 ; p < val; p += 2) |
793 | for (p=0 ; p<val; p+=2) | ||
794 | writew(p >> 6, info->screen_base + p); | 749 | writew(p >> 6, info->screen_base + p); |
795 | return 0; | 750 | return 0; |
796 | 751 | ||
@@ -802,13 +757,10 @@ static int sstfb_ioctl(struct fb_info *info, u_int cmd, u_long arg) | |||
802 | pci_write_config_dword(sst_dev, PCI_INIT_ENABLE, | 757 | pci_write_config_dword(sst_dev, PCI_INIT_ENABLE, |
803 | tmp | PCI_EN_INIT_WR ); | 758 | tmp | PCI_EN_INIT_WR ); |
804 | fbiinit0 = sst_read (FBIINIT0); | 759 | fbiinit0 = sst_read (FBIINIT0); |
805 | if (val) { | 760 | if (val) |
806 | sst_write(FBIINIT0, fbiinit0 & ~EN_VGA_PASSTHROUGH); | 761 | sst_write(FBIINIT0, fbiinit0 & ~EN_VGA_PASSTHROUGH); |
807 | iprintk("Disabling VGA pass-through\n"); | 762 | else |
808 | } else { | ||
809 | sst_write(FBIINIT0, fbiinit0 | EN_VGA_PASSTHROUGH); | 763 | sst_write(FBIINIT0, fbiinit0 | EN_VGA_PASSTHROUGH); |
810 | iprintk("Enabling VGA pass-through\n"); | ||
811 | } | ||
812 | pci_write_config_dword(sst_dev, PCI_INIT_ENABLE, tmp); | 764 | pci_write_config_dword(sst_dev, PCI_INIT_ENABLE, tmp); |
813 | return 0; | 765 | return 0; |
814 | 766 | ||
@@ -884,9 +836,9 @@ static int __devinit sst_get_memsize(struct fb_info *info, __u32 *memsize) | |||
884 | u8 __iomem *fbbase_virt = info->screen_base; | 836 | u8 __iomem *fbbase_virt = info->screen_base; |
885 | 837 | ||
886 | /* force memsize */ | 838 | /* force memsize */ |
887 | if ((mem >= 1 ) && (mem <= 4)) { | 839 | if (mem >= 1 && mem <= 4) { |
888 | *memsize = (mem * 0x100000); | 840 | *memsize = (mem * 0x100000); |
889 | iprintk("supplied memsize: %#x\n", *memsize); | 841 | printk(KERN_INFO "supplied memsize: %#x\n", *memsize); |
890 | return 1; | 842 | return 1; |
891 | } | 843 | } |
892 | 844 | ||
@@ -927,7 +879,7 @@ static int __devinit sst_detect_att(struct fb_info *info) | |||
927 | struct sstfb_par *par = info->par; | 879 | struct sstfb_par *par = info->par; |
928 | int i, mir, dir; | 880 | int i, mir, dir; |
929 | 881 | ||
930 | for (i=0; i<3; i++) { | 882 | for (i = 0; i < 3; i++) { |
931 | sst_dac_write(DACREG_WMA, 0); /* backdoor */ | 883 | sst_dac_write(DACREG_WMA, 0); /* backdoor */ |
932 | sst_dac_read(DACREG_RMR); /* read 4 times RMR */ | 884 | sst_dac_read(DACREG_RMR); /* read 4 times RMR */ |
933 | sst_dac_read(DACREG_RMR); | 885 | sst_dac_read(DACREG_RMR); |
@@ -940,7 +892,7 @@ static int __devinit sst_detect_att(struct fb_info *info) | |||
940 | /*the 7th, device ID register */ | 892 | /*the 7th, device ID register */ |
941 | dir = sst_dac_read(DACREG_RMR); | 893 | dir = sst_dac_read(DACREG_RMR); |
942 | f_ddprintk("mir: %#x, dir: %#x\n", mir, dir); | 894 | f_ddprintk("mir: %#x, dir: %#x\n", mir, dir); |
943 | if ((mir == DACREG_MIR_ATT ) && (dir == DACREG_DIR_ATT)) { | 895 | if (mir == DACREG_MIR_ATT && dir == DACREG_DIR_ATT) { |
944 | return 1; | 896 | return 1; |
945 | } | 897 | } |
946 | } | 898 | } |
@@ -1134,12 +1086,6 @@ static void sst_set_vidmod_att_ti(struct fb_info *info, const int bpp) | |||
1134 | case 16: | 1086 | case 16: |
1135 | sst_dac_write(DACREG_RMR, (cr0 & 0x0f) | DACREG_CR0_16BPP); | 1087 | sst_dac_write(DACREG_RMR, (cr0 & 0x0f) | DACREG_CR0_16BPP); |
1136 | break; | 1088 | break; |
1137 | #ifdef EN_24_32_BPP | ||
1138 | case 24: | ||
1139 | case 32: | ||
1140 | sst_dac_write(DACREG_RMR, (cr0 & 0x0f) | DACREG_CR0_24BPP); | ||
1141 | break; | ||
1142 | #endif | ||
1143 | default: | 1089 | default: |
1144 | dprintk("%s: bad depth '%u'\n", __FUNCTION__, bpp); | 1090 | dprintk("%s: bad depth '%u'\n", __FUNCTION__, bpp); |
1145 | break; | 1091 | break; |
@@ -1154,12 +1100,6 @@ static void sst_set_vidmod_ics(struct fb_info *info, const int bpp) | |||
1154 | case 16: | 1100 | case 16: |
1155 | sst_dac_write(DACREG_ICS_CMD, DACREG_ICS_CMD_16BPP); | 1101 | sst_dac_write(DACREG_ICS_CMD, DACREG_ICS_CMD_16BPP); |
1156 | break; | 1102 | break; |
1157 | #ifdef EN_24_32_BPP | ||
1158 | case 24: | ||
1159 | case 32: | ||
1160 | sst_dac_write(DACREG_ICS_CMD, DACREG_ICS_CMD_24BPP); | ||
1161 | break; | ||
1162 | #endif | ||
1163 | default: | 1103 | default: |
1164 | dprintk("%s: bad depth '%u'\n", __FUNCTION__, bpp); | 1104 | dprintk("%s: bad depth '%u'\n", __FUNCTION__, bpp); |
1165 | break; | 1105 | break; |
@@ -1250,7 +1190,7 @@ static int __devinit sst_init(struct fb_info *info, struct sstfb_par *par) | |||
1250 | PCI_EN_INIT_WR | PCI_REMAP_DAC ); | 1190 | PCI_EN_INIT_WR | PCI_REMAP_DAC ); |
1251 | /* detect dac type */ | 1191 | /* detect dac type */ |
1252 | if (!sst_detect_dactype(info, par)) { | 1192 | if (!sst_detect_dactype(info, par)) { |
1253 | eprintk("Unknown dac type\n"); | 1193 | printk(KERN_ERR "sstfb: unknown dac type.\n"); |
1254 | //FIXME watch it: we are not in a safe state, bad bad bad. | 1194 | //FIXME watch it: we are not in a safe state, bad bad bad. |
1255 | return 0; | 1195 | return 0; |
1256 | } | 1196 | } |
@@ -1258,10 +1198,10 @@ static int __devinit sst_init(struct fb_info *info, struct sstfb_par *par) | |||
1258 | /* set graphic clock */ | 1198 | /* set graphic clock */ |
1259 | par->gfx_clock = spec->default_gfx_clock; | 1199 | par->gfx_clock = spec->default_gfx_clock; |
1260 | if ((gfxclk >10 ) && (gfxclk < spec->max_gfxclk)) { | 1200 | if ((gfxclk >10 ) && (gfxclk < spec->max_gfxclk)) { |
1261 | iprintk("Using supplied graphic freq : %dMHz\n", gfxclk); | 1201 | printk(KERN_INFO "sstfb: Using supplied graphic freq : %dMHz\n", gfxclk); |
1262 | par->gfx_clock = gfxclk *1000; | 1202 | par->gfx_clock = gfxclk *1000; |
1263 | } else if (gfxclk) { | 1203 | } else if (gfxclk) { |
1264 | wprintk ("%dMhz is way out of spec! Using default\n", gfxclk); | 1204 | printk(KERN_WARNING "sstfb: %dMhz is way out of spec! Using default\n", gfxclk); |
1265 | } | 1205 | } |
1266 | 1206 | ||
1267 | sst_calc_pll(par->gfx_clock, &Fout, &gfx_timings); | 1207 | sst_calc_pll(par->gfx_clock, &Fout, &gfx_timings); |
@@ -1396,7 +1336,7 @@ static int __devinit sstfb_probe(struct pci_dev *pdev, | |||
1396 | 1336 | ||
1397 | /* Enable device in PCI config. */ | 1337 | /* Enable device in PCI config. */ |
1398 | if ((err=pci_enable_device(pdev))) { | 1338 | if ((err=pci_enable_device(pdev))) { |
1399 | eprintk("cannot enable device\n"); | 1339 | printk(KERN_ERR "cannot enable device\n"); |
1400 | return err; | 1340 | return err; |
1401 | } | 1341 | } |
1402 | 1342 | ||
@@ -1422,39 +1362,39 @@ static int __devinit sstfb_probe(struct pci_dev *pdev, | |||
1422 | fix->smem_start = fix->mmio_start + 0x400000; | 1362 | fix->smem_start = fix->mmio_start + 0x400000; |
1423 | 1363 | ||
1424 | if (!request_mem_region(fix->mmio_start, fix->mmio_len, "sstfb MMIO")) { | 1364 | if (!request_mem_region(fix->mmio_start, fix->mmio_len, "sstfb MMIO")) { |
1425 | eprintk("cannot reserve mmio memory\n"); | 1365 | printk(KERN_ERR "sstfb: cannot reserve mmio memory\n"); |
1426 | goto fail_mmio_mem; | 1366 | goto fail_mmio_mem; |
1427 | } | 1367 | } |
1428 | 1368 | ||
1429 | if (!request_mem_region(fix->smem_start, 0x400000,"sstfb FB")) { | 1369 | if (!request_mem_region(fix->smem_start, 0x400000,"sstfb FB")) { |
1430 | eprintk("cannot reserve fb memory\n"); | 1370 | printk(KERN_ERR "sstfb: cannot reserve fb memory\n"); |
1431 | goto fail_fb_mem; | 1371 | goto fail_fb_mem; |
1432 | } | 1372 | } |
1433 | 1373 | ||
1434 | par->mmio_vbase = ioremap_nocache(fix->mmio_start, | 1374 | par->mmio_vbase = ioremap_nocache(fix->mmio_start, |
1435 | fix->mmio_len); | 1375 | fix->mmio_len); |
1436 | if (!par->mmio_vbase) { | 1376 | if (!par->mmio_vbase) { |
1437 | eprintk("cannot remap register area %#lx\n", | 1377 | printk(KERN_ERR "sstfb: cannot remap register area %#lx\n", |
1438 | fix->mmio_start); | 1378 | fix->mmio_start); |
1439 | goto fail_mmio_remap; | 1379 | goto fail_mmio_remap; |
1440 | } | 1380 | } |
1441 | info->screen_base = ioremap_nocache(fix->smem_start, 0x400000); | 1381 | info->screen_base = ioremap_nocache(fix->smem_start, 0x400000); |
1442 | if (!info->screen_base) { | 1382 | if (!info->screen_base) { |
1443 | eprintk("cannot remap framebuffer %#lx\n", | 1383 | printk(KERN_ERR "sstfb: cannot remap framebuffer %#lx\n", |
1444 | fix->smem_start); | 1384 | fix->smem_start); |
1445 | goto fail_fb_remap; | 1385 | goto fail_fb_remap; |
1446 | } | 1386 | } |
1447 | 1387 | ||
1448 | if (!sst_init(info, par)) { | 1388 | if (!sst_init(info, par)) { |
1449 | eprintk("Init failed\n"); | 1389 | printk(KERN_ERR "sstfb: Init failed\n"); |
1450 | goto fail; | 1390 | goto fail; |
1451 | } | 1391 | } |
1452 | sst_get_memsize(info, &fix->smem_len); | 1392 | sst_get_memsize(info, &fix->smem_len); |
1453 | strlcpy(fix->id, spec->name, sizeof(fix->id)); | 1393 | strlcpy(fix->id, spec->name, sizeof(fix->id)); |
1454 | 1394 | ||
1455 | iprintk("%s (revision %d) with %s dac\n", | 1395 | printk(KERN_INFO "%s (revision %d) with %s dac\n", |
1456 | fix->id, par->revision, par->dac_sw.name); | 1396 | fix->id, par->revision, par->dac_sw.name); |
1457 | iprintk("framebuffer at %#lx, mapped to 0x%p, size %dMB\n", | 1397 | printk(KERN_INFO "framebuffer at %#lx, mapped to 0x%p, size %dMB\n", |
1458 | fix->smem_start, info->screen_base, | 1398 | fix->smem_start, info->screen_base, |
1459 | fix->smem_len >> 20); | 1399 | fix->smem_len >> 20); |
1460 | 1400 | ||
@@ -1471,24 +1411,25 @@ static int __devinit sstfb_probe(struct pci_dev *pdev, | |||
1471 | fix->accel = FB_ACCEL_NONE; /* FIXME */ | 1411 | fix->accel = FB_ACCEL_NONE; /* FIXME */ |
1472 | /* | 1412 | /* |
1473 | * According to the specs, the linelength must be of 1024 *pixels* | 1413 | * According to the specs, the linelength must be of 1024 *pixels* |
1474 | * and the 24bpp mode is in fact a 32 bpp mode. | 1414 | * and the 24bpp mode is in fact a 32 bpp mode (and both are in |
1415 | * fact dithered to 16bit). | ||
1475 | */ | 1416 | */ |
1476 | fix->line_length = 2048; /* default value, for 24 or 32bit: 4096 */ | 1417 | fix->line_length = 2048; /* default value, for 24 or 32bit: 4096 */ |
1477 | 1418 | ||
1478 | if ( mode_option && | 1419 | if ( mode_option && |
1479 | fb_find_mode(&info->var, info, mode_option, NULL, 0, NULL, 16)) { | 1420 | fb_find_mode(&info->var, info, mode_option, NULL, 0, NULL, 16)) { |
1480 | eprintk("can't set supplied video mode. Using default\n"); | 1421 | printk(KERN_ERR "sstfb: can't set supplied video mode. Using default\n"); |
1481 | info->var = sstfb_default; | 1422 | info->var = sstfb_default; |
1482 | } else | 1423 | } else |
1483 | info->var = sstfb_default; | 1424 | info->var = sstfb_default; |
1484 | 1425 | ||
1485 | if (sstfb_check_var(&info->var, info)) { | 1426 | if (sstfb_check_var(&info->var, info)) { |
1486 | eprintk("invalid default video mode.\n"); | 1427 | printk(KERN_ERR "sstfb: invalid default video mode.\n"); |
1487 | goto fail; | 1428 | goto fail; |
1488 | } | 1429 | } |
1489 | 1430 | ||
1490 | if (sstfb_set_par(info)) { | 1431 | if (sstfb_set_par(info)) { |
1491 | eprintk("can't set default video mode.\n"); | 1432 | printk(KERN_ERR "sstfb: can't set default video mode.\n"); |
1492 | goto fail; | 1433 | goto fail; |
1493 | } | 1434 | } |
1494 | 1435 | ||
@@ -1497,7 +1438,7 @@ static int __devinit sstfb_probe(struct pci_dev *pdev, | |||
1497 | /* register fb */ | 1438 | /* register fb */ |
1498 | info->device = &pdev->dev; | 1439 | info->device = &pdev->dev; |
1499 | if (register_framebuffer(info) < 0) { | 1440 | if (register_framebuffer(info) < 0) { |
1500 | eprintk("can't register framebuffer.\n"); | 1441 | printk(KERN_ERR "sstfb: can't register framebuffer.\n"); |
1501 | goto fail; | 1442 | goto fail; |
1502 | } | 1443 | } |
1503 | 1444 | ||
@@ -1711,4 +1652,3 @@ module_param(gfxclk, int, 0); | |||
1711 | MODULE_PARM_DESC(gfxclk, "Force graphic chip frequency in MHz. DANGEROUS. (default=auto)"); | 1652 | MODULE_PARM_DESC(gfxclk, "Force graphic chip frequency in MHz. DANGEROUS. (default=auto)"); |
1712 | module_param(slowpci, bool, 0); | 1653 | module_param(slowpci, bool, 0); |
1713 | MODULE_PARM_DESC(slowpci, "Uses slow PCI settings (0 or 1) (default=0)"); | 1654 | MODULE_PARM_DESC(slowpci, "Uses slow PCI settings (0 or 1) (default=0)"); |
1714 | |||