1 /* $Id: leofb.c,v 1.7 1999/08/09 11:06:52 jj Exp $
2 * leofb.c: Leo (ZX) 24/8bit frame buffer driver
4 * Copyright (C) 1996-1999 Jakub Jelinek (jj@ultra.linux.cz)
5 * Copyright (C) 1997 Michal Rehacek (Michal.Rehacek@st.mff.cuni.cz)
8 #include <linux/module.h>
9 #include <linux/sched.h>
10 #include <linux/kernel.h>
11 #include <linux/errno.h>
12 #include <linux/string.h>
14 #include <linux/tty.h>
15 #include <linux/malloc.h>
16 #include <linux/vmalloc.h>
17 #include <linux/delay.h>
18 #include <linux/interrupt.h>
20 #include <linux/init.h>
21 #include <linux/selection.h>
23 #include <video/sbusfb.h>
26 #define LEO_OFF_LC_SS0_KRN 0x00200000
27 #define LEO_OFF_LC_SS0_USR 0x00201000
28 #define LEO_OFF_LC_SS1_KRN 0x01200000
29 #define LEO_OFF_LC_SS1_USR 0x01201000
30 #define LEO_OFF_LD_SS0 0x00400000
31 #define LEO_OFF_LD_SS1 0x01400000
32 #define LEO_OFF_LD_GBL 0x00401000
33 #define LEO_OFF_LX_KRN 0x00600000
34 #define LEO_OFF_LX_CURSOR 0x00601000
35 #define LEO_OFF_SS0 0x00800000
36 #define LEO_OFF_SS1 0x01800000
37 #define LEO_OFF_UNK 0x00602000
38 #define LEO_OFF_UNK2 0x00000000
40 #define LEO_CUR_ENABLE 0x00000080
41 #define LEO_CUR_UPDATE 0x00000030
42 #define LEO_CUR_PROGRESS 0x00000006
43 #define LEO_CUR_UPDATECMAP 0x00000003
45 #define LEO_CUR_TYPE_MASK 0x00000000
46 #define LEO_CUR_TYPE_IMAGE 0x00000020
47 #define LEO_CUR_TYPE_CMAP 0x00000050
51 volatile u32 cur_type
;
52 volatile u32 cur_misc
;
53 volatile u32 cur_cursxy
;
54 volatile u32 cur_data
;
57 #define LEO_KRN_TYPE_CLUT0 0x00001000
58 #define LEO_KRN_TYPE_CLUT1 0x00001001
59 #define LEO_KRN_TYPE_CLUT2 0x00001002
60 #define LEO_KRN_TYPE_WID 0x00001003
61 #define LEO_KRN_TYPE_UNK 0x00001006
62 #define LEO_KRN_TYPE_VIDEO 0x00002003
63 #define LEO_KRN_TYPE_CLUTDATA 0x00004000
64 #define LEO_KRN_CSR_ENABLE 0x00000008
65 #define LEO_KRN_CSR_PROGRESS 0x00000004
66 #define LEO_KRN_CSR_UNK 0x00000002
67 #define LEO_KRN_CSR_UNK2 0x00000001
70 volatile u32 krn_type
;
72 volatile u32 krn_value
;
75 struct leo_lc_ss0_krn
{
81 struct leo_lc_ss0_usr
{
83 volatile u32 addrspace
;
93 struct leo_lc_ss1_krn
{
97 struct leo_lc_ss1_usr
{
106 volatile u32 widclip
;
107 volatile u32 vclipmin
;
108 volatile u32 vclipmax
;
109 volatile u32 pickmin
; /* SS1 only */
110 volatile u32 pickmax
; /* SS1 only */
113 volatile u32 src
; /* Copy/Scroll (SS0 only) */
114 volatile u32 dst
; /* Copy/Scroll/Fill (SS0 only) */
115 volatile u32 extent
; /* Copy/Scroll/Fill size (SS0 only) */
117 volatile u32 setsem
; /* SS1 only */
118 volatile u32 clrsem
; /* SS1 only */
119 volatile u32 clrpick
; /* SS1 only */
120 volatile u32 clrdat
; /* SS1 only */
121 volatile u32 alpha
; /* SS1 only */
124 volatile u32 planemask
;
127 volatile u32 dczf
; /* SS1 only */
128 volatile u32 dczb
; /* SS1 only */
129 volatile u32 dcs
; /* SS1 only */
130 volatile u32 dczs
; /* SS1 only */
131 volatile u32 pickfb
; /* SS1 only */
132 volatile u32 pickbb
; /* SS1 only */
133 volatile u32 dcfc
; /* SS1 only */
134 volatile u32 forcecol
; /* SS1 only */
135 volatile u32 door
[8]; /* SS1 only */
136 volatile u32 pick
[5]; /* SS1 only */
139 #define LEO_SS1_MISC_ENABLE 0x00000001
140 #define LEO_SS1_MISC_STEREO 0x00000002
143 volatile u32 ss1_misc
;
150 static struct sbus_mmap_map leo_mmap_map
[] = {
151 { LEO_SS0_MAP
, LEO_OFF_SS0
, 0x800000 },
152 { LEO_LC_SS0_USR_MAP
, LEO_OFF_LC_SS0_USR
, 0x1000 },
153 { LEO_LD_SS0_MAP
, LEO_OFF_LD_SS0
, 0x1000 },
154 { LEO_LX_CURSOR_MAP
, LEO_OFF_LX_CURSOR
, 0x1000 },
155 { LEO_SS1_MAP
, LEO_OFF_SS1
, 0x800000 },
156 { LEO_LC_SS1_USR_MAP
, LEO_OFF_LC_SS1_USR
, 0x1000 },
157 { LEO_LD_SS1_MAP
, LEO_OFF_LD_SS1
, 0x1000 },
158 { LEO_UNK_MAP
, LEO_OFF_UNK
, 0x1000 },
159 { LEO_LX_KRN_MAP
, LEO_OFF_LX_KRN
, 0x1000 },
160 { LEO_LC_SS0_KRN_MAP
, LEO_OFF_LC_SS0_KRN
, 0x1000 },
161 { LEO_LC_SS1_KRN_MAP
, LEO_OFF_LC_SS1_KRN
, 0x1000 },
162 { LEO_LD_GBL_MAP
, LEO_OFF_LD_GBL
, 0x1000 },
163 { LEO_UNK2_MAP
, LEO_OFF_UNK2
, 0x100000 },
167 static void leo_setup(struct display
*p
)
173 static void leo_clear(struct vc_data
*conp
, struct display
*p
, int sy
, int sx
,
174 int height
, int width
)
176 struct fb_info_sbusfb
*fb
= (struct fb_info_sbusfb
*)p
->fb_info
;
177 register struct leo_lc_ss0_usr
*us
= fb
->s
.leo
.lc_ss0_usr
;
178 register struct leo_ld
*ss
= fb
->s
.leo
.ld_ss0
;
184 } while (i
& 0x20000000);
185 ss
->fg
= (attr_bgcol_ec(p
,conp
)<<24);
186 if (fontheightlog(p
)) {
187 y
= sy
<< fontheightlog(p
); h
= height
<< fontheightlog(p
);
189 y
= sy
* fontheight(p
); h
= height
* fontheight(p
);
191 if (fontwidthlog(p
)) {
192 x
= sx
<< fontwidthlog(p
); w
= width
<< fontwidthlog(p
);
194 x
= sx
* fontwidth(p
); w
= width
* fontwidth(p
);
196 us
->extent
= (w
- 1) | ((h
- 1) << 11);
197 us
->fill
= (x
+ fb
->x_margin
) | ((y
+ fb
->y_margin
) << 11) |
201 static void leo_fill(struct fb_info_sbusfb
*fb
, struct display
*p
, int s
,
202 int count
, unsigned short *boxes
)
205 register struct leo_lc_ss0_usr
*us
= fb
->s
.leo
.lc_ss0_usr
;
206 register struct leo_ld
*ss
= fb
->s
.leo
.ld_ss0
;
208 ss
->fg
= (attr_bgcol(p
,s
)<<24);
209 while (count
-- > 0) {
212 } while (i
& 0x20000000);
213 us
->extent
= (boxes
[2] - boxes
[0] - 1) |
214 ((boxes
[3] - boxes
[1] - 1) << 11);
215 us
->fill
= boxes
[0] | (boxes
[1] << 11) | 0x80000000;
220 static void leo_putc(struct vc_data
*conp
, struct display
*p
, int c
, int yy
, int xx
)
222 struct fb_info_sbusfb
*fb
= (struct fb_info_sbusfb
*)p
->fb_info
;
223 register struct leo_lc_ss0_usr
*us
= fb
->s
.leo
.lc_ss0_usr
;
224 register struct leo_ld
*ss
= fb
->s
.leo
.ld_ss0
;
229 if (fontheightlog(p
)) {
230 y
= yy
<< (fontheightlog(p
) + 11);
231 i
= (c
& p
->charmask
) << fontheightlog(p
);
233 y
= (yy
* fontheight(p
)) << 11;
234 i
= (c
& p
->charmask
) * fontheight(p
);
236 if (fontwidth(p
) <= 8)
237 fd
= p
->fontdata
+ i
;
239 fd
= p
->fontdata
+ (i
<< 1);
241 x
= xx
<< fontwidthlog(p
);
243 x
= xx
* fontwidth(p
);
246 } while (i
& 0x20000000);
247 ss
->fg
= attr_fgcol(p
,c
) << 24;
248 ss
->bg
= attr_bgcol(p
,c
) << 24;
249 us
->fontmsk
= 0xFFFFFFFF<<(32-fontwidth(p
));
250 u
= ((u32
*)p
->screen_base
) + y
+ x
;
251 if (fontwidth(p
) <= 8) {
252 for (i
= 0; i
< fontheight(p
); i
++, u
+= 2048)
255 for (i
= 0; i
< fontheight(p
); i
++, u
+= 2048) {
256 *u
= *(u16
*)fd
<< 16;
262 static void leo_putcs(struct vc_data
*conp
, struct display
*p
, const unsigned short *s
,
263 int count
, int yy
, int xx
)
265 struct fb_info_sbusfb
*fb
= (struct fb_info_sbusfb
*)p
->fb_info
;
266 register struct leo_lc_ss0_usr
*us
= fb
->s
.leo
.lc_ss0_usr
;
267 register struct leo_ld
*ss
= fb
->s
.leo
.ld_ss0
;
269 u8
*fd1
, *fd2
, *fd3
, *fd4
;
274 } while (i
& 0x20000000);
275 ss
->fg
= attr_fgcol(p
,scr_readw(s
)) << 24;
276 ss
->bg
= attr_bgcol(p
,scr_readw(s
)) << 24;
277 us
->fontmsk
= 0xFFFFFFFF<<(32-fontwidth(p
));
279 x
= (xx
<< fontwidthlog(p
));
281 x
= xx
* fontwidth(p
);
282 if (fontheightlog(p
))
283 y
= yy
<< (fontheightlog(p
) + 11);
285 y
= (yy
* fontheight(p
)) << 11;
286 u
= ((u32
*)p
->screen_base
) + y
+ x
;
287 if (fontwidth(p
) <= 8) {
288 us
->fontmsk
= 0xFFFFFFFF<<(32-4*fontwidth(p
));
289 x
= 4*fontwidth(p
) - fontheight(p
)*2048;
292 if (fontheightlog(p
)) {
293 fd1
= p
->fontdata
+ ((scr_readw(s
++) & p
->charmask
) << fontheightlog(p
));
294 fd2
= p
->fontdata
+ ((scr_readw(s
++) & p
->charmask
) << fontheightlog(p
));
295 fd3
= p
->fontdata
+ ((scr_readw(s
++) & p
->charmask
) << fontheightlog(p
));
296 fd4
= p
->fontdata
+ ((scr_readw(s
++) & p
->charmask
) << fontheightlog(p
));
298 fd1
= p
->fontdata
+ ((scr_readw(s
++) & p
->charmask
) * fontheight(p
));
299 fd2
= p
->fontdata
+ ((scr_readw(s
++) & p
->charmask
) * fontheight(p
));
300 fd3
= p
->fontdata
+ ((scr_readw(s
++) & p
->charmask
) * fontheight(p
));
301 fd4
= p
->fontdata
+ ((scr_readw(s
++) & p
->charmask
) * fontheight(p
));
303 if (fontwidth(p
) == 8) {
304 for (i
= 0; i
< fontheight(p
); i
++, u
+= 2048)
305 *u
= ((u32
)*fd4
++) | ((((u32
)*fd3
++) | ((((u32
)*fd2
++) | (((u32
)*fd1
++)
309 for (i
= 0; i
< fontheight(p
); i
++, u
+= 2048)
310 *u
= (((u32
)*fd4
++) | ((((u32
)*fd3
++) | ((((u32
)*fd2
++) | (((u32
)*fd1
++)
311 << fontwidth(p
))) << fontwidth(p
))) << fontwidth(p
))) << (24 - 3 * fontwidth(p
));
316 us
->fontmsk
= 0xFFFFFFFF<<(32-2*fontwidth(p
));
317 x
= 2*fontwidth(p
) - fontheight(p
)*2048;
320 if (fontheightlog(p
)) {
321 fd1
= p
->fontdata
+ ((scr_readw(s
++) & p
->charmask
) << (fontheightlog(p
) + 1));
322 fd2
= p
->fontdata
+ ((scr_readw(s
++) & p
->charmask
) << (fontheightlog(p
) + 1));
324 fd1
= p
->fontdata
+ (((scr_readw(s
++) & p
->charmask
) * fontheight(p
)) << 1);
325 fd2
= p
->fontdata
+ (((scr_readw(s
++) & p
->charmask
) * fontheight(p
)) << 1);
327 for (i
= 0; i
< fontheight(p
); i
++, u
+= 2048) {
328 *u
= ((((u32
)*(u16
*)fd1
) << fontwidth(p
)) | ((u32
)*(u16
*)fd2
)) << (16 - fontwidth(p
));
334 us
->fontmsk
= 0xFFFFFFFF<<(32-fontwidth(p
));
335 x
= fontwidth(p
) - fontheight(p
)*2048;
338 if (fontheightlog(p
))
339 i
= ((scr_readw(s
++) & p
->charmask
) << fontheightlog(p
));
341 i
= ((scr_readw(s
++) & p
->charmask
) * fontheight(p
));
342 if (fontwidth(p
) <= 8) {
343 fd1
= p
->fontdata
+ i
;
344 for (i
= 0; i
< fontheight(p
); i
++, u
+= 2048)
347 fd1
= p
->fontdata
+ (i
<< 1);
348 for (i
= 0; i
< fontheight(p
); i
++, u
+= 2048) {
349 *u
= *(u16
*)fd1
<< 16;
357 static void leo_revc(struct display
*p
, int xx
, int yy
)
359 /* Not used if hw cursor */
362 static int leo_wait (struct leo_lx_krn
*lx_krn
)
366 for (i
= 0; (lx_krn
->krn_csr
& LEO_KRN_CSR_PROGRESS
) && i
< 300000; i
++)
367 udelay (1); /* Busy wait at most 0.3 sec */
368 if (i
== 300000) return -EFAULT
; /* Timed out - should we print some message? */
372 static void leo_loadcmap (struct fb_info_sbusfb
*fb
, struct display
*p
, int index
, int count
)
374 struct leo_lx_krn
*lx_krn
= fb
->s
.leo
.lx_krn
;
377 lx_krn
->krn_type
= LEO_KRN_TYPE_CLUT0
;
378 i
= leo_wait (lx_krn
);
380 lx_krn
->krn_type
= LEO_KRN_TYPE_CLUTDATA
;
381 for (i
= 0; i
< 256; i
++)
382 lx_krn
->krn_value
= fb
->color_map
CM(i
,0) |
383 (fb
->color_map
CM(i
,1) << 8) |
384 (fb
->color_map
CM(i
,2) << 16); /* Throw colors there :)) */
385 lx_krn
->krn_type
= LEO_KRN_TYPE_CLUT0
;
386 lx_krn
->krn_csr
|= (LEO_KRN_CSR_UNK
|LEO_KRN_CSR_UNK2
);
389 static void leo_restore_palette (struct fb_info_sbusfb
*fb
)
391 fb
->s
.leo
.ld_ss1
->ss1_misc
&= ~(LEO_SS1_MISC_ENABLE
);
394 static struct display_switch leo_dispsw __initdata
= {
395 leo_setup
, fbcon_redraw_bmove
, leo_clear
, leo_putc
, leo_putcs
, leo_revc
,
396 NULL
, NULL
, NULL
, FONTWIDTHRANGE(1,16) /* Allow fontwidths up to 16 */
399 static void leo_setcursormap (struct fb_info_sbusfb
*fb
, u8
*red
, u8
*green
, u8
*blue
)
401 struct leo_cursor
*l
= fb
->s
.leo
.cursor
;
404 for (i
= 0; (l
->cur_misc
& LEO_CUR_PROGRESS
) && i
< 300000; i
++)
405 udelay (1); /* Busy wait at most 0.3 sec */
406 if (i
== 300000) return; /* Timed out - should we print some message? */
407 l
->cur_type
= LEO_CUR_TYPE_CMAP
;
408 l
->cur_data
= (red
[0] | (green
[0]<<8) | (blue
[0]<<16));
409 l
->cur_data
= (red
[1] | (green
[1]<<8) | (blue
[1]<<16));
410 l
->cur_misc
= LEO_CUR_UPDATECMAP
;
413 /* Set cursor shape */
414 static void leo_setcurshape (struct fb_info_sbusfb
*fb
)
418 struct leo_cursor
*l
= fb
->s
.leo
.cursor
;
420 l
->cur_misc
&= ~LEO_CUR_ENABLE
;
421 for (k
= 0; k
< 2; k
++) {
422 l
->cur_type
= (k
* LEO_CUR_TYPE_IMAGE
); /* LEO_CUR_TYPE_MASK is 0 */
423 for (i
= 0; i
< 32; i
++) {
425 m
= fb
->cursor
.bits
[k
][i
];
426 /* mask = m with reversed bit order */
427 for (j
= 0, n
= 1; j
< 32; j
++, n
<<= 1)
429 mask
|= (0x80000000 >> j
);
433 l
->cur_misc
|= LEO_CUR_ENABLE
;
436 /* Load cursor information */
437 static void leo_setcursor (struct fb_info_sbusfb
*fb
)
439 struct cg_cursor
*c
= &fb
->cursor
;
440 struct leo_cursor
*l
= fb
->s
.leo
.cursor
;
442 l
->cur_misc
&= ~LEO_CUR_ENABLE
;
443 l
->cur_cursxy
= ((c
->cpos
.fbx
- c
->chot
.fbx
) & 0x7ff)
444 |(((c
->cpos
.fby
- c
->chot
.fby
) & 0x7ff) << 11);
445 l
->cur_misc
|= LEO_CUR_UPDATE
;
447 l
->cur_misc
|= LEO_CUR_ENABLE
;
450 static void leo_blank (struct fb_info_sbusfb
*fb
)
452 fb
->s
.leo
.lx_krn
->krn_type
= LEO_KRN_TYPE_VIDEO
;
453 fb
->s
.leo
.lx_krn
->krn_csr
&= ~LEO_KRN_CSR_ENABLE
;
456 static void leo_unblank (struct fb_info_sbusfb
*fb
)
458 fb
->s
.leo
.lx_krn
->krn_type
= LEO_KRN_TYPE_VIDEO
;
459 if (!(fb
->s
.leo
.lx_krn
->krn_csr
& LEO_KRN_CSR_ENABLE
))
460 fb
->s
.leo
.lx_krn
->krn_csr
|= LEO_KRN_CSR_ENABLE
;
464 leo_wid_put (struct fb_info_sbusfb
*fb
, struct fb_wid_list
*wl
)
466 struct leo_lx_krn
*lx_krn
= fb
->s
.leo
.lx_krn
;
467 struct fb_wid_item
*wi
;
470 lx_krn
->krn_type
= LEO_KRN_TYPE_WID
;
471 i
= leo_wait (lx_krn
);
473 for (i
= 0, wi
= wl
->wl_list
; i
< wl
->wl_count
; i
++, wi
++) {
474 switch (wi
->wi_type
) {
475 case FB_WID_DBL_8
: j
= (wi
->wi_index
& 0xf) + 0x40; break;
476 case FB_WID_DBL_24
: j
= wi
->wi_index
& 0x3f; break;
477 default: return -EINVAL
;
479 lx_krn
->krn_type
= 0x5800 + j
;
480 lx_krn
->krn_value
= wi
->wi_values
[0];
482 lx_krn
->krn_type
= LEO_KRN_TYPE_WID
;
487 static void leo_margins (struct fb_info_sbusfb
*fb
, struct display
*p
, int x_margin
, int y_margin
)
489 p
->screen_base
+= 8192 * (y_margin
- fb
->y_margin
) + 4 * (x_margin
- fb
->x_margin
);
492 static void leo_switch_from_graph (struct fb_info_sbusfb
*fb
)
494 register struct leo_lc_ss0_usr
*us
= fb
->s
.leo
.lc_ss0_usr
;
495 register struct leo_ld
*ss
= fb
->s
.leo
.ld_ss0
;
497 ss
->wid
= 0xffffffff;
500 ss
->vclipmax
= fb
->s
.leo
.extent
;
501 ss
->planemask
= 0xff000000;
508 static int __init
leo_rasterimg (struct fb_info
*info
, int start
)
510 struct fb_info_sbusfb
*fb
= sbusfbinfo(info
);
511 register struct leo_lc_ss0_usr
*us
= fb
->s
.leo
.lc_ss0_usr
;
512 register struct leo_ld
*ss
= fb
->s
.leo
.ld_ss0
;
516 ss
->planemask
= 0xffffff;
520 ss
->wid
= 0xffffffff;
521 ss
->planemask
= 0xff000000;
528 static char idstring
[40] __initdata
= { 0 };
530 char * __init
leofb_init(struct fb_info_sbusfb
*fb
)
532 struct fb_fix_screeninfo
*fix
= &fb
->fix
;
533 struct fb_var_screeninfo
*var
= &fb
->var
;
534 struct display
*disp
= &fb
->disp
;
535 struct fbtype
*type
= &fb
->type
;
536 unsigned long phys
= fb
->sbdp
->reg_addrs
[0].phys_addr
;
537 struct fb_wid_item wi
;
538 struct fb_wid_list wl
;
540 register struct leo_lc_ss0_usr
*us
;
541 register struct leo_ld
*ss
;
542 struct fb_ops
*fbops
;
544 strcpy(fb
->info
.modename
, "Leo");
546 strcpy(fix
->id
, "Leo");
547 fix
->visual
= FB_VISUAL_TRUECOLOR
;
548 fix
->line_length
= 8192;
549 fix
->accel
= FB_ACCEL_SUN_LEO
;
551 var
->bits_per_pixel
= 32;
552 var
->green
.offset
= 8;
553 var
->blue
.offset
= 16;
554 var
->accel_flags
= FB_ACCELF_TEXT
;
556 fbops
= kmalloc(sizeof(*fbops
), GFP_KERNEL
);
557 if (!fbops
) return NULL
;
559 *fbops
= *fb
->info
.fbops
;
560 fbops
->fb_rasterimg
= leo_rasterimg
;
561 fb
->info
.fbops
= fbops
;
563 disp
->scrollmode
= SCROLL_YREDRAW
;
564 if (!disp
->screen_base
)
565 disp
->screen_base
= (char *)sparc_alloc_io(phys
+ LEO_OFF_SS0
, 0,
566 0x800000, "leo_ram", fb
->iospace
, 0);
567 disp
->screen_base
+= 8192 * fb
->y_margin
+ 4 * fb
->x_margin
;
568 us
= fb
->s
.leo
.lc_ss0_usr
= (struct leo_lc_ss0_usr
*)
569 sparc_alloc_io(phys
+ LEO_OFF_LC_SS0_USR
, 0,
570 0x1000, "leo_lc_ss0_usr", fb
->iospace
, 0);
571 ss
= fb
->s
.leo
.ld_ss0
= (struct leo_ld
*)
572 sparc_alloc_io(phys
+ LEO_OFF_LD_SS0
, 0,
573 0x1000, "leo_ld_ss0", fb
->iospace
, 0);
574 fb
->s
.leo
.ld_ss1
= (struct leo_ld_ss1
*)
575 sparc_alloc_io(phys
+ LEO_OFF_LD_SS1
, 0,
576 0x1000, "leo_ld_ss1", fb
->iospace
, 0);
577 fb
->s
.leo
.lx_krn
= (struct leo_lx_krn
*)
578 sparc_alloc_io(phys
+ LEO_OFF_LX_KRN
, 0,
579 0x1000, "leo_lx_krn", fb
->iospace
, 0);
580 fb
->s
.leo
.cursor
= (struct leo_cursor
*)
581 sparc_alloc_io(phys
+ LEO_OFF_LX_CURSOR
, 0,
582 sizeof(struct leo_cursor
), "leo_lx_cursor", fb
->iospace
, 0);
583 fb
->dispsw
= leo_dispsw
;
585 fb
->s
.leo
.extent
= (type
->fb_width
-1) | ((type
->fb_height
-1) << 16);
589 wi
.wi_type
= FB_WID_DBL_8
;
591 wi
.wi_values
[0] = 0x2c0;
592 leo_wid_put (fb
, &wl
);
594 wi
.wi_values
[0] = 0x30;
595 leo_wid_put (fb
, &wl
);
597 wi
.wi_values
[0] = 0x20;
598 leo_wid_put (fb
, &wl
);
599 wi
.wi_type
= FB_WID_DBL_24
;
601 wi
.wi_values
[0] = 0x30;
602 leo_wid_put (fb
, &wl
);
604 fb
->s
.leo
.ld_ss1
->ss1_misc
|= LEO_SS1_MISC_ENABLE
;
606 ss
->wid
= 0xffffffff;
609 ss
->vclipmax
= fb
->s
.leo
.extent
;
611 ss
->planemask
= 0xff000000;
614 us
->extent
= (type
->fb_width
-1) | ((type
->fb_height
-1) << 11);
616 us
->fill
= 0x80000000;
620 } while (i
& 0x20000000);
622 fb
->margins
= leo_margins
;
623 fb
->loadcmap
= leo_loadcmap
;
624 fb
->setcursor
= leo_setcursor
;
625 fb
->setcursormap
= leo_setcursormap
;
626 fb
->setcurshape
= leo_setcurshape
;
627 fb
->restore_palette
= leo_restore_palette
;
628 fb
->switch_from_graph
= leo_switch_from_graph
;
630 fb
->blank
= leo_blank
;
631 fb
->unblank
= leo_unblank
;
634 fb
->mmap_map
= leo_mmap_map
;
637 sprintf(idstring
, "leo at %016lx", phys
);
639 sprintf(idstring
, "leo at %x.%08lx", fb
->iospace
, phys
);