summaryrefslogtreecommitdiff
path: root/src/cir.h
blob: 0a5d403bdf59a863443c64fce8d0ee9d7c50b1af (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
102
103
104
/* (c) Itai Nahshon */

#ifndef CIR_H
#define CIR_H

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

#include "compat-api.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;
	unsigned long		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;
#ifdef HAVE_XAA_H
	XAAInfoRecPtr		AccelInfoRec;
#endif
	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)(SCRN_ARG_TYPE arg, 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(SCRN_ARG_TYPE arg, 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 */