Linux-2.3.3 and a short hiatus..
[davej-history.git] / include / video / sbusfb.h
blob2511cbd5f316346a32f0609e3d2f3c0546139626
1 #include <linux/timer.h>
2 #include <asm/sbus.h>
3 #include <asm/oplib.h>
4 #include <asm/fbio.h>
6 #include <video/fbcon.h>
8 struct bt_regs {
9 volatile unsigned int addr; /* address register */
10 volatile unsigned int color_map; /* color map */
11 volatile unsigned int control; /* control register */
12 volatile unsigned int cursor; /* cursor map register */
15 struct fb_info_creator {
16 struct ffb_fbc *fbc;
17 struct ffb_dac *dac;
18 int xy_margin;
19 int fifo_cache;
20 u64 yx_margin;
21 int fg_cache;
22 int bg_cache;
23 int dac_rev;
25 struct fb_info_cgsix {
26 struct bt_regs *bt;
27 struct cg6_fbc *fbc;
28 struct cg6_thc *thc;
29 struct cg6_tec *tec;
30 volatile u32 *fhc;
32 struct fb_info_bwtwo {
33 struct bw2_regs *regs;
35 struct fb_info_cgthree {
36 struct cg3_regs *regs;
38 struct fb_info_tcx {
39 struct bt_regs *bt;
40 struct tcx_thc *thc;
41 struct tcx_tec *tec;
42 u32 *cplane;
44 struct fb_info_leo {
45 struct leo_lx_krn *lx_krn;
46 struct leo_lc_ss0_usr *lc_ss0_usr;
47 struct leo_ld_ss0 *ld_ss0;
48 struct leo_ld_ss1 *ld_ss1;
49 struct leo_cursor *cursor;
50 unsigned int extent;
52 struct fb_info_cgfourteen {
53 struct cg14_regs *regs;
54 struct cg14_cursor *cursor;
55 struct cg14_clut *clut;
56 int ramsize;
57 int mode;
60 struct cg_cursor {
61 char enable; /* cursor is enabled */
62 char mode; /* cursor mode */
63 struct fbcurpos cpos; /* position */
64 struct fbcurpos chot; /* hot-spot */
65 struct fbcurpos size; /* size of mask & image fields */
66 struct fbcurpos hwsize; /* hw max size */
67 int bits[2][128]; /* space for mask & image bits */
68 char color [6]; /* cursor colors */
69 struct timer_list timer; /* cursor timer */
70 int blink_rate; /* cursor blink rate */
73 struct sbus_mmap_map {
74 unsigned long voff;
75 unsigned long poff;
76 unsigned long size;
79 #define SBUS_MMAP_FBSIZE(n) (-n)
80 #define SBUS_MMAP_EMPTY 0x80000000
82 struct fb_info_sbusfb {
83 struct fb_info info;
84 struct fb_fix_screeninfo fix;
85 struct fb_var_screeninfo var;
86 struct display disp;
87 struct display_switch dispsw;
88 struct fbtype type;
89 struct linux_sbus_device *sbdp;
90 int prom_node, prom_parent;
91 union {
92 struct fb_info_creator ffb;
93 struct fb_info_cgsix cg6;
94 struct fb_info_bwtwo bw2;
95 struct fb_info_cgthree cg3;
96 struct fb_info_tcx tcx;
97 struct fb_info_leo leo;
98 struct fb_info_cgfourteen cg14;
99 } s;
100 unsigned char *color_map;
101 struct cg_cursor cursor;
102 unsigned char open;
103 unsigned char mmaped;
104 unsigned char blanked;
105 int x_margin;
106 int y_margin;
107 int vtconsole;
108 int consolecnt;
109 int graphmode;
110 int emulations[4];
111 struct sbus_mmap_map *mmap_map;
112 unsigned long physbase;
113 int iospace;
114 /* Methods */
115 void (*setup)(struct display *);
116 void (*setcursor)(struct fb_info_sbusfb *);
117 void (*setcurshape)(struct fb_info_sbusfb *);
118 void (*setcursormap)(struct fb_info_sbusfb *, unsigned char *, unsigned char *, unsigned char *);
119 void (*loadcmap)(struct fb_info_sbusfb *, struct display *, int, int);
120 void (*blank)(struct fb_info_sbusfb *);
121 void (*unblank)(struct fb_info_sbusfb *);
122 void (*margins)(struct fb_info_sbusfb *, struct display *, int, int);
123 void (*reset)(struct fb_info_sbusfb *);
124 void (*fill)(struct fb_info_sbusfb *, struct display *, int, int, unsigned short *);
125 void (*switch_from_graph)(struct fb_info_sbusfb *);
126 void (*restore_palette)(struct fb_info_sbusfb *);
127 int (*ioctl)(struct fb_info_sbusfb *, unsigned int, unsigned long);
130 extern char *creatorfb_init(struct fb_info_sbusfb *);
131 extern char *cgsixfb_init(struct fb_info_sbusfb *);
132 extern char *cgthreefb_init(struct fb_info_sbusfb *);
133 extern char *tcxfb_init(struct fb_info_sbusfb *);
134 extern char *leofb_init(struct fb_info_sbusfb *);
135 extern char *bwtwofb_init(struct fb_info_sbusfb *);
136 extern char *cgfourteenfb_init(struct fb_info_sbusfb *);
138 #define sbusfbinfod(disp) ((struct fb_info_sbusfb *)(disp->fb_info))
139 #define sbusfbinfo(info) ((struct fb_info_sbusfb *)(info))
140 #define CM(i, j) [3*(i)+(j)]
142 #define SBUSFBINIT_SIZECHANGE ((char *)-1)