aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/cirrusfb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/cirrusfb.c')
-rw-r--r--drivers/video/cirrusfb.c45
1 files changed, 15 insertions, 30 deletions
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index 56306658c01e..ce22bf5de350 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -45,7 +45,6 @@
45#include <linux/delay.h> 45#include <linux/delay.h>
46#include <linux/fb.h> 46#include <linux/fb.h>
47#include <linux/init.h> 47#include <linux/init.h>
48#include <linux/selection.h>
49#include <asm/pgtable.h> 48#include <asm/pgtable.h>
50 49
51#ifdef CONFIG_ZORRO 50#ifdef CONFIG_ZORRO
@@ -64,8 +63,8 @@
64#define isPReP 0 63#define isPReP 0
65#endif 64#endif
66 65
67#include "video/vga.h" 66#include <video/vga.h>
68#include "video/cirrus.h" 67#include <video/cirrus.h>
69 68
70/***************************************************************** 69/*****************************************************************
71 * 70 *
@@ -99,9 +98,6 @@
99#endif 98#endif
100 99
101#define MB_ (1024 * 1024) 100#define MB_ (1024 * 1024)
102#define KB_ (1024)
103
104#define MAX_NUM_BOARDS 7
105 101
106/***************************************************************** 102/*****************************************************************
107 * 103 *
@@ -331,10 +327,6 @@ static const struct {
331#endif /* CONFIG_ZORRO */ 327#endif /* CONFIG_ZORRO */
332 328
333struct cirrusfb_regs { 329struct cirrusfb_regs {
334 __u32 line_length; /* in BYTES! */
335 __u32 visual;
336 __u32 type;
337
338 long freq; 330 long freq;
339 long nom; 331 long nom;
340 long den; 332 long den;
@@ -525,7 +517,7 @@ static struct fb_ops cirrusfb_ops = {
525/*--- Hardware Specific Routines -------------------------------------------*/ 517/*--- Hardware Specific Routines -------------------------------------------*/
526static int cirrusfb_decode_var(const struct fb_var_screeninfo *var, 518static int cirrusfb_decode_var(const struct fb_var_screeninfo *var,
527 struct cirrusfb_regs *regs, 519 struct cirrusfb_regs *regs,
528 const struct fb_info *info); 520 struct fb_info *info);
529/*--- Internal routines ----------------------------------------------------*/ 521/*--- Internal routines ----------------------------------------------------*/
530static void init_vgachip(struct fb_info *info); 522static void init_vgachip(struct fb_info *info);
531static void switch_monitor(struct cirrusfb_info *cinfo, int on); 523static void switch_monitor(struct cirrusfb_info *cinfo, int on);
@@ -792,7 +784,7 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var,
792 784
793static int cirrusfb_decode_var(const struct fb_var_screeninfo *var, 785static int cirrusfb_decode_var(const struct fb_var_screeninfo *var,
794 struct cirrusfb_regs *regs, 786 struct cirrusfb_regs *regs,
795 const struct fb_info *info) 787 struct fb_info *info)
796{ 788{
797 long freq; 789 long freq;
798 long maxclock; 790 long maxclock;
@@ -803,20 +795,20 @@ static int cirrusfb_decode_var(const struct fb_var_screeninfo *var,
803 795
804 switch (var->bits_per_pixel) { 796 switch (var->bits_per_pixel) {
805 case 1: 797 case 1:
806 regs->line_length = var->xres_virtual / 8; 798 info->fix.line_length = var->xres_virtual / 8;
807 regs->visual = FB_VISUAL_MONO10; 799 info->fix.visual = FB_VISUAL_MONO10;
808 break; 800 break;
809 801
810 case 8: 802 case 8:
811 regs->line_length = var->xres_virtual; 803 info->fix.line_length = var->xres_virtual;
812 regs->visual = FB_VISUAL_PSEUDOCOLOR; 804 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
813 break; 805 break;
814 806
815 case 16: 807 case 16:
816 case 24: 808 case 24:
817 case 32: 809 case 32:
818 regs->line_length = var->xres_virtual * maxclockidx; 810 info->fix.line_length = var->xres_virtual * maxclockidx;
819 regs->visual = FB_VISUAL_DIRECTCOLOR; 811 info->fix.visual = FB_VISUAL_DIRECTCOLOR;
820 break; 812 break;
821 813
822 default: 814 default:
@@ -826,7 +818,7 @@ static int cirrusfb_decode_var(const struct fb_var_screeninfo *var,
826 break; 818 break;
827 } 819 }
828 820
829 regs->type = FB_TYPE_PACKED_PIXELS; 821 info->fix.type = FB_TYPE_PACKED_PIXELS;
830 822
831 /* convert from ps to kHz */ 823 /* convert from ps to kHz */
832 freq = PICOS2KHZ(var->pixclock); 824 freq = PICOS2KHZ(var->pixclock);
@@ -1539,9 +1531,6 @@ static int cirrusfb_set_par_foo(struct fb_info *info)
1539 DPRINTK("CL_SEQR1: %d\n", tmp); 1531 DPRINTK("CL_SEQR1: %d\n", tmp);
1540 1532
1541 cinfo->currentmode = regs; 1533 cinfo->currentmode = regs;
1542 info->fix.type = regs.type;
1543 info->fix.visual = regs.visual;
1544 info->fix.line_length = regs.line_length;
1545 1534
1546 /* pan to requested offset */ 1535 /* pan to requested offset */
1547 cirrusfb_pan_display(var, info); 1536 cirrusfb_pan_display(var, info);
@@ -1622,7 +1611,7 @@ static int cirrusfb_pan_display(struct fb_var_screeninfo *var,
1622 xoffset = var->xoffset * info->var.bits_per_pixel / 8; 1611 xoffset = var->xoffset * info->var.bits_per_pixel / 8;
1623 yoffset = var->yoffset; 1612 yoffset = var->yoffset;
1624 1613
1625 base = yoffset * cinfo->currentmode.line_length + xoffset; 1614 base = yoffset * info->fix.line_length + xoffset;
1626 1615
1627 if (info->var.bits_per_pixel == 1) { 1616 if (info->var.bits_per_pixel == 1) {
1628 /* base is already correct */ 1617 /* base is already correct */
@@ -2081,7 +2070,7 @@ static void cirrusfb_fillrect(struct fb_info *info,
2081 (region->dx * m) / 8, region->dy, 2070 (region->dx * m) / 8, region->dy,
2082 (region->width * m) / 8, region->height, 2071 (region->width * m) / 8, region->height,
2083 color, 2072 color,
2084 cinfo->currentmode.line_length); 2073 info->fix.line_length);
2085} 2074}
2086 2075
2087static void cirrusfb_copyarea(struct fb_info *info, 2076static void cirrusfb_copyarea(struct fb_info *info,
@@ -2121,7 +2110,7 @@ static void cirrusfb_copyarea(struct fb_info *info,
2121 (area->sx * m) / 8, area->sy, 2110 (area->sx * m) / 8, area->sy,
2122 (area->dx * m) / 8, area->dy, 2111 (area->dx * m) / 8, area->dy,
2123 (area->width * m) / 8, area->height, 2112 (area->width * m) / 8, area->height,
2124 cinfo->currentmode.line_length); 2113 info->fix.line_length);
2125 2114
2126} 2115}
2127 2116
@@ -2281,13 +2270,10 @@ static int cirrusfb_set_fbinfo(struct fb_info *info)
2281 info->fix.smem_len = info->screen_size; 2270 info->fix.smem_len = info->screen_size;
2282 if (var->bits_per_pixel == 1) 2271 if (var->bits_per_pixel == 1)
2283 info->fix.smem_len /= 4; 2272 info->fix.smem_len /= 4;
2284 info->fix.type = cinfo->currentmode.type;
2285 info->fix.type_aux = 0; 2273 info->fix.type_aux = 0;
2286 info->fix.visual = cinfo->currentmode.visual;
2287 info->fix.xpanstep = 1; 2274 info->fix.xpanstep = 1;
2288 info->fix.ypanstep = 1; 2275 info->fix.ypanstep = 1;
2289 info->fix.ywrapstep = 0; 2276 info->fix.ywrapstep = 0;
2290 info->fix.line_length = cinfo->currentmode.line_length;
2291 2277
2292 /* FIXME: map region at 0xB8000 if available, fill in here */ 2278 /* FIXME: map region at 0xB8000 if available, fill in here */
2293 info->fix.mmio_len = 0; 2279 info->fix.mmio_len = 0;
@@ -2446,7 +2432,7 @@ static int cirrusfb_pci_register(struct pci_dev *pdev,
2446 cinfo->unmap = cirrusfb_pci_unmap; 2432 cinfo->unmap = cirrusfb_pci_unmap;
2447 2433
2448 printk(KERN_INFO " RAM (%lu kB) at 0xx%lx, ", 2434 printk(KERN_INFO " RAM (%lu kB) at 0xx%lx, ",
2449 info->screen_size / KB_, board_addr); 2435 info->screen_size >> 10, board_addr);
2450 printk(KERN_INFO "Cirrus Logic chipset on PCI bus\n"); 2436 printk(KERN_INFO "Cirrus Logic chipset on PCI bus\n");
2451 pci_set_drvdata(pdev, info); 2437 pci_set_drvdata(pdev, info);
2452 2438
@@ -2520,7 +2506,6 @@ static int cirrusfb_zorro_register(struct zorro_dev *z,
2520 } 2506 }
2521 2507
2522 cinfo = info->par; 2508 cinfo = info->par;
2523 cinfo->info = info;
2524 cinfo->btype = btype; 2509 cinfo->btype = btype;
2525 2510
2526 assert(z > 0); 2511 assert(z > 0);