2 * XGI 300/630/730/540/315/550/650/740 frame buffer driver
3 * for Linux kernels 2.4.x and 2.5.x
7 * Based on the X driver's XGI300_accel.c which is
8 * Copyright Xavier Ducoin <x.ducoin@lectra.com>
9 * Copyright 2002 by Thomas Winischhofer, Vienna, Austria
10 * and XGI310_accel.c which is
11 * Copyright 2002 by Thomas Winischhofer, Vienna, Austria
13 * Author: Thomas Winischhofer <thomas@winischhofer.net>
14 * (see http://www.winischhofer.net/
15 * for more information and updates)
18 //#include <linux/config.h>
19 #include <linux/version.h>
20 #include <linux/module.h>
21 #include <linux/kernel.h>
22 #include <linux/errno.h>
23 #include <linux/string.h>
25 #include <linux/tty.h>
26 #include <linux/slab.h>
27 #include <linux/delay.h>
29 #include <linux/console.h>
30 #include <linux/selection.h>
31 #include <linux/ioport.h>
32 #include <linux/init.h>
33 #include <linux/pci.h>
34 #include <linux/vt_kern.h>
35 #include <linux/capability.h>
37 #include <linux/agp_backend.h>
39 #include <linux/types.h>
47 #include "vb_struct.h"
49 #include "XGI_accel.h"
51 static const int XGIALUConv[] =
53 0x00, /* dest = 0; 0, GXclear, 0 */
54 0x88, /* dest &= src; DSa, GXand, 0x1 */
55 0x44, /* dest = src & ~dest; SDna, GXandReverse, 0x2 */
56 0xCC, /* dest = src; S, GXcopy, 0x3 */
57 0x22, /* dest &= ~src; DSna, GXandInverted, 0x4 */
58 0xAA, /* dest = dest; D, GXnoop, 0x5 */
59 0x66, /* dest = ^src; DSx, GXxor, 0x6 */
60 0xEE, /* dest |= src; DSo, GXor, 0x7 */
61 0x11, /* dest = ~src & ~dest; DSon, GXnor, 0x8 */
62 0x99, /* dest ^= ~src ; DSxn, GXequiv, 0x9 */
63 0x55, /* dest = ~dest; Dn, GXInvert, 0xA */
64 0xDD, /* dest = src|~dest ; SDno, GXorReverse, 0xB */
65 0x33, /* dest = ~src; Sn, GXcopyInverted, 0xC */
66 0xBB, /* dest |= ~src; DSno, GXorInverted, 0xD */
67 0x77, /* dest = ~src|~dest; DSan, GXnand, 0xE */
68 0xFF, /* dest = 0xFF; 1, GXset, 0xF */
70 /* same ROP but with Pattern as Source */
71 static const int XGIPatALUConv[] =
73 0x00, /* dest = 0; 0, GXclear, 0 */
74 0xA0, /* dest &= src; DPa, GXand, 0x1 */
75 0x50, /* dest = src & ~dest; PDna, GXandReverse, 0x2 */
76 0xF0, /* dest = src; P, GXcopy, 0x3 */
77 0x0A, /* dest &= ~src; DPna, GXandInverted, 0x4 */
78 0xAA, /* dest = dest; D, GXnoop, 0x5 */
79 0x5A, /* dest = ^src; DPx, GXxor, 0x6 */
80 0xFA, /* dest |= src; DPo, GXor, 0x7 */
81 0x05, /* dest = ~src & ~dest; DPon, GXnor, 0x8 */
82 0xA5, /* dest ^= ~src ; DPxn, GXequiv, 0x9 */
83 0x55, /* dest = ~dest; Dn, GXInvert, 0xA */
84 0xF5, /* dest = src|~dest ; PDno, GXorReverse, 0xB */
85 0x0F, /* dest = ~src; Pn, GXcopyInverted, 0xC */
86 0xAF, /* dest |= ~src; DPno, GXorInverted, 0xD */
87 0x5F, /* dest = ~src|~dest; DPan, GXnand, 0xE */
88 0xFF, /* dest = 0xFF; 1, GXset, 0xF */
91 static const unsigned char myrops[] = {
92 3, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
102 /* --------------------------------------------------------------------- */
104 /* The exported routines */
106 int XGIfb_initaccel(void)
111 void XGIfb_syncaccel(void)