summaryrefslogtreecommitdiff
path: root/driver/xf86-video-ark/src/ark.h
blob: ba94b1a04ea28941a29b744539a0c832061663be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
 * ark
 */

#ifndef _ARK_H
#define _ARK_H

#include "xf86.h"
#include "xf86Pci.h"
#ifdef HAVE_XAA_H
#include "xaa.h"
#endif
#include "vgaHW.h"

#include "compat-api.h"
#define PCI_VENDOR_ARK			0xEDD8
#define PCI_CHIP_1000PV			0xA091
#define PCI_CHIP_2000PV			0xA099
#define PCI_CHIP_2000MT			0xA0A1
#define PCI_CHIP_2000MI			0xA0A9

typedef struct _ARKRegRec {
	unsigned char		sr10, sr11, sr12, sr13, sr14,
				sr15, sr16, sr17, sr18, sr20,
				sr21, sr22, sr23, sr24, sr25,
				sr26, sr27, sr28, sr29, sr2a,
				sr2b;
	unsigned char		sr1c, sr1d;
	unsigned char		cr40, cr41, cr42, cr44, cr46;
	unsigned char		dac_command;
	unsigned char		stg_17xx[3];
	unsigned char		gendac[6];
} ARKRegRec, *ARKRegPtr;


typedef struct _ARKRec {
#ifndef XSERVER_LIBPCIACCESS	
	pciVideoPtr		PciInfo;
	PCITAG			PciTag;
#else
	struct pci_device       *PciInfo;
#endif
	EntityInfoPtr		pEnt;
	CARD32			IOAddress;
	pointer			FBBase;
	pointer			MMIOBase;
	unsigned long		videoRam;
	OptionInfoPtr		Options;
	unsigned int		Flags;
	Bool			NoAccel;
	CARD32			Bus;
#ifdef HAVE_XAA_H
	XAAInfoRecPtr		pXAA;
#endif
	int			Chipset, ChipRev;
	int			clock_mult;
	int			dac_width;
	int			multiplex_threshold;
	int			ramdac;
	ARKRegRec		SavedRegs;	/* original mode */
	ARKRegRec		ModeRegs;	/* current mode */
	Bool			(*CloseScreen)(CLOSE_SCREEN_ARGS_DECL);
} ARKRec, *ARKPtr;


#define ARKPTR(p)	((ARKPtr)((p)->driverPrivate))


#define DRIVER_NAME	"ark"
#define DRIVER_VERSION	PACKAGE_VERSION
#define VERSION_MAJOR	PACKAGE_VERSION_MAJOR
#define VERSION_MINOR	PACKAGE_VERSION_MINOR
#define PATCHLEVEL	PACKAGE_VERSION_PATCHLEVEL
#define ARK_VERSION	((VERSION_MAJOR << 24) | \
			 (VERSION_MINOR << 16) | \
			  PATCHLEVEL)

#define	ZOOMDAC		0x404
#define ATT490		0x101

Bool ARKAccelInit(ScreenPtr pScreen);

#define rdinx(port, ind)	(outb((port), (ind)), inb((port) + 1))
#define wrinx(port, ind, val)						\
    do {								\
	outb((port), (ind));  outb((port) + 1, (val));			\
    } while(0)
#define modinx(port, ind, mask, bits)					\
    do {								\
	unsigned char tmp;						\
	tmp = (rdinx((port), (ind)) & ~(mask)) | ((bits) & (mask));	\
	wrinx((port), (ind), tmp);					\
    } while(0)

#endif /* _ARK_H */