summaryrefslogtreecommitdiff
path: root/src/cir.h
blob: 904d9cc60270bf315dec1dba8b308b4c5842b89d (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
96
97
98
99
100
101
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h,v 1.20 2002/01/04 21:26:54 tsi Exp $ */

/* (c) Itai Nahshon */

#ifndef CIR_H
#define CIR_H

#include "xf86Cursor.h"
#include "xaa.h"
#include "xf86i2c.h"
#include <string.h>
#include <stdlib.h>

#include "cir_pcirename.h"

/* Card-specific driver information */
#define CIRPTR(p) ((CirPtr)((p)->driverPrivate))
struct lgRec;
struct alpRec;

typedef struct {
	ScrnInfoPtr		pScrn;
	CARD32			properties;
	pciVideoPtr		PciInfo;
	PCITAG			PciTag;
	IOADDRESS		PIOReg;
    union {
	struct lgRec		*lg;
	struct alpRec		*alp;
    } chip;
	EntityInfoPtr		pEnt;
	int			Chipset;
	int			ChipRev;
	int			Rounding;
	int			BppShift;
	Bool			HasFBitBlt;
	CARD32			IOAddress;
	CARD32			FbAddress;
	void *			IOBase;
	void *			FbBase;
	long			FbMapSize;
	long			IoMapSize;
	int			MinClock;
	int			MaxClock;
	Bool			NoAccel;
	Bool			HWCursor;
	Bool			UseMMIO;
	XAAInfoRecPtr		AccelInfoRec;
	xf86CursorInfoPtr	CursorInfoRec;
	int			DGAnumModes;
	DGAModePtr		DGAModes;
	Bool			DGAactive;
	Bool			(*DGAModeInit)(ScrnInfoPtr, DisplayModePtr);
	int			DGAViewportStatus;
	I2CBusPtr		I2CPtr1;
	I2CBusPtr		I2CPtr2;
	CloseScreenProcPtr	CloseScreen;

	Bool			CursorIsSkewed;
	Bool			shadowFB;
	int			rotate;
	int			ShadowPitch;
	unsigned char *		ShadowPtr;
	void			(*PointerMoved)(int index, int x, int y);
	int			pitch;

	unsigned char **	ScanlineColorExpandBuffers;
	void			(*InitAccel)(ScrnInfoPtr);
	int			offscreen_size;
	int			offscreen_offset;
	OptionInfoPtr		Options;
} CirRec, *CirPtr;

/* CirrusClk.c */
extern Bool
CirrusFindClock(int *rfreq, int max_clock, int *num_out, int *den_out);

/* cir_driver.c */
extern SymTabRec CIRChipsets[];
extern PciChipsets CIRPciChipsets[];

extern Bool CirMapMem(CirPtr pCir, int scrnIndex);
extern Bool CirUnmapMem(CirPtr pCir, int scrnIndex);
extern void cirProbeDDC(ScrnInfoPtr pScrn, int index);

/* cir_dga.c */
extern Bool CirDGAInit(ScreenPtr pScreen);

/* in cir_shadow.c */
void cirPointerMoved(int index, int x, int y);
void cirRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void cirRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void cirRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void cirRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void cirRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);

/* properties */
#define HWCUR64 0x1
#define ACCEL_AUTOSTART 0x2

#endif /* CIR_H */