summaryrefslogtreecommitdiff
path: root/driver/xf86-video-i128/src/i128.h
blob: 24d53b8d6694c7b894dabcb3a3e1f1f128841308 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h,v 1.5 2001/04/01 14:00:11 tsi Exp $ */
/*
 * Number Nine I128 functions
 *
 * Copyright 1996 The XFree86 Project, Inc.
 *
 * Author
 *		Robin Cutshaw
 *			robin@XFree86.Org
 */

#ifndef I128_H
#define I128_H

#include "compiler.h"
#include "xaa.h"
#include "exa.h"
#include "xf86Cursor.h"
#include "vgaHW.h"
#include "colormapst.h"
#include "xf86DDC.h"
#include "i128reg.h"

struct source_format {
    int render_format;
    int i128_format;
    int swap_flags;
    int ignore_alpha;
};

/* Card-specific driver information */

#define I128PTR(p) ((I128Ptr)((p)->driverPrivate))

typedef struct {
    EntityInfoPtr	pEnt;
    pciVideoPtr		PciInfo;
    PCITAG		PciTag;
    xf86AccessRec	Access;
    int			Chipset;
    int                 ChipRev;
    Bool		Primary;

    /* Ramdac specific */
    int		RamdacType;
    Bool	DAC8Bit;
    Bool	DACSyncOnGreen;
    int		hotX;
    int		hotY;
    Bool	HWCursor;
    Bool	BlockCursor;
    Bool	ReloadCursor;
    Bool	CursorNeedsInit;
    int		CursorStartX;
    int		CursorStartY;
    int		CursorLines;
    int		AdjustCursorXPos;
    int		CursGeneration;

    /* layout specific */
    int bitsPerPixel;
    int depth;
    rgb weight;
    int displayWidth;
    int displayOffset;
    DisplayModePtr mode;

    /* accel specific */
    CARD32              buf_ctrl;
    CARD32		blitdir;
    CARD32              planemask;
    CARD32		cmd;
    CARD32		rop; /* XXX XAA only */
    CARD32		clptl;
    CARD32		clpbr;
    CARD32              sorg;
    CARD32              sptch;
    CARD32              dorg;
    CARD32              dptch;
    CARD32              wh;
    CARD32              torg;
    CARD32              tptch;
    CARD32              tex_ctl;
    CARD32              threedctl;
    CARD32              acntrl;
    struct source_format *source;
    /* struct dest_format *dest; */
    
    Bool		NoAccel;
    Bool                exa;
    Bool		FlatPanel;
    Bool		DoubleScan;
    Bool		ShowCache;
    Bool		ModeSwitched;
    Bool		Debug;
    unsigned char	*MemoryPtr;
    int			MemorySize;
    int			MemoryType;
    volatile struct i128mem	mem;
    struct i128io	io;
    I128RegRec		RegRec;
    Bool		StateSaved;
    Bool		Initialized;
    Bool		FontsSaved;
    Bool		LUTSaved;
    Bool		InitCursorFlag;
    LUTENTRY		lutorig[256];
    LUTENTRY		lutcur[256];
    int			HDisplay;
    int			maxClock;
    int			minClock;

    CloseScreenProcPtr  CloseScreen;
    XAAInfoRecPtr	XaaInfoRec;
    ExaDriverPtr        ExaDriver;
    xf86CursorInfoPtr	CursorInfoRec;
    I2CBusPtr		I2C;
    Bool		DGAactive;
    int			DGAViewportStatus;
    int			numDGAModes;
    DGAModePtr		DGAModes;
    Bool		(*ProgramDAC)(ScrnInfoPtr, DisplayModePtr);
    unsigned int	(*ddc1Read)(ScrnInfoPtr);
    Bool		(*i2cInit)(ScrnInfoPtr);

    OptionInfoPtr	Options;

} I128Rec, *I128Ptr;


/* Prototypes */

void I128AdjustFrame(int scrnIndex, int x, int y, int flags);
Bool I128SwitchMode(int scrnIndex, DisplayModePtr mode, int flags);

Bool I128HWCursorInit(ScreenPtr pScreen);

Bool I128XaaInit(ScreenPtr pScreen);
Bool I128ExaInit(ScreenPtr pScreen);
void I128EngineDone(ScrnInfoPtr pScrn);

Bool I128Init(ScrnInfoPtr pScrn, DisplayModePtr mode);

Bool I128DGAInit(ScreenPtr pScreen);

void I128LoadPalette(ScrnInfoPtr pScrn, int numColors,
	int *indices, LOCO *colors, VisualPtr pVisual);

void I128SaveState(ScrnInfoPtr pScrn);
void I128RestoreState(ScrnInfoPtr pScrn);
void I128InitLUT(I128Ptr pI128);

Bool I128RestoreCursor(ScrnInfoPtr pScrn);
Bool I128RepositionCursor(ScrnInfoPtr pScrn);

Bool I128IBMHWCursorInit(ScrnInfoPtr pScrn);
Bool I128TIHWCursorInit(ScrnInfoPtr pScrn);

Bool I128ProgramTi3025(ScrnInfoPtr pScrn, DisplayModePtr mode);
Bool I128ProgramIBMRGB(ScrnInfoPtr pScrn, DisplayModePtr mode);
Bool I128ProgramSilverHammer(ScrnInfoPtr pScrn, DisplayModePtr mode);

/* void I128DumpBaseRegisters(ScrnInfoPtr pScrn); */
void I128DumpActiveRegisters(ScrnInfoPtr pScrn);
/* void I128DumpIBMDACRegisters(ScrnInfoPtr pScrn, volatile CARD32 *vrbg); */
 
#endif