2 * drivers/video/imsttfb.c -- frame buffer device for IMS TwinTurbo
4 * This file is derived from the powermac console "imstt" driver:
5 * Copyright (C) 1997 Sigurdur Asgeirsson
6 * With additional hacking by Jeffrey Kuskin (jsk@mojave.stanford.edu)
7 * Modified by Danilo Beuche 1998
8 * Some register values added by Damien Doligez, INRIA Rocquencourt
10 * This file was written by Ryan Nielsen (ran@krazynet.com)
11 * Most of the frame buffer device stuff was copied from atyfb.c
13 * This file is subject to the terms and conditions of the GNU General Public
14 * License. See the file COPYING in the main directory of this archive for
18 #include <linux/config.h>
19 #include <linux/module.h>
20 #include <linux/kernel.h>
21 #include <linux/errno.h>
22 #include <linux/string.h>
24 #include <linux/tty.h>
25 #include <linux/malloc.h>
26 #include <linux/vmalloc.h>
27 #include <linux/delay.h>
28 #include <linux/interrupt.h>
30 #include <linux/console.h>
31 #include <linux/selection.h>
32 #include <linux/init.h>
33 #include <linux/pci.h>
35 #include <asm/uaccess.h>
37 #if defined(CONFIG_PPC)
38 #include <linux/nvram.h>
40 #include <asm/pci-bridge.h>
41 #include <video/macmodes.h>
44 #include <video/fbcon.h>
45 #include <video/fbcon-cfb8.h>
46 #include <video/fbcon-cfb16.h>
47 #include <video/fbcon-cfb24.h>
48 #include <video/fbcon-cfb32.h>
51 #define eieio() /* Enforce In-order Execution of I/O */
54 /* TwinTurbo (Cosmo) registers */
61 DP_OCTL
= 5, /* 0x14 */
65 BLTCTL
= 10, /* 0x28 */
67 /* Scan Timing Generator Registers */
80 STGCTL
= 24, /* 0x60 */
82 /* Screen Refresh Generator Registers */
87 SRGCTL
= 29, /* 0x74 */
89 /* RAM Refresh Generator Registers */
90 RRCIV
= 30, /* 0x78 */
94 /* System Registers */
98 SSTATUS
= 36, /* 0x90 */
112 /* IBM 624 RAMDAC Direct Registers */
124 /* IBM 624 RAMDAC Indirect Registers */
126 CLKCTL
= 0x02, /* (0x01) Miscellaneous Clock Control */
127 SYNCCTL
= 0x03, /* (0x00) Sync Control */
128 HSYNCPOS
= 0x04, /* (0x00) Horizontal Sync Position */
129 PWRMNGMT
= 0x05, /* (0x00) Power Management */
130 DACOP
= 0x06, /* (0x02) DAC Operation */
131 PALETCTL
= 0x07, /* (0x00) Palette Control */
132 SYSCLKCTL
= 0x08, /* (0x01) System Clock Control */
133 PIXFMT
= 0x0a, /* () Pixel Format [bpp >> 3 + 2] */
134 BPP8
= 0x0b, /* () 8 Bits/Pixel Control */
135 BPP16
= 0x0c, /* () 16 Bits/Pixel Control [bit 1=1 for 565] */
136 BPP24
= 0x0d, /* () 24 Bits/Pixel Control */
137 BPP32
= 0x0e, /* () 32 Bits/Pixel Control */
138 PIXCTL1
= 0x10, /* (0x05) Pixel PLL Control 1 */
139 PIXCTL2
= 0x11, /* (0x00) Pixel PLL Control 2 */
140 SYSCLKN
= 0x15, /* () System Clock N (System PLL Reference Divider) */
141 SYSCLKM
= 0x16, /* () System Clock M (System PLL VCO Divider) */
142 SYSCLKP
= 0x17, /* () System Clock P */
143 SYSCLKC
= 0x18, /* () System Clock C */
145 * Dot clock rate is 20MHz * (m + 1) / ((n + 1) * (p ? 2 * p : 1)
146 * c is charge pump bias which depends on the VCO frequency
148 PIXM0
= 0x20, /* () Pixel M 0 */
149 PIXN0
= 0x21, /* () Pixel N 0 */
150 PIXP0
= 0x22, /* () Pixel P 0 */
151 PIXC0
= 0x23, /* () Pixel C 0 */
152 CURSCTL
= 0x30, /* (0x00) Cursor Control */
153 CURSXLO
= 0x31, /* () Cursor X position, low 8 bits */
154 CURSXHI
= 0x32, /* () Cursor X position, high 8 bits */
155 CURSYLO
= 0x33, /* () Cursor Y position, low 8 bits */
156 CURSYHI
= 0x34, /* () Cursor Y position, high 8 bits */
157 CURSHOTX
= 0x35, /* () Cursor Hot Spot X */
158 CURSHOTY
= 0x36, /* () Cursor Hot Spot Y */
159 CURSACCTL
= 0x37, /* () Advanced Cursor Control Enable */
160 CURSACATTR
= 0x38, /* () Advanced Cursor Attribute */
161 CURS1R
= 0x40, /* () Cursor 1 Red */
162 CURS1G
= 0x41, /* () Cursor 1 Green */
163 CURS1B
= 0x42, /* () Cursor 1 Blue */
164 CURS2R
= 0x43, /* () Cursor 2 Red */
165 CURS2G
= 0x44, /* () Cursor 2 Green */
166 CURS2B
= 0x45, /* () Cursor 2 Blue */
167 CURS3R
= 0x46, /* () Cursor 3 Red */
168 CURS3G
= 0x47, /* () Cursor 3 Green */
169 CURS3B
= 0x48, /* () Cursor 3 Blue */
170 BORDR
= 0x60, /* () Border Color Red */
171 BORDG
= 0x61, /* () Border Color Green */
172 BORDB
= 0x62, /* () Border Color Blue */
173 MISCTL1
= 0x70, /* (0x00) Miscellaneous Control 1 */
174 MISCTL2
= 0x71, /* (0x00) Miscellaneous Control 2 */
175 MISCTL3
= 0x72, /* (0x00) Miscellaneous Control 3 */
176 KEYCTL
= 0x78 /* (0x00) Key Control/DB Operation */
179 /* TI TVP 3030 RAMDAC Direct Registers */
181 TVPADDRW
= 0x00, /* 0 Palette/Cursor RAM Write Adress/Index */
182 TVPPDATA
= 0x04, /* 1 Palette Data RAM Data */
183 TVPPMASK
= 0x08, /* 2 Pixel Read-Mask */
184 TVPPADRR
= 0x0c, /* 3 Palette/Cursor RAM Read Adress */
185 TVPCADRW
= 0x10, /* 4 Cursor/Overscan Color Write Address */
186 TVPCDATA
= 0x14, /* 5 Cursor/Overscan Color Data */
188 TVPCADRR
= 0x1c, /* 7 Cursor/Overscan Color Read Address */
190 TVPDCCTL
= 0x24, /* 9 Direct Cursor Control */
191 TVPIDATA
= 0x28, /* 10 Index Data */
192 TVPCRDAT
= 0x2c, /* 11 Cursor RAM Data */
193 TVPCXPOL
= 0x30, /* 12 Cursor-Position X LSB */
194 TVPCXPOH
= 0x34, /* 13 Cursor-Position X MSB */
195 TVPCYPOL
= 0x38, /* 14 Cursor-Position Y LSB */
196 TVPCYPOH
= 0x3c, /* 15 Cursor-Position Y MSB */
199 /* TI TVP 3030 RAMDAC Indirect Registers */
201 TVPIRREV
= 0x01, /* Silicon Revision [RO] */
202 TVPIRICC
= 0x06, /* Indirect Cursor Control (0x00) */
203 TVPIRBRC
= 0x07, /* Byte Router Control (0xe4) */
204 TVPIRLAC
= 0x0f, /* Latch Control (0x06) */
205 TVPIRTCC
= 0x18, /* True Color Control (0x80) */
206 TVPIRMXC
= 0x19, /* Multiplex Control (0x98) */
207 TVPIRCLS
= 0x1a, /* Clock Selection (0x07) */
208 TVPIRPPG
= 0x1c, /* Palette Page (0x00) */
209 TVPIRGEC
= 0x1d, /* General Control (0x00) */
210 TVPIRMIC
= 0x1e, /* Miscellaneous Control (0x00) */
211 TVPIRPLA
= 0x2c, /* PLL Address */
212 TVPIRPPD
= 0x2d, /* Pixel Clock PLL Data */
213 TVPIRMPD
= 0x2e, /* Memory Clock PLL Data */
214 TVPIRLPD
= 0x2f, /* Loop Clock PLL Data */
215 TVPIRCKL
= 0x30, /* Color-Key Overlay Low */
216 TVPIRCKH
= 0x31, /* Color-Key Overlay High */
217 TVPIRCRL
= 0x32, /* Color-Key Red Low */
218 TVPIRCRH
= 0x33, /* Color-Key Red High */
219 TVPIRCGL
= 0x34, /* Color-Key Green Low */
220 TVPIRCGH
= 0x35, /* Color-Key Green High */
221 TVPIRCBL
= 0x36, /* Color-Key Blue Low */
222 TVPIRCBH
= 0x37, /* Color-Key Blue High */
223 TVPIRCKC
= 0x38, /* Color-Key Control (0x00) */
224 TVPIRMLC
= 0x39, /* MCLK/Loop Clock Control (0x18) */
225 TVPIRSEN
= 0x3a, /* Sense Test (0x00) */
226 TVPIRTMD
= 0x3b, /* Test Mode Data */
227 TVPIRRML
= 0x3c, /* CRC Remainder LSB [RO] */
228 TVPIRRMM
= 0x3d, /* CRC Remainder MSB [RO] */
229 TVPIRRMS
= 0x3e, /* CRC Bit Select [WO] */
230 TVPIRDID
= 0x3f, /* Device ID [RO] (0x30) */
231 TVPIRRES
= 0xff /* Software Reset [WO] */
238 static struct initvalues ibm_initregs
[] __initdata
= {
248 * Note that colors in X are correct only if all video data is
249 * passed through the palette in the DAC. That is, "indirect
250 * color" must be configured. This is the case for the IBM DAC
251 * used in the 2MB and 4MB cards, at least.
266 { CURSACATTR
, 0xa8 },
285 static struct initvalues tvp_initregs
[] __initdata
= {
318 struct imstt_regvals
{
320 __u16 hes
, heb
, hsb
, ht
, ves
, veb
, vsb
, vt
, vil
;
321 __u8 pclk_m
, pclk_n
, pclk_p
;
322 /* Values of the tvp which change depending on colormode x resolution */
323 __u8 mlc
[3]; /* Memory Loop Config 0x39 */
324 __u8 lckl_p
[3]; /* P value of LCKL PLL */
327 struct imstt_cursor
{
328 struct timer_list timer
;
333 __u16 x
, y
, width
, height
;
336 struct fb_info_imstt
{
338 struct fb_fix_screeninfo fix
;
340 struct display_switch dispsw
;
342 #ifdef FBCON_HAS_CFB16
345 #ifdef FBCON_HAS_CFB24
348 #ifdef FBCON_HAS_CFB32
353 __u8 red
, green
, blue
;
355 struct imstt_regvals init
;
356 struct imstt_cursor cursor
;
357 __u8
*frame_buffer_phys
, *frame_buffer
;
358 __u32
*dc_regs_phys
, *dc_regs
;
359 __u8
*cmap_regs_phys
, *cmap_regs
;
369 #define USE_NV_MODES 1
371 #define INIT_XRES 640
372 #define INIT_YRES 480
373 #define CURSOR_BLINK_RATE 20
374 #define CURSOR_DRAW_DELAY 2
376 static int currcon
= 0;
377 static char fontname
[40] __initdata
= { 0 };
378 static char curblink __initdata
= 1;
379 static char noaccel __initdata
= 0;
380 #if defined(CONFIG_PPC)
381 static signed char init_vmode __initdata
= -1, init_cmode __initdata
= -1;
384 static struct fb_info_imstt
*fb_info_imstt_p
[FB_MAX
] = { 0, 0, 0, 0, 0, 0, 0, 0 };
387 static struct imstt_regvals tvp_reg_init_2
= {
389 0x0002, 0x0006, 0x0026, 0x0028, 0x0003, 0x0016, 0x0196, 0x0197, 0x0196,
391 { 0x3c, 0x3b, 0x39 }, { 0xf3, 0xf3, 0xf3 }
394 static struct imstt_regvals tvp_reg_init_6
= {
396 0x0004, 0x0009, 0x0031, 0x0036, 0x0003, 0x002a, 0x020a, 0x020d, 0x020a,
398 { 0x39, 0x39, 0x38 }, { 0xf3, 0xf3, 0xf3 }
401 static struct imstt_regvals tvp_reg_init_12
= {
403 0x0005, 0x000e, 0x0040, 0x0042, 0x0003, 0x018, 0x270, 0x271, 0x270,
405 { 0x3a, 0x39, 0x38 }, { 0xf3, 0xf3, 0xf3 }
408 static struct imstt_regvals tvp_reg_init_13
= {
410 0x0004, 0x0011, 0x0045, 0x0048, 0x0003, 0x002a, 0x029a, 0x029b, 0x0000,
412 { 0x39, 0x38, 0x38 }, { 0xf3, 0xf3, 0xf2 }
415 static struct imstt_regvals tvp_reg_init_17
= {
417 0x0006, 0x0210, 0x0250, 0x0053, 0x1003, 0x0021, 0x0321, 0x0324, 0x0000,
419 { 0x39, 0x38, 0x38 }, { 0xf3, 0xf3, 0xf2 }
422 static struct imstt_regvals tvp_reg_init_18
= {
424 0x0009, 0x0011, 0x059, 0x5b, 0x0003, 0x0031, 0x0397, 0x039a, 0x0000,
426 { 0x39, 0x38, 0x38 }, { 0xf3, 0xf3, 0xf2 }
429 static struct imstt_regvals tvp_reg_init_19
= {
431 0x0009, 0x0016, 0x0066, 0x0069, 0x0003, 0x0027, 0x03e7, 0x03e8, 0x03e7,
433 { 0x38, 0x38, 0x38 }, { 0xf3, 0xf2, 0xf1 }
436 static struct imstt_regvals tvp_reg_init_20
= {
438 0x0009, 0x0018, 0x0068, 0x006a, 0x0003, 0x0029, 0x0429, 0x042a, 0x0000,
440 { 0x38, 0x38, 0x38 }, { 0xf3, 0xf2, 0xf1 }
444 getclkMHz (struct fb_info_imstt
*p
)
446 __u32 clk_m
, clk_n
, clk_p
;
448 clk_m
= p
->init
.pclk_m
;
449 clk_n
= p
->init
.pclk_n
;
450 clk_p
= p
->init
.pclk_p
;
452 return 20 * (clk_m
+ 1) / ((clk_n
+ 1) * (clk_p
? 2 * clk_p
: 1));
456 setclkMHz (struct fb_info_imstt
*p
, __u32 MHz
)
458 __u32 clk_m
, clk_n
, clk_p
, x
, stage
, spilled
;
460 clk_m
= clk_n
= clk_p
= 0;
471 x
= 20 * (clk_m
+ 1) / ((clk_n
+ 1) * (clk_p
? 2 * clk_p
: 1));
477 } else if (spilled
&& x
< MHz
) {
482 p
->init
.pclk_m
= clk_m
;
483 p
->init
.pclk_n
= clk_n
;
484 p
->init
.pclk_p
= clk_p
;
487 static struct imstt_regvals
*
488 compute_imstt_regvals_ibm (struct fb_info_imstt
*p
, int xres
, int yres
)
490 struct imstt_regvals
*init
= &p
->init
;
491 __u32 MHz
, hes
, heb
, veb
, htp
, vtp
;
495 hes
= 0x0008; heb
= 0x0012; veb
= 0x002a; htp
= 10; vtp
= 2;
499 hes
= 0x0005; heb
= 0x0020; veb
= 0x0028; htp
= 8; vtp
= 3;
500 MHz
= 57 /* .27_ */ ;
503 hes
= 0x000a; heb
= 0x001c; veb
= 0x0020; htp
= 8; vtp
= 3;
507 hes
= 0x0012; heb
= 0x0022; veb
= 0x0031; htp
= 4; vtp
= 3;
508 MHz
= 101 /* .6_ */ ;
511 hes
= 0x0012; heb
= 0x002f; veb
= 0x0029; htp
= 4; vtp
= 1;
512 MHz
= yres
== 960 ? 126 : 135;
515 hes
= 0x0018; heb
= 0x0040; veb
= 0x002a; htp
= 4; vtp
= 3;
526 init
->hsb
= init
->heb
+ (xres
>> 3);
527 init
->ht
= init
->hsb
+ htp
;
530 init
->vsb
= init
->veb
+ yres
;
531 init
->vt
= init
->vsb
+ vtp
;
532 init
->vil
= init
->vsb
;
539 static struct imstt_regvals
*
540 compute_imstt_regvals_tvp (struct fb_info_imstt
*p
, int xres
, int yres
)
542 struct imstt_regvals
*init
;
546 init
= &tvp_reg_init_2
;
549 init
= &tvp_reg_init_6
;
552 init
= &tvp_reg_init_12
;
555 init
= &tvp_reg_init_13
;
558 init
= &tvp_reg_init_17
;
561 init
= &tvp_reg_init_18
;
564 init
= yres
== 960 ? &tvp_reg_init_19
: &tvp_reg_init_20
;
574 static struct imstt_regvals
*
575 compute_imstt_regvals (struct fb_info_imstt
*p
, u_int xres
, u_int yres
)
577 if (p
->ramdac
== IBM
)
578 return compute_imstt_regvals_ibm(p
, xres
, yres
);
580 return compute_imstt_regvals_tvp(p
, xres
, yres
);
584 set_imstt_regvals_ibm (struct fb_info_imstt
*p
, u_int bpp
)
586 struct imstt_regvals
*init
= &p
->init
;
587 __u8 pformat
= (bpp
>> 3) + 2;
589 p
->cmap_regs
[PIDXHI
] = 0; eieio();
590 p
->cmap_regs
[PIDXLO
] = PIXM0
; eieio();
591 p
->cmap_regs
[PIDXDATA
] = init
->pclk_m
; eieio();
592 p
->cmap_regs
[PIDXLO
] = PIXN0
; eieio();
593 p
->cmap_regs
[PIDXDATA
] = init
->pclk_n
; eieio();
594 p
->cmap_regs
[PIDXLO
] = PIXP0
; eieio();
595 p
->cmap_regs
[PIDXDATA
] = init
->pclk_p
; eieio();
596 p
->cmap_regs
[PIDXLO
] = PIXC0
; eieio();
597 p
->cmap_regs
[PIDXDATA
] = 0x02; eieio();
599 p
->cmap_regs
[PIDXLO
] = PIXFMT
; eieio();
600 p
->cmap_regs
[PIDXDATA
] = pformat
; eieio();
604 set_imstt_regvals_tvp (struct fb_info_imstt
*p
, u_int bpp
)
606 struct imstt_regvals
*init
= &p
->init
;
607 __u8 tcc
, mxc
, lckl_n
, mic
;
616 lckl_p
= init
->lckl_p
[0];
623 lckl_p
= init
->lckl_p
[1];
630 lckl_p
= init
->lckl_p
[2];
637 lckl_p
= init
->lckl_p
[2];
642 p
->cmap_regs
[TVPADDRW
] = TVPIRPLA
; eieio();
643 p
->cmap_regs
[TVPIDATA
] = 0x00; eieio();
644 p
->cmap_regs
[TVPADDRW
] = TVPIRPPD
; eieio();
645 p
->cmap_regs
[TVPIDATA
] = init
->pclk_m
; eieio();
646 p
->cmap_regs
[TVPADDRW
] = TVPIRPPD
; eieio();
647 p
->cmap_regs
[TVPIDATA
] = init
->pclk_n
; eieio();
648 p
->cmap_regs
[TVPADDRW
] = TVPIRPPD
; eieio();
649 p
->cmap_regs
[TVPIDATA
] = init
->pclk_p
; eieio();
651 p
->cmap_regs
[TVPADDRW
] = TVPIRTCC
; eieio();
652 p
->cmap_regs
[TVPIDATA
] = tcc
; eieio();
653 p
->cmap_regs
[TVPADDRW
] = TVPIRMXC
; eieio();
654 p
->cmap_regs
[TVPIDATA
] = mxc
; eieio();
655 p
->cmap_regs
[TVPADDRW
] = TVPIRMIC
; eieio();
656 p
->cmap_regs
[TVPIDATA
] = mic
; eieio();
658 p
->cmap_regs
[TVPADDRW
] = TVPIRPLA
; eieio();
659 p
->cmap_regs
[TVPIDATA
] = 0x00; eieio();
660 p
->cmap_regs
[TVPADDRW
] = TVPIRLPD
; eieio();
661 p
->cmap_regs
[TVPIDATA
] = lckl_n
; eieio();
663 p
->cmap_regs
[TVPADDRW
] = TVPIRPLA
; eieio();
664 p
->cmap_regs
[TVPIDATA
] = 0x15; eieio();
665 p
->cmap_regs
[TVPADDRW
] = TVPIRMLC
; eieio();
666 p
->cmap_regs
[TVPIDATA
] = mlc
; eieio();
668 p
->cmap_regs
[TVPADDRW
] = TVPIRPLA
; eieio();
669 p
->cmap_regs
[TVPIDATA
] = 0x2a; eieio();
670 p
->cmap_regs
[TVPADDRW
] = TVPIRLPD
; eieio();
671 p
->cmap_regs
[TVPIDATA
] = lckl_p
; eieio();
675 set_imstt_regvals (struct fb_info_imstt
*p
, u_int bpp
)
677 struct imstt_regvals
*init
= &p
->init
;
678 __u32 ctl
, pitch
, byteswap
, scr
;
680 if (p
->ramdac
== IBM
)
681 set_imstt_regvals_ibm(p
, bpp
);
683 set_imstt_regvals_tvp(p
, bpp
);
686 * From what I (jsk) can gather poking around with MacsBug,
687 * bits 8 and 9 in the SCR register control endianness
688 * correction (byte swapping). These bits must be set according
689 * to the color depth as follows:
690 * Color depth Bit 9 Bit 8
691 * ========== ===== =====
699 pitch
= init
->pitch
>> 2;
704 pitch
= init
->pitch
>> 1;
709 pitch
= init
->pitch
- (p
->init
.pitch
>> 2);
718 if (p
->ramdac
== TVP
)
721 out_le32(&p
->dc_regs
[HES
], init
->hes
);
722 out_le32(&p
->dc_regs
[HEB
], init
->heb
);
723 out_le32(&p
->dc_regs
[HSB
], init
->hsb
);
724 out_le32(&p
->dc_regs
[HT
], init
->ht
);
725 out_le32(&p
->dc_regs
[VES
], init
->ves
);
726 out_le32(&p
->dc_regs
[VEB
], init
->veb
);
727 out_le32(&p
->dc_regs
[VSB
], init
->vsb
);
728 out_le32(&p
->dc_regs
[VT
], init
->vt
);
729 out_le32(&p
->dc_regs
[VIL
], init
->vil
);
730 out_le32(&p
->dc_regs
[HCIV
], 1);
731 out_le32(&p
->dc_regs
[VCIV
], 1);
732 out_le32(&p
->dc_regs
[TCDR
], 4);
733 out_le32(&p
->dc_regs
[RRCIV
], 1);
734 out_le32(&p
->dc_regs
[RRSC
], 0x980);
735 out_le32(&p
->dc_regs
[RRCR
], 0x11);
737 if (p
->ramdac
== IBM
) {
738 out_le32(&p
->dc_regs
[HRIR
], 0x0100);
739 out_le32(&p
->dc_regs
[CMR
], 0x00ff);
740 out_le32(&p
->dc_regs
[SRGCTL
], 0x0073);
742 out_le32(&p
->dc_regs
[HRIR
], 0x0200);
743 out_le32(&p
->dc_regs
[CMR
], 0x01ff);
744 out_le32(&p
->dc_regs
[SRGCTL
], 0x0003);
747 switch (p
->total_vram
) {
749 scr
= 0x059d | byteswap
;
755 scr
= 0x150dd | byteswap
;
759 out_le32(&p
->dc_regs
[SCR
], scr
);
760 out_le32(&p
->dc_regs
[SPR
], pitch
);
761 out_le32(&p
->dc_regs
[STGCTL
], ctl
);
765 set_offset (struct display
*disp
, struct fb_info_imstt
*p
)
767 __u32 off
= disp
->var
.yoffset
* (disp
->line_length
>> 3)
768 + ((disp
->var
.xoffset
* (disp
->var
.bits_per_pixel
>> 3)) >> 3);
769 out_le32(&p
->dc_regs
[SSR
], off
);
773 set_555 (struct fb_info_imstt
*p
)
775 if (p
->ramdac
== IBM
) {
776 p
->cmap_regs
[PIDXHI
] = 0; eieio();
777 p
->cmap_regs
[PIDXLO
] = BPP16
; eieio();
778 p
->cmap_regs
[PIDXDATA
] = 0x01; eieio();
780 p
->cmap_regs
[TVPADDRW
] = TVPIRTCC
; eieio();
781 p
->cmap_regs
[TVPIDATA
] = 0x44; eieio();
786 set_565 (struct fb_info_imstt
*p
)
788 if (p
->ramdac
== IBM
) {
789 p
->cmap_regs
[PIDXHI
] = 0; eieio();
790 p
->cmap_regs
[PIDXLO
] = BPP16
; eieio();
791 p
->cmap_regs
[PIDXDATA
] = 0x03; eieio();
793 p
->cmap_regs
[TVPADDRW
] = TVPIRTCC
; eieio();
794 p
->cmap_regs
[TVPIDATA
] = 0x45; eieio();
799 imstt_set_cursor (struct fb_info_imstt
*p
, int on
)
801 struct imstt_cursor
*c
= &p
->cursor
;
803 if (p
->ramdac
== IBM
) {
804 p
->cmap_regs
[PIDXHI
] = 0; eieio();
806 p
->cmap_regs
[PIDXLO
] = CURSCTL
; eieio();
807 p
->cmap_regs
[PIDXDATA
] = 0x00; eieio();
809 p
->cmap_regs
[PIDXLO
] = CURSXHI
; eieio();
810 p
->cmap_regs
[PIDXDATA
] = c
->x
>> 8; eieio();
811 p
->cmap_regs
[PIDXLO
] = CURSXLO
; eieio();
812 p
->cmap_regs
[PIDXDATA
] = c
->x
& 0xff; eieio();
813 p
->cmap_regs
[PIDXLO
] = CURSYHI
; eieio();
814 p
->cmap_regs
[PIDXDATA
] = c
->y
>> 8; eieio();
815 p
->cmap_regs
[PIDXLO
] = CURSYLO
; eieio();
816 p
->cmap_regs
[PIDXDATA
] = c
->y
& 0xff; eieio();
817 p
->cmap_regs
[PIDXLO
] = CURSCTL
; eieio();
818 p
->cmap_regs
[PIDXDATA
] = 0x02; eieio();
822 p
->cmap_regs
[TVPADDRW
] = TVPIRICC
; eieio();
823 p
->cmap_regs
[TVPIDATA
] = 0x00; eieio();
825 __u16 x
= c
->x
+ 0x40, y
= c
->y
+ 0x40;
827 p
->cmap_regs
[TVPCXPOH
] = x
>> 8; eieio();
828 p
->cmap_regs
[TVPCXPOL
] = x
& 0xff; eieio();
829 p
->cmap_regs
[TVPCYPOH
] = y
>> 8; eieio();
830 p
->cmap_regs
[TVPCYPOL
] = y
& 0xff; eieio();
831 p
->cmap_regs
[TVPADDRW
] = TVPIRICC
; eieio();
832 p
->cmap_regs
[TVPIDATA
] = 0x02; eieio();
838 imsttfbcon_cursor (struct display
*disp
, int mode
, int x
, int y
)
840 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)disp
->fb_info
;
841 struct imstt_cursor
*c
= &p
->cursor
;
843 x
*= fontwidth(disp
);
844 y
*= fontheight(disp
);
846 if (c
->x
== x
&& c
->y
== y
&& (mode
== CM_ERASE
) == !c
->enable
)
851 imstt_set_cursor(p
, 0);
852 c
->x
= x
- disp
->var
.xoffset
;
853 c
->y
= y
- disp
->var
.yoffset
;
862 imstt_set_cursor(p
, c
->on
);
864 c
->vbl_cnt
= CURSOR_DRAW_DELAY
;
871 imsttfbcon_set_font (struct display
*disp
, int width
, int height
)
873 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)disp
->fb_info
;
874 struct imstt_cursor
*c
= &p
->cursor
;
878 if (width
> 32 || height
> 32)
884 fgc
= ~attr_bgcol_ec(disp
, disp
->conp
);
886 if (p
->ramdac
== IBM
) {
887 p
->cmap_regs
[PIDXHI
] = 1; eieio();
888 for (x
= 0; x
< 0x100; x
++) {
889 p
->cmap_regs
[PIDXLO
] = x
; eieio();
890 p
->cmap_regs
[PIDXDATA
] = 0x00; eieio();
892 p
->cmap_regs
[PIDXHI
] = 1; eieio();
893 for (y
= 0; y
< height
; y
++)
894 for (x
= 0; x
< width
>> 2; x
++) {
895 p
->cmap_regs
[PIDXLO
] = x
+ y
* 8; eieio();
896 p
->cmap_regs
[PIDXDATA
] = 0xff; eieio();
898 p
->cmap_regs
[PIDXHI
] = 0; eieio();
899 p
->cmap_regs
[PIDXLO
] = CURS1R
; eieio();
900 p
->cmap_regs
[PIDXDATA
] = fgc
; eieio();
901 p
->cmap_regs
[PIDXLO
] = CURS1G
; eieio();
902 p
->cmap_regs
[PIDXDATA
] = fgc
; eieio();
903 p
->cmap_regs
[PIDXLO
] = CURS1B
; eieio();
904 p
->cmap_regs
[PIDXDATA
] = fgc
; eieio();
905 p
->cmap_regs
[PIDXLO
] = CURS2R
; eieio();
906 p
->cmap_regs
[PIDXDATA
] = fgc
; eieio();
907 p
->cmap_regs
[PIDXLO
] = CURS2G
; eieio();
908 p
->cmap_regs
[PIDXDATA
] = fgc
; eieio();
909 p
->cmap_regs
[PIDXLO
] = CURS2B
; eieio();
910 p
->cmap_regs
[PIDXDATA
] = fgc
; eieio();
911 p
->cmap_regs
[PIDXLO
] = CURS3R
; eieio();
912 p
->cmap_regs
[PIDXDATA
] = fgc
; eieio();
913 p
->cmap_regs
[PIDXLO
] = CURS3G
; eieio();
914 p
->cmap_regs
[PIDXDATA
] = fgc
; eieio();
915 p
->cmap_regs
[PIDXLO
] = CURS3B
; eieio();
916 p
->cmap_regs
[PIDXDATA
] = fgc
; eieio();
918 p
->cmap_regs
[TVPADDRW
] = TVPIRICC
; eieio();
919 p
->cmap_regs
[TVPIDATA
] &= 0x03; eieio();
920 p
->cmap_regs
[TVPADDRW
] = 0; eieio();
921 for (x
= 0; x
< 0x200; x
++) {
922 p
->cmap_regs
[TVPCRDAT
] = 0x00; eieio();
924 for (x
= 0; x
< 0x200; x
++) {
925 p
->cmap_regs
[TVPCRDAT
] = 0xff; eieio();
927 p
->cmap_regs
[TVPADDRW
] = TVPIRICC
; eieio();
928 p
->cmap_regs
[TVPIDATA
] &= 0x03; eieio();
929 for (y
= 0; y
< height
; y
++)
930 for (x
= 0; x
< width
>> 3; x
++) {
931 p
->cmap_regs
[TVPADDRW
] = x
+ y
* 8; eieio();
932 p
->cmap_regs
[TVPCRDAT
] = 0xff; eieio();
934 p
->cmap_regs
[TVPADDRW
] = TVPIRICC
; eieio();
935 p
->cmap_regs
[TVPIDATA
] |= 0x08; eieio();
936 for (y
= 0; y
< height
; y
++)
937 for (x
= 0; x
< width
>> 3; x
++) {
938 p
->cmap_regs
[TVPADDRW
] = x
+ y
* 8; eieio();
939 p
->cmap_regs
[TVPCRDAT
] = 0xff; eieio();
941 p
->cmap_regs
[TVPCADRW
] = 0x00; eieio();
942 for (x
= 0; x
< 12; x
++) {
943 p
->cmap_regs
[TVPCDATA
] = fgc
; eieio();
951 imstt_cursor_timer_handler (unsigned long dev_addr
)
953 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)dev_addr
;
954 struct imstt_cursor
*c
= &p
->cursor
;
959 if (c
->vbl_cnt
&& --c
->vbl_cnt
== 0) {
961 imstt_set_cursor(p
, c
->on
);
962 c
->vbl_cnt
= c
->blink_rate
;
966 c
->timer
.expires
= jiffies
+ (HZ
/ 50);
967 add_timer(&c
->timer
);
970 __initfunc(static void
971 imstt_cursor_init (struct fb_info_imstt
*p
))
973 struct imstt_cursor
*c
= &p
->cursor
;
975 imsttfbcon_set_font(&p
->disp
, fontwidth(&p
->disp
), fontheight(&p
->disp
));
981 c
->vbl_cnt
= CURSOR_DRAW_DELAY
;
984 c
->blink_rate
= CURSOR_BLINK_RATE
;
985 init_timer(&c
->timer
);
986 c
->timer
.expires
= jiffies
+ (HZ
/ 50);
987 c
->timer
.data
= (unsigned long)p
;
988 c
->timer
.function
= imstt_cursor_timer_handler
;
989 add_timer(&c
->timer
);
994 imsttfbcon_bmove (struct display
*disp
, int sy
, int sx
, int dy
, int dx
, int height
, int width
)
996 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)disp
->fb_info
;
997 __u32 Bpp
, line_pitch
,
998 fb_offset_old
, fb_offset_new
,
999 sp
, dp_octl
, cnt
, bltctl
;
1001 Bpp
= disp
->var
.bits_per_pixel
>> 3,
1003 sy
*= fontheight(disp
);
1004 sx
*= fontwidth(disp
);
1006 dy
*= fontheight(disp
);
1007 dx
*= fontwidth(disp
);
1009 height
*= fontheight(disp
);
1011 width
*= fontwidth(disp
);
1015 line_pitch
= disp
->line_length
;
1017 sp
= line_pitch
<< 16;
1023 sp
|= -(line_pitch
) & 0xffff;
1024 dp_octl
= -(line_pitch
) & 0xffff;
1027 dp_octl
= line_pitch
;
1033 cnt
|= -(width
) & 0xffff;
1037 fb_offset_old
= sy
* line_pitch
+ sx
;
1038 fb_offset_new
= dy
* line_pitch
+ dx
;
1040 while(in_le32(&p
->dc_regs
[SSTATUS
]) & 0x80);
1041 out_le32(&p
->dc_regs
[S1SA
], fb_offset_old
);
1042 out_le32(&p
->dc_regs
[SP
], sp
);
1043 out_le32(&p
->dc_regs
[DSA
], fb_offset_new
);
1044 out_le32(&p
->dc_regs
[CNT
], cnt
);
1045 out_le32(&p
->dc_regs
[DP_OCTL
], dp_octl
);
1046 out_le32(&p
->dc_regs
[BLTCTL
], bltctl
);
1047 while(in_le32(&p
->dc_regs
[SSTATUS
]) & 0x80);
1048 while(in_le32(&p
->dc_regs
[SSTATUS
]) & 0x40);
1052 imsttfbcon_clear (struct vc_data
*conp
, struct display
*disp
,
1053 int sy
, int sx
, int height
, int width
)
1055 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)disp
->fb_info
;
1056 __u32 Bpp
, line_pitch
, bgc
;
1058 bgc
= attr_bgcol_ec(disp
, conp
);
1062 Bpp
= disp
->var
.bits_per_pixel
>> 3,
1063 line_pitch
= disp
->line_length
;
1065 sy
*= fontheight(disp
);
1067 sx
*= fontwidth(disp
);
1069 height
*= fontheight(disp
);
1071 width
*= fontwidth(disp
);
1075 while(in_le32(&p
->dc_regs
[SSTATUS
]) & 0x80);
1076 out_le32(&p
->dc_regs
[DSA
], sy
+ sx
);
1077 out_le32(&p
->dc_regs
[CNT
], (height
<< 16) | width
);
1078 out_le32(&p
->dc_regs
[DP_OCTL
], line_pitch
);
1079 out_le32(&p
->dc_regs
[BI
], 0xffffffff);
1080 out_le32(&p
->dc_regs
[MBC
], 0xffffffff);
1081 out_le32(&p
->dc_regs
[CLR
], bgc
);
1082 out_le32(&p
->dc_regs
[BLTCTL
], 0x200000);
1083 while(in_le32(&p
->dc_regs
[SSTATUS
]) & 0x80);
1084 while(in_le32(&p
->dc_regs
[SSTATUS
]) & 0x40);
1088 imsttfbcon_revc (struct display
*disp
, int sx
, int sy
)
1090 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)disp
->fb_info
;
1091 __u32 Bpp
, line_pitch
, height
, width
;
1093 Bpp
= disp
->var
.bits_per_pixel
>> 3,
1094 line_pitch
= disp
->line_length
;
1096 height
= fontheight(disp
);
1097 width
= fontwidth(disp
) * Bpp
;
1104 while(in_le32(&p
->dc_regs
[SSTATUS
]) & 0x80);
1105 out_le32(&p
->dc_regs
[DSA
], sy
+ sx
);
1106 out_le32(&p
->dc_regs
[S1SA
], sy
+ sx
);
1107 out_le32(&p
->dc_regs
[CNT
], (height
<< 16) | width
);
1108 out_le32(&p
->dc_regs
[DP_OCTL
], line_pitch
);
1109 out_le32(&p
->dc_regs
[SP
], line_pitch
);
1110 out_le32(&p
->dc_regs
[BLTCTL
], 0x40005);
1111 while(in_le32(&p
->dc_regs
[SSTATUS
]) & 0x80);
1112 while(in_le32(&p
->dc_regs
[SSTATUS
]) & 0x40);
1115 #ifdef FBCON_HAS_CFB8
1116 static struct display_switch fbcon_imstt8
= {
1117 fbcon_cfb8_setup
, imsttfbcon_bmove
, imsttfbcon_clear
, fbcon_cfb8_putc
,
1118 fbcon_cfb8_putcs
, imsttfbcon_revc
, imsttfbcon_cursor
, imsttfbcon_set_font
, fbcon_cfb8_clear_margins
,
1119 FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
1122 #ifdef FBCON_HAS_CFB16
1123 static struct display_switch fbcon_imstt16
= {
1124 fbcon_cfb16_setup
, imsttfbcon_bmove
, imsttfbcon_clear
, fbcon_cfb16_putc
,
1125 fbcon_cfb16_putcs
, imsttfbcon_revc
, imsttfbcon_cursor
, imsttfbcon_set_font
, fbcon_cfb16_clear_margins
,
1126 FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
1129 #ifdef FBCON_HAS_CFB24
1130 static struct display_switch fbcon_imstt24
= {
1131 fbcon_cfb24_setup
, imsttfbcon_bmove
, imsttfbcon_clear
, fbcon_cfb24_putc
,
1132 fbcon_cfb24_putcs
, imsttfbcon_revc
, imsttfbcon_cursor
, imsttfbcon_set_font
, fbcon_cfb24_clear_margins
,
1133 FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
1136 #ifdef FBCON_HAS_CFB32
1137 static struct display_switch fbcon_imstt32
= {
1138 fbcon_cfb32_setup
, imsttfbcon_bmove
, imsttfbcon_clear
, fbcon_cfb32_putc
,
1139 fbcon_cfb32_putcs
, imsttfbcon_revc
, imsttfbcon_cursor
, imsttfbcon_set_font
, fbcon_cfb32_clear_margins
,
1140 FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
1144 #ifdef CONFIG_FB_COMPAT_XPMAC
1145 #include <asm/vc_ioctl.h>
1147 extern struct vc_mode display_info
;
1148 extern struct fb_info
*console_fb_info
;
1151 set_display_info (struct display
*disp
)
1153 display_info
.width
= disp
->var
.xres
;
1154 display_info
.height
= disp
->var
.yres
;
1155 display_info
.depth
= disp
->var
.bits_per_pixel
;
1156 display_info
.pitch
= disp
->line_length
;
1158 switch (disp
->var
.xres
) {
1160 display_info
.mode
= 2;
1163 display_info
.mode
= 6;
1166 display_info
.mode
= 12;
1169 display_info
.mode
= 13;
1172 display_info
.mode
= 17;
1175 display_info
.mode
= 18;
1178 display_info
.mode
= disp
->var
.yres
== 960 ? 19 : 20;
1181 display_info
.mode
= 0;
1187 imsttfb_getcolreg (u_int regno
, u_int
*red
, u_int
*green
,
1188 u_int
*blue
, u_int
*transp
, struct fb_info
*info
)
1190 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)info
;
1194 *red
= (p
->palette
[regno
].red
<< 8) | p
->palette
[regno
].red
;
1195 *green
= (p
->palette
[regno
].green
<< 8) | p
->palette
[regno
].green
;
1196 *blue
= (p
->palette
[regno
].blue
<< 8) | p
->palette
[regno
].blue
;
1203 imsttfb_setcolreg (u_int regno
, u_int red
, u_int green
, u_int blue
,
1204 u_int transp
, struct fb_info
*info
)
1206 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)info
;
1207 u_int bpp
= fb_display
[currcon
].var
.bits_per_pixel
;
1217 p
->palette
[regno
].red
= red
;
1218 p
->palette
[regno
].green
= green
;
1219 p
->palette
[regno
].blue
= blue
;
1221 /* PADDRW/PDATA are the same as TVPPADDRW/TVPPDATA */
1222 if (0 && bpp
== 16) /* screws up X */
1223 p
->cmap_regs
[PADDRW
] = regno
<< 3;
1225 p
->cmap_regs
[PADDRW
] = regno
;
1228 p
->cmap_regs
[PDATA
] = red
; eieio();
1229 p
->cmap_regs
[PDATA
] = green
; eieio();
1230 p
->cmap_regs
[PDATA
] = blue
; eieio();
1234 #ifdef FBCON_HAS_CFB16
1236 p
->fbcon_cmap
.cfb16
[regno
] = (regno
<< (fb_display
[currcon
].var
.green
.length
== 5 ? 10 : 11)) | (regno
<< 5) | regno
;
1239 #ifdef FBCON_HAS_CFB24
1241 p
->fbcon_cmap
.cfb24
[regno
] = (regno
<< 16) | (regno
<< 8) | regno
;
1244 #ifdef FBCON_HAS_CFB32
1246 i
= (regno
<< 8) | regno
;
1247 p
->fbcon_cmap
.cfb32
[regno
] = (i
<< 16) | i
;
1256 do_install_cmap (int con
, struct fb_info
*info
)
1258 if (fb_display
[con
].cmap
.len
)
1259 fb_set_cmap(&fb_display
[con
].cmap
, 1, imsttfb_setcolreg
, info
);
1261 u_int size
= fb_display
[con
].var
.bits_per_pixel
== 16 ? 32 : 256;
1262 fb_set_cmap(fb_default_cmap(size
), 1, imsttfb_setcolreg
, info
);
1267 imsttfb_open (struct fb_info
*info
, int user
)
1274 imsttfb_release (struct fb_info
*info
, int user
)
1281 imsttfb_get_fix (struct fb_fix_screeninfo
*fix
, int con
, struct fb_info
*info
)
1283 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)info
;
1284 struct fb_var_screeninfo
*var
= &fb_display
[con
].var
;
1287 fix
->visual
= var
->bits_per_pixel
== 8 ? FB_VISUAL_PSEUDOCOLOR
1288 : FB_VISUAL_DIRECTCOLOR
;
1289 fix
->line_length
= var
->xres
* (var
->bits_per_pixel
>> 3);
1295 imsttfb_get_var (struct fb_var_screeninfo
*var
, int con
, struct fb_info
*info
)
1297 *var
= fb_display
[con
].var
;
1303 set_dispsw (struct display
*disp
, struct fb_info_imstt
*p
)
1305 u_int accel
= disp
->var
.accel_flags
& FB_ACCELF_TEXT
;
1307 if (disp
->conp
&& disp
->conp
->vc_sw
&& disp
->conp
->vc_sw
->con_cursor
)
1308 disp
->conp
->vc_sw
->con_cursor(disp
->conp
, CM_ERASE
);
1310 p
->dispsw
= fbcon_dummy
;
1311 disp
->dispsw
= &p
->dispsw
;
1312 disp
->dispsw_data
= 0;
1313 switch (disp
->var
.bits_per_pixel
) {
1315 disp
->var
.red
.offset
= 0;
1316 disp
->var
.red
.length
= 8;
1317 disp
->var
.green
.offset
= 0;
1318 disp
->var
.green
.length
= 8;
1319 disp
->var
.blue
.offset
= 0;
1320 disp
->var
.blue
.length
= 8;
1321 disp
->var
.transp
.offset
= 0;
1322 disp
->var
.transp
.length
= 0;
1323 #ifdef FBCON_HAS_CFB8
1324 p
->dispsw
= accel
? fbcon_imstt8
: fbcon_cfb8
;
1327 case 16: /* RGB 555 or 565 */
1328 if (disp
->var
.green
.length
!= 6)
1329 disp
->var
.red
.offset
= 10;
1330 disp
->var
.red
.length
= 5;
1331 disp
->var
.green
.offset
= 5;
1332 if (disp
->var
.green
.length
!= 6)
1333 disp
->var
.green
.length
= 5;
1334 disp
->var
.blue
.offset
= 0;
1335 disp
->var
.blue
.length
= 5;
1336 disp
->var
.transp
.offset
= 0;
1337 disp
->var
.transp
.length
= 0;
1338 #ifdef FBCON_HAS_CFB16
1339 p
->dispsw
= accel
? fbcon_imstt16
: fbcon_cfb16
;
1340 disp
->dispsw_data
= p
->fbcon_cmap
.cfb16
;
1343 case 24: /* RGB 888 */
1344 disp
->var
.red
.offset
= 16;
1345 disp
->var
.red
.length
= 8;
1346 disp
->var
.green
.offset
= 8;
1347 disp
->var
.green
.length
= 8;
1348 disp
->var
.blue
.offset
= 0;
1349 disp
->var
.blue
.length
= 8;
1350 disp
->var
.transp
.offset
= 0;
1351 disp
->var
.transp
.length
= 0;
1352 #ifdef FBCON_HAS_CFB24
1353 p
->dispsw
= accel
? fbcon_imstt24
: fbcon_cfb24
;
1354 disp
->dispsw_data
= p
->fbcon_cmap
.cfb24
;
1357 case 32: /* RGBA 8888 */
1358 disp
->var
.red
.offset
= 16;
1359 disp
->var
.red
.length
= 8;
1360 disp
->var
.green
.offset
= 8;
1361 disp
->var
.green
.length
= 8;
1362 disp
->var
.blue
.offset
= 0;
1363 disp
->var
.blue
.length
= 8;
1364 disp
->var
.transp
.offset
= 24;
1365 disp
->var
.transp
.length
= 8;
1366 #ifdef FBCON_HAS_CFB32
1367 p
->dispsw
= accel
? fbcon_imstt32
: fbcon_cfb32
;
1368 disp
->dispsw_data
= p
->fbcon_cmap
.cfb32
;
1373 if (accel
&& p
->ramdac
!= IBM
) {
1374 p
->dispsw
.cursor
= 0;
1375 p
->dispsw
.set_font
= 0;
1378 #ifdef CONFIG_FB_COMPAT_XPMAC
1379 set_display_info(disp
);
1384 set_disp (struct display
*disp
, struct fb_info_imstt
*p
)
1386 u_int accel
= disp
->var
.accel_flags
& FB_ACCELF_TEXT
;
1388 disp
->fb_info
= &p
->info
;
1390 set_dispsw(disp
, p
);
1392 disp
->visual
= disp
->var
.bits_per_pixel
== 8 ? FB_VISUAL_PSEUDOCOLOR
1393 : FB_VISUAL_DIRECTCOLOR
;
1394 disp
->screen_base
= (__u8
*)p
->frame_buffer
;
1395 disp
->visual
= p
->fix
.visual
;
1396 disp
->type
= p
->fix
.type
;
1397 disp
->type_aux
= p
->fix
.type_aux
;
1398 disp
->line_length
= disp
->var
.xres
* (disp
->var
.bits_per_pixel
>> 3);
1399 disp
->can_soft_blank
= 1;
1402 disp
->ywrapstep
= 0;
1404 disp
->scrollmode
= SCROLL_YNOMOVE
;
1405 if (disp
->var
.yres
== disp
->var
.yres_virtual
) {
1406 __u32 vram
= (p
->total_vram
- (PAGE_SIZE
<< 2));
1407 disp
->var
.yres_virtual
= ((vram
<< 3) / disp
->var
.bits_per_pixel
) / disp
->var
.xres_virtual
;
1408 if (disp
->var
.yres_virtual
< disp
->var
.yres
)
1409 disp
->var
.yres_virtual
= disp
->var
.yres
;
1412 disp
->scrollmode
= SCROLL_YREDRAW
;
1415 disp
->var
.activate
= 0;
1416 disp
->var
.red
.msb_right
= 0;
1417 disp
->var
.green
.msb_right
= 0;
1418 disp
->var
.blue
.msb_right
= 0;
1419 disp
->var
.transp
.msb_right
= 0;
1420 disp
->var
.height
= -1;
1421 disp
->var
.width
= -1;
1422 disp
->var
.vmode
= FB_VMODE_NONINTERLACED
;
1423 disp
->var
.left_margin
= disp
->var
.right_margin
= 16;
1424 disp
->var
.upper_margin
= disp
->var
.lower_margin
= 16;
1425 disp
->var
.hsync_len
= disp
->var
.vsync_len
= 8;
1429 imsttfb_set_var (struct fb_var_screeninfo
*var
, int con
, struct fb_info
*info
)
1431 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)info
;
1432 struct display
*disp
;
1433 u_int oldbpp
, oldxres
, oldyres
, oldgreenlen
, oldaccel
;
1435 disp
= &fb_display
[con
];
1437 if ((var
->bits_per_pixel
!= 8 && var
->bits_per_pixel
!= 16
1438 && var
->bits_per_pixel
!= 24 && var
->bits_per_pixel
!= 32)
1439 || var
->xres_virtual
< var
->xres
|| var
->yres_virtual
< var
->yres
1441 || (var
->vmode
& FB_VMODE_MASK
) != FB_VMODE_NONINTERLACED
)
1444 if ((var
->xres
* var
->yres
) * (var
->bits_per_pixel
>> 3) > p
->total_vram
1445 || (var
->xres_virtual
* var
->yres_virtual
) * (var
->bits_per_pixel
>> 3) > p
->total_vram
)
1448 if (!((var
->activate
& FB_ACTIVATE_MASK
) == FB_ACTIVATE_NOW
))
1451 if (!compute_imstt_regvals(p
, var
->xres
, var
->yres
))
1454 oldbpp
= disp
->var
.bits_per_pixel
;
1455 oldxres
= disp
->var
.xres
;
1456 oldyres
= disp
->var
.yres
;
1457 oldgreenlen
= disp
->var
.green
.length
;
1458 oldaccel
= disp
->var
.accel_flags
;
1460 disp
->var
.bits_per_pixel
= var
->bits_per_pixel
;
1461 disp
->var
.xres
= var
->xres
;
1462 disp
->var
.yres
= var
->yres
;
1463 disp
->var
.xres_virtual
= var
->xres_virtual
;
1464 disp
->var
.yres_virtual
= var
->yres_virtual
;
1465 disp
->var
.green
.length
= var
->green
.length
;
1466 disp
->var
.accel_flags
= var
->accel_flags
;
1470 if (info
->changevar
)
1471 (*info
->changevar
)(con
);
1473 if (con
== currcon
) {
1474 if (oldgreenlen
!= disp
->var
.green
.length
) {
1475 if (disp
->var
.green
.length
== 6)
1480 if (oldxres
!= disp
->var
.xres
|| oldyres
!= disp
->var
.yres
|| oldbpp
!= disp
->var
.bits_per_pixel
)
1481 set_imstt_regvals(p
, disp
->var
.bits_per_pixel
);
1484 disp
->var
.pixclock
= 1000000 / getclkMHz(p
);
1486 if (oldbpp
!= disp
->var
.bits_per_pixel
) {
1487 int err
= fb_alloc_cmap(&disp
->cmap
, 0, 0);
1490 do_install_cmap(con
, info
);
1498 imsttfb_pan_display (struct fb_var_screeninfo
*var
, int con
, struct fb_info
*info
)
1500 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)info
;
1501 struct display
*disp
= &fb_display
[con
];
1503 if (var
->xoffset
+ disp
->var
.xres
> disp
->var
.xres_virtual
1504 || var
->yoffset
+ disp
->var
.yres
> disp
->var
.yres_virtual
)
1507 disp
->var
.xoffset
= var
->xoffset
;
1508 disp
->var
.yoffset
= var
->yoffset
;
1510 set_offset(disp
, p
);
1516 imsttfb_get_cmap (struct fb_cmap
*cmap
, int kspc
, int con
, struct fb_info
*info
)
1518 if (con
== currcon
) /* current console? */
1519 return fb_get_cmap(cmap
, kspc
, imsttfb_getcolreg
, info
);
1520 else if (fb_display
[con
].cmap
.len
) /* non default colormap? */
1521 fb_copy_cmap(&fb_display
[con
].cmap
, cmap
, kspc
? 0 : 2);
1523 u_int size
= fb_display
[con
].var
.bits_per_pixel
== 16 ? 32 : 256;
1524 fb_copy_cmap(fb_default_cmap(size
), cmap
, kspc
? 0 : 2);
1531 imsttfb_set_cmap (struct fb_cmap
*cmap
, int kspc
, int con
, struct fb_info
*info
)
1535 if (!fb_display
[con
].cmap
.len
) { /* no colormap allocated? */
1536 int size
= fb_display
[con
].var
.bits_per_pixel
== 16 ? 32 : 256;
1537 if ((err
= fb_alloc_cmap(&fb_display
[con
].cmap
, size
, 0)))
1540 if (con
== currcon
) /* current console? */
1541 return fb_set_cmap(cmap
, kspc
, imsttfb_setcolreg
, info
);
1543 fb_copy_cmap(cmap
, &fb_display
[con
].cmap
, kspc
? 0 : 1);
1548 #define FBIMSTT_SETREG 0x545401
1549 #define FBIMSTT_GETREG 0x545402
1550 #define FBIMSTT_SETCMAPREG 0x545403
1551 #define FBIMSTT_GETCMAPREG 0x545404
1552 #define FBIMSTT_SETIDXREG 0x545405
1553 #define FBIMSTT_GETIDXREG 0x545406
1556 imsttfb_ioctl (struct inode
*inode
, struct file
*file
, u_int cmd
,
1557 u_long arg
, int con
, struct fb_info
*info
)
1559 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)info
;
1564 case FBIMSTT_SETREG
:
1565 if (copy_from_user(reg
, (void *)arg
, 8) || reg
[0] > (0x1000 - sizeof(reg
[0])) / sizeof(reg
[0]))
1567 out_le32(&p
->dc_regs
[reg
[0]], reg
[1]);
1569 case FBIMSTT_GETREG
:
1570 if (copy_from_user(reg
, (void *)arg
, 4) || reg
[0] > (0x1000 - sizeof(reg
[0])) / sizeof(reg
[0]))
1572 reg
[1] = in_le32(&p
->dc_regs
[reg
[0]]);
1573 if (copy_to_user((void *)(arg
+ 4), ®
[1], 4))
1576 case FBIMSTT_SETCMAPREG
:
1577 if (copy_from_user(reg
, (void *)arg
, 8) || reg
[0] > (0x1000 - sizeof(reg
[0])) / sizeof(reg
[0]))
1579 out_le32(&((u_int
*)p
->cmap_regs
)[reg
[0]], reg
[1]);
1581 case FBIMSTT_GETCMAPREG
:
1582 if (copy_from_user(reg
, (void *)arg
, 4) || reg
[0] > (0x1000 - sizeof(reg
[0])) / sizeof(reg
[0]))
1584 reg
[1] = in_le32(&((u_int
*)p
->cmap_regs
)[reg
[0]]);
1585 if (copy_to_user((void *)(arg
+ 4), ®
[1], 4))
1588 case FBIMSTT_SETIDXREG
:
1589 if (copy_from_user(idx
, (void *)arg
, 2))
1591 p
->cmap_regs
[PIDXHI
] = 0; eieio();
1592 p
->cmap_regs
[PIDXLO
] = idx
[0]; eieio();
1593 p
->cmap_regs
[PIDXDATA
] = idx
[1]; eieio();
1595 case FBIMSTT_GETIDXREG
:
1596 if (copy_from_user(idx
, (void *)arg
, 1))
1598 p
->cmap_regs
[PIDXHI
] = 0; eieio();
1599 p
->cmap_regs
[PIDXLO
] = idx
[0]; eieio();
1600 idx
[1] = p
->cmap_regs
[PIDXDATA
];
1601 if (copy_to_user((void *)(arg
+ 1), &idx
[1], 1))
1605 return -ENOIOCTLCMD
;
1609 static struct fb_ops imsttfb_ops
= {
1617 imsttfb_pan_display
,
1622 imsttfbcon_switch (int con
, struct fb_info
*info
)
1624 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)info
;
1625 struct display
*old
= &fb_display
[currcon
], *new = &fb_display
[con
];
1628 fb_get_cmap(&old
->cmap
, 1, imsttfb_getcolreg
, info
);
1630 if (old
->conp
&& old
->conp
->vc_sw
&& old
->conp
->vc_sw
->con_cursor
)
1631 old
->conp
->vc_sw
->con_cursor(old
->conp
, CM_ERASE
);
1635 if (old
->var
.xres
!= new->var
.xres
1636 || old
->var
.yres
!= new->var
.yres
1637 || old
->var
.bits_per_pixel
!= new->var
.bits_per_pixel
1638 || old
->var
.green
.length
!= new->var
.green
.length
1639 || old
->var
.accel_flags
!= new->var
.accel_flags
) {
1641 if (!compute_imstt_regvals(p
, new->var
.xres
, new->var
.yres
))
1643 if (new->var
.bits_per_pixel
== 16) {
1644 if (new->var
.green
.length
== 6)
1649 set_imstt_regvals(p
, new->var
.bits_per_pixel
);
1653 imsttfbcon_set_font(new, fontwidth(new), fontheight(new));
1655 do_install_cmap(con
, info
);
1661 imsttfbcon_updatevar (int con
, struct fb_info
*info
)
1663 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)info
;
1664 struct display
*disp
= &fb_display
[con
];
1669 if (p
->ramdac
== IBM
)
1670 imsttfbcon_cursor(disp
, CM_ERASE
, p
->cursor
.x
, p
->cursor
.y
);
1672 set_offset(disp
, p
);
1679 imsttfbcon_blank (int blank
, struct fb_info
*info
)
1681 struct fb_info_imstt
*p
= (struct fb_info_imstt
*)info
;
1684 ctrl
= in_le32(&p
->dc_regs
[STGCTL
]);
1686 switch (blank
- 1) {
1687 case VESA_NO_BLANKING
:
1688 case VESA_POWERDOWN
:
1689 ctrl
&= ~0x00000380;
1690 if (p
->ramdac
== IBM
) {
1691 p
->cmap_regs
[PIDXHI
] = 0; eieio();
1692 p
->cmap_regs
[PIDXLO
] = MISCTL2
; eieio();
1693 p
->cmap_regs
[PIDXDATA
] = 0x55; eieio();
1694 p
->cmap_regs
[PIDXLO
] = MISCTL1
; eieio();
1695 p
->cmap_regs
[PIDXDATA
] = 0x11; eieio();
1696 p
->cmap_regs
[PIDXLO
] = SYNCCTL
; eieio();
1697 p
->cmap_regs
[PIDXDATA
] = 0x0f; eieio();
1698 p
->cmap_regs
[PIDXLO
] = PWRMNGMT
;eieio();
1699 p
->cmap_regs
[PIDXDATA
] = 0x1f; eieio();
1700 p
->cmap_regs
[PIDXLO
] = CLKCTL
; eieio();
1701 p
->cmap_regs
[PIDXDATA
] = 0xc0;
1704 case VESA_VSYNC_SUSPEND
:
1705 ctrl
&= ~0x00000020;
1707 case VESA_HSYNC_SUSPEND
:
1708 ctrl
&= ~0x00000010;
1712 if (p
->ramdac
== IBM
) {
1714 p
->cmap_regs
[PIDXHI
] = 0; eieio();
1715 p
->cmap_regs
[PIDXLO
] = CLKCTL
; eieio();
1716 p
->cmap_regs
[PIDXDATA
] = 0x01; eieio();
1717 p
->cmap_regs
[PIDXLO
] = PWRMNGMT
;eieio();
1718 p
->cmap_regs
[PIDXDATA
] = 0x00; eieio();
1719 p
->cmap_regs
[PIDXLO
] = SYNCCTL
; eieio();
1720 p
->cmap_regs
[PIDXDATA
] = 0x00; eieio();
1721 p
->cmap_regs
[PIDXLO
] = MISCTL1
; eieio();
1722 p
->cmap_regs
[PIDXDATA
] = 0x01; eieio();
1723 p
->cmap_regs
[PIDXLO
] = MISCTL2
; eieio();
1724 p
->cmap_regs
[PIDXDATA
] = 0x45; eieio();
1728 out_le32(&p
->dc_regs
[STGCTL
], ctrl
);
1731 __initfunc(static void
1732 init_imstt(struct fb_info_imstt
*p
))
1737 tmp
= in_le32(&p
->dc_regs
[PRC
]);
1738 if (p
->ramdac
== IBM
)
1739 p
->total_vram
= (tmp
& 0x0004) ? 0x400000 : 0x200000;
1741 p
->total_vram
= 0x800000;
1743 ip
= (__u32
*)p
->frame_buffer
;
1744 end
= (__u32
*)(p
->frame_buffer
+ p
->total_vram
);
1748 /* initialize the card */
1749 tmp
= in_le32(&p
->dc_regs
[STGCTL
]);
1750 out_le32(&p
->dc_regs
[STGCTL
], tmp
& ~0x1);
1751 out_le32(&p
->dc_regs
[SSR
], 0);
1753 /* set default values for DAC registers */
1754 if (p
->ramdac
== IBM
) {
1755 p
->cmap_regs
[PPMASK
] = 0xff; eieio();
1756 p
->cmap_regs
[PIDXHI
] = 0; eieio();
1757 for (i
= 0; i
< sizeof(ibm_initregs
) / sizeof(*ibm_initregs
); i
++) {
1758 p
->cmap_regs
[PIDXLO
] = ibm_initregs
[i
].addr
; eieio();
1759 p
->cmap_regs
[PIDXDATA
] = ibm_initregs
[i
].value
; eieio();
1762 for (i
= 0; i
< sizeof(tvp_initregs
) / sizeof(*tvp_initregs
); i
++) {
1763 p
->cmap_regs
[TVPADDRW
] = tvp_initregs
[i
].addr
; eieio();
1764 p
->cmap_regs
[TVPIDATA
] = tvp_initregs
[i
].value
; eieio();
1768 #if USE_NV_MODES && defined(CONFIG_PPC)
1770 int vmode
= init_vmode
, cmode
= init_cmode
;
1773 vmode
= nvram_read_byte(NV_VMODE
);
1774 if (vmode
<= 0 || vmode
> VMODE_MAX
)
1775 vmode
= VMODE_640_480_67
;
1778 cmode
= nvram_read_byte(NV_CMODE
);
1779 if (cmode
< CMODE_8
|| cmode
> CMODE_32
)
1782 if (mac_vmode_to_var(vmode
, cmode
, &p
->disp
.var
)) {
1783 p
->disp
.var
.xres
= p
->disp
.var
.xres_virtual
= INIT_XRES
;
1784 p
->disp
.var
.yres
= p
->disp
.var
.yres_virtual
= INIT_YRES
;
1785 p
->disp
.var
.bits_per_pixel
= INIT_BPP
;
1789 p
->disp
.var
.xres
= p
->disp
.var
.xres_virtual
= INIT_XRES
;
1790 p
->disp
.var
.yres
= p
->disp
.var
.yres_virtual
= INIT_YRES
;
1791 p
->disp
.var
.bits_per_pixel
= INIT_BPP
;
1794 if ((p
->disp
.var
.xres
* p
->disp
.var
.yres
) * (p
->disp
.var
.bits_per_pixel
>> 3) > p
->total_vram
1795 || !(compute_imstt_regvals(p
, p
->disp
.var
.xres
, p
->disp
.var
.yres
))) {
1796 printk("imsttfb: %ux%ux%u not supported\n", p
->disp
.var
.xres
, p
->disp
.var
.yres
, p
->disp
.var
.bits_per_pixel
);
1801 sprintf(p
->fix
.id
, "IMS TT (%s)", p
->ramdac
== IBM
? "IBM" : "TVP");
1802 p
->fix
.smem_start
= (__u8
*)p
->frame_buffer_phys
;
1803 p
->fix
.smem_len
= p
->total_vram
;
1804 p
->fix
.mmio_start
= (__u8
*)p
->dc_regs_phys
;
1805 p
->fix
.mmio_len
= 0x40000;
1806 p
->fix
.accel
= FB_ACCEL_IMS_TWINTURBO
;
1807 p
->fix
.type
= FB_TYPE_PACKED_PIXELS
;
1808 p
->fix
.visual
= p
->disp
.var
.bits_per_pixel
== 8 ? FB_VISUAL_PSEUDOCOLOR
1809 : FB_VISUAL_DIRECTCOLOR
;
1810 p
->fix
.line_length
= p
->disp
.var
.xres
* (p
->disp
.var
.bits_per_pixel
>> 3);
1811 p
->fix
.xpanstep
= 8;
1812 p
->fix
.ypanstep
= 1;
1813 p
->fix
.ywrapstep
= 0;
1815 p
->disp
.var
.accel_flags
= noaccel
? 0 : FB_ACCELF_TEXT
;
1816 set_disp(&p
->disp
, p
);
1818 if (!noaccel
&& p
->ramdac
== IBM
)
1819 imstt_cursor_init(p
);
1820 if (p
->disp
.var
.green
.length
== 6)
1824 set_imstt_regvals(p
, p
->disp
.var
.bits_per_pixel
);
1826 p
->disp
.var
.pixclock
= 1000000 / getclkMHz(p
);
1828 strcpy(p
->info
.modename
, p
->fix
.id
);
1829 strcpy(p
->info
.fontname
, fontname
);
1831 p
->info
.fbops
= &imsttfb_ops
;
1832 p
->info
.disp
= &p
->disp
;
1833 p
->info
.changevar
= 0;
1834 p
->info
.switch_con
= &imsttfbcon_switch
;
1835 p
->info
.updatevar
= &imsttfbcon_updatevar
;
1836 p
->info
.blank
= &imsttfbcon_blank
;
1837 p
->info
.flags
= FBINFO_FLAG_DEFAULT
;
1839 for (i
= 0; i
< 16; i
++) {
1840 u_int j
= color_table
[i
];
1841 p
->palette
[i
].red
= default_red
[j
];
1842 p
->palette
[i
].green
= default_grn
[j
];
1843 p
->palette
[i
].blue
= default_blu
[j
];
1846 if (register_framebuffer(&p
->info
) < 0) {
1851 i
= GET_FB_IDX(p
->info
.node
);
1852 tmp
= (in_le32(&p
->dc_regs
[SSTATUS
]) & 0x0f00) >> 8;
1853 printk("fb%u: %s frame buffer; %uMB vram; chip version %u\n",
1854 i
, p
->fix
.id
, p
->total_vram
>> 20, tmp
);
1857 fb_info_imstt_p
[i
] = p
;
1859 #ifdef CONFIG_FB_COMPAT_XPMAC
1860 strncpy(display_info
.name
, "IMS,tt128mb", sizeof(display_info
.name
));
1861 display_info
.fb_address
= (__u32
)p
->frame_buffer_phys
;
1862 display_info
.cmap_adr_address
= (__u32
)&p
->cmap_regs_phys
[PADDRW
];
1863 display_info
.cmap_data_address
= (__u32
)&p
->cmap_regs_phys
[PDATA
];
1864 display_info
.disp_reg_address
= (__u32
)p
->dc_regs_phys
;
1865 if (!console_fb_info
)
1866 console_fb_info
= &p
->info
;
1867 #endif /* CONFIG_FB_COMPAT_XPMAC */
1870 #if defined(CONFIG_FB_OF) && !defined(MODULE)
1872 imsttfb_of_init(struct device_node
*dp
))
1874 struct fb_info_imstt
*p
;
1880 for (i
= 0; i
< dp
->n_addrs
; i
++) {
1881 if (dp
->addrs
[i
].size
>= 0x02000000)
1882 addr
= dp
->addrs
[i
].address
;
1887 if (!pci_device_loc(dp
, &bus
, &devfn
)) {
1888 if (!pcibios_read_config_word(bus
, devfn
, PCI_COMMAND
, &cmd
) && !(cmd
& PCI_COMMAND_MEMORY
)) {
1889 cmd
|= PCI_COMMAND_MEMORY
;
1890 pcibios_write_config_word(bus
, devfn
, PCI_COMMAND
, cmd
);
1894 p
= kmalloc(sizeof(struct fb_info_imstt
), GFP_ATOMIC
);
1897 memset(p
, 0, sizeof(struct fb_info_imstt
));
1899 if (dp
->name
[11] == '8' || (dp
->name
[6] == '3' && dp
->name
[7] == 'd'))
1904 p
->frame_buffer_phys
= (__u8
*)addr
;
1905 p
->frame_buffer
= (__u8
*)ioremap(addr
, p
->ramdac
== IBM
? 0x400000 : 0x800000);
1906 p
->dc_regs_phys
= (__u32
*)(addr
+ 0x800000);
1907 p
->dc_regs
= (__u32
*)ioremap(addr
+ 0x800000, 0x1000);
1908 p
->cmap_regs_phys
= (__u8
*)(addr
+ 0x840000);
1909 p
->cmap_regs
= (__u8
*)ioremap(addr
+ 0x840000, 0x1000);
1918 #if defined(CONFIG_FB_OF) && !defined(MODULE)
1919 /* We don't want to be called like this. */
1920 /* We rely on Open Firmware (offb) instead. */
1921 #elif defined(CONFIG_PCI)
1922 struct pci_dev
*pdev
;
1923 struct fb_info_imstt
*p
;
1927 for (pdev
= pci_devices
; pdev
; pdev
= pdev
->next
) {
1928 if (!(((pdev
->class >> 16) == PCI_BASE_CLASS_DISPLAY
)
1929 && (pdev
->vendor
== PCI_VENDOR_ID_IMS
)))
1932 pci_read_config_word(pdev
, PCI_COMMAND
, &cmd
);
1933 if (!(cmd
& PCI_COMMAND_MEMORY
)) {
1934 cmd
|= PCI_COMMAND_MEMORY
;
1935 pci_write_config_word(pdev
, PCI_COMMAND
, cmd
);
1938 addr
= pdev
->base_address
[0] & PCI_BASE_ADDRESS_MEM_MASK
;
1942 p
= kmalloc(sizeof(struct fb_info_imstt
), GFP_ATOMIC
);
1945 memset(p
, 0, sizeof(struct fb_info_imstt
));
1947 printk("imsttfb: device=%04x\n", pdev
->device
);
1949 switch (pdev
->device
) {
1950 case 0x9128: /* IMS,tt128mbA */
1953 case 0x9135: /* IMS,tt3d */
1959 p
->frame_buffer_phys
= (__u8
*)addr
;
1960 p
->frame_buffer
= (__u8
*)ioremap(addr
, p
->ramdac
== IBM
? 0x400000 : 0x800000);
1961 p
->dc_regs_phys
= (__u32
*)(addr
+ 0x800000);
1962 p
->dc_regs
= (__u32
*)ioremap(addr
+ 0x800000, 0x1000);
1963 p
->cmap_regs_phys
= (__u8
*)(addr
+ 0x840000);
1964 p
->cmap_regs
= (__u8
*)ioremap(addr
+ 0x840000, 0x1000);
1968 #endif /* CONFIG_PCI */
1973 imsttfb_setup(char *options
, int *ints
))
1977 if (!options
|| !*options
)
1980 for (this_opt
= strtok(options
, ","); this_opt
;
1981 this_opt
= strtok(NULL
, ",")) {
1982 if (!strncmp(this_opt
, "font:", 5)) {
1987 for (i
= 0; i
< sizeof(fontname
) - 1; i
++)
1988 if (!*p
|| *p
== ' ' || *p
== ',')
1990 memcpy(fontname
, this_opt
+ 5, i
);
1992 } else if (!strncmp(this_opt
, "noblink", 7)) {
1994 } else if (!strncmp(this_opt
, "noaccel", 7)) {
1997 #if defined(CONFIG_PPC)
1998 else if (!strncmp(this_opt
, "vmode:", 6)) {
1999 int vmode
= simple_strtoul(this_opt
+6, NULL
, 0);
2000 if (vmode
> 0 && vmode
<= VMODE_MAX
)
2002 } else if (!strncmp(this_opt
, "cmode:", 6)) {
2003 int cmode
= simple_strtoul(this_opt
+6, NULL
, 0);
2007 init_cmode
= CMODE_8
;
2012 init_cmode
= CMODE_16
;
2017 init_cmode
= CMODE_32
;
2030 struct fb_info_imstt
*p
;
2035 for (i
= 0; i
< FB_MAX
; i
++) {
2036 p
= fb_info_imstt_p
[i
];
2045 cleanup_module (void)
2047 struct fb_info_imstt
*p
;
2050 for (i
= 0; i
< FB_MAX
; i
++) {
2051 p
= fb_info_imstt_p
[i
];
2054 iounmap(p
->cmap_regs
);
2055 iounmap(p
->dc_regs
);
2056 iounmap(p
->frame_buffer
);
2061 #include "macmodes.c"