2 * linux/drivers/video/neofb.h -- NeoMagic Framebuffer Driver
4 * Copyright (c) 2001 Denis Oliver Kropp <dok@convergence.de>
6 * This file is subject to the terms and conditions of the GNU General
7 * Public License. See the file COPYING in the main directory of this
8 * archive for more details.
13 # define DBG(x) printk (KERN_DEBUG "neofb: %s\n", (x));
19 #define PCI_CHIP_NM2070 0x0001
20 #define PCI_CHIP_NM2090 0x0002
21 #define PCI_CHIP_NM2093 0x0003
22 #define PCI_CHIP_NM2097 0x0083
23 #define PCI_CHIP_NM2160 0x0004
24 #define PCI_CHIP_NM2200 0x0005
25 #define PCI_CHIP_NM2230 0x0025
26 #define PCI_CHIP_NM2360 0x0006
27 #define PCI_CHIP_NM2380 0x0016
31 unsigned int pixclock;
32 unsigned int HDisplay;
33 unsigned int HSyncStart;
34 unsigned int HSyncEnd;
36 unsigned int VDisplay;
37 unsigned int VSyncStart;
38 unsigned int VSyncEnd;
46 /* --------------------------------------------------------------------- */
48 typedef volatile struct {
72 #define NR_PALETTE 256
74 #define MMIO_SIZE 0x200000
76 #define NEO_EXT_CR_MAX 0x85
77 #define NEO_EXT_GR_MAX 0xC7
83 unsigned char MiscOutReg; /* Misc */
84 unsigned char CRTC[25]; /* Crtc Controller */
85 unsigned char Sequencer[5]; /* Video Sequencer */
86 unsigned char Graphics[9]; /* Video Graphics */
87 unsigned char Attribute[21]; /* Video Atribute */
89 unsigned char GeneralLockReg;
90 unsigned char ExtCRTDispAddr;
91 unsigned char ExtCRTOffset;
92 unsigned char SysIfaceCntl1;
93 unsigned char SysIfaceCntl2;
94 unsigned char ExtColorModeSelect;
95 unsigned char biosMode;
97 unsigned char PanelDispCntlReg1;
98 unsigned char PanelDispCntlReg2;
99 unsigned char PanelDispCntlReg3;
100 unsigned char PanelVertCenterReg1;
101 unsigned char PanelVertCenterReg2;
102 unsigned char PanelVertCenterReg3;
103 unsigned char PanelVertCenterReg4;
104 unsigned char PanelVertCenterReg5;
105 unsigned char PanelHorizCenterReg1;
106 unsigned char PanelHorizCenterReg2;
107 unsigned char PanelHorizCenterReg3;
108 unsigned char PanelHorizCenterReg4;
109 unsigned char PanelHorizCenterReg5;
112 unsigned char VCLK3NumeratorLow;
113 unsigned char VCLK3NumeratorHigh;
114 unsigned char VCLK3Denominator;
115 unsigned char VerticalExt;
121 struct display_switch *dispsw;
123 struct pci_dev *pcidev;
155 int internal_display;
156 int external_display;
159 u16 red, green, blue, transp;
160 } palette[NR_PALETTE];
171 /* vga IO functions */
172 static inline u8 VGArCR (u8 index)
178 static inline void VGAwCR (u8 index, u8 val)
184 static inline u8 VGArGR (u8 index)
190 static inline void VGAwGR (u8 index, u8 val)
196 static inline u8 VGArSEQ (u8 index)
202 static inline void VGAwSEQ (u8 index, u8 val)
209 static int paletteEnabled = 0;
211 static inline void VGAenablePalette (void)
220 static inline void VGAdisablePalette (void)
229 static inline void VGAwATTR (u8 index, u8 value)
243 static inline void VGAwMISC (u8 value)
249 #define NEO_BS0_BLT_BUSY 0x00000001
250 #define NEO_BS0_FIFO_AVAIL 0x00000002
251 #define NEO_BS0_FIFO_PEND 0x00000004
253 #define NEO_BC0_DST_Y_DEC 0x00000001
254 #define NEO_BC0_X_DEC 0x00000002
255 #define NEO_BC0_SRC_TRANS 0x00000004
256 #define NEO_BC0_SRC_IS_FG 0x00000008
257 #define NEO_BC0_SRC_Y_DEC 0x00000010
258 #define NEO_BC0_FILL_PAT 0x00000020
259 #define NEO_BC0_SRC_MONO 0x00000040
260 #define NEO_BC0_SYS_TO_VID 0x00000080
262 #define NEO_BC1_DEPTH8 0x00000100
263 #define NEO_BC1_DEPTH16 0x00000200
264 #define NEO_BC1_X_320 0x00000400
265 #define NEO_BC1_X_640 0x00000800
266 #define NEO_BC1_X_800 0x00000c00
267 #define NEO_BC1_X_1024 0x00001000
268 #define NEO_BC1_X_1152 0x00001400
269 #define NEO_BC1_X_1280 0x00001800
270 #define NEO_BC1_X_1600 0x00001c00
271 #define NEO_BC1_DST_TRANS 0x00002000
272 #define NEO_BC1_MSTR_BLT 0x00004000
273 #define NEO_BC1_FILTER_Z 0x00008000
275 #define NEO_BC2_WR_TR_DST 0x00800000
277 #define NEO_BC3_SRC_XY_ADDR 0x01000000
278 #define NEO_BC3_DST_XY_ADDR 0x02000000
279 #define NEO_BC3_CLIP_ON 0x04000000
280 #define NEO_BC3_FIFO_EN 0x08000000
281 #define NEO_BC3_BLT_ON_ADDR 0x10000000
282 #define NEO_BC3_SKIP_MAPPING 0x80000000
284 #define NEO_MODE1_DEPTH8 0x0100
285 #define NEO_MODE1_DEPTH16 0x0200
286 #define NEO_MODE1_DEPTH24 0x0300
287 #define NEO_MODE1_X_320 0x0400
288 #define NEO_MODE1_X_640 0x0800
289 #define NEO_MODE1_X_800 0x0c00
290 #define NEO_MODE1_X_1024 0x1000
291 #define NEO_MODE1_X_1152 0x1400
292 #define NEO_MODE1_X_1280 0x1800
293 #define NEO_MODE1_X_1600 0x1c00
294 #define NEO_MODE1_BLT_ON_ADDR 0x2000