summaryrefslogtreecommitdiff
path: root/driver/xf86-video-mga/README_HALLIB
blob: 432e42ecf4813e93c3338388d2df07a2c554de31 (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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
HAL Documentation

This documentation  provides preliminary explaination of the HAL library, a
more detailed version of this document is in the process of being written
and will be released with future driver builds.

------------------------------------------------------------
MGAOpenLibrary

Description: Link Client functions with HAL Librery

Input:
LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.

LPBARDHANDLElpClient: Pointer to the client stucture

ulClientSize: Size of the client structure

Error:
return 0 on success

-------------------------------------------------------------
MGAGetHardwareInfo

Description:

Fills MGAWINFO structure.

struct {
ULONG UlCapsFirstOutput;
ULONG ulCapsSecondOutput;
ULONG ulVideoMemory;
} FAR *LPMGAHWINFO;

#define MGAHWINFOCAPS_CRTC1_DIGITAL         (1L << 1)
#define MGAHWINFOCAPS_CRTC1_TV              (1L << 2)
#define MGAHWINFOCAPS_CRTC2_ANALOG          (1L << 3)
#define MGAHWINFOCAPS_CRTC2_DIGITAL         (1L << 4)
#define MGAHWINFOCAPS_CRTC2_TV              (1L << 5)
#define MGAHWINFOCAPS_OUTPUT_VGA            (1L << 6)
#define MGAHWINFOCAPS_CRTC2                 (MGAHWINFOCAPS_CRTC2_ANALOG | MGAHWINFOCAPS_CRTC2_DIGITAL | MGAHWINFOCAPS_CRTC2_TV)
#define MGAHWINFOCAPS_OUTPUT_ANALOG         (MGAHWINFOCAPS_CRTC1_ANALOG | MGAHWINFOCAPS_CRTC2_ANALOG)
#define MGAHWINFOCAPS_OUTPUT_DIGITAL        (MGAHWINFOCAPS_CRTC1_DIGITAL | MGAHWINFOCAPS_CRTC2_DIGITAL)
#define MGAHWINFOCAPS_OUTPUT_TV             (MGAHWINFOCAPS_CRTC1_TV | MGAHWINFOCAPS_CRTC2_TV)

example:

if (pMga->pMgaHwInfo->ulCapsSecondOutput & MGAHWINFOCAPS_OUTPUT_TV )
{
	ErrorF("TV detected\n");
	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV detected\n ");
}
if (pMga->pMgaHwInfo->ulCapsSecondOutput & MGAHWINFOCAPS_OUTPUT_DIGITAL)
{
        xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Digital Screen  detected\n ");
}

Inputs:

LPBOARDHANDLE  pBoard: Handle to the board structure containing all the information about the board.

LPMGAHWINFO pMgaHwInfo:  Handle to the board  structure containing all
the information about the specific Board.

Error:
Returns 0 on success
------------------------------------------------------------
MGAValidateMode

Description:

Validates the mode given by client.

Here are the different options for pMgaModeInfo->flOutput:

MGAMODEINFO_FORCE_PITCH
MGAMODEINFO_FORCE_DISPLAYORG
MGAMODEINFO_SECOND_CRTC
MGAMODEINFO_ANALOG1
MGAMODEINFO_ANALOG2
MGAMODEINFO_DIGITAL1
MGAMODEINFO_DIGITAL2
MGAMODEINFO_TV

These options can be combined together to set different combinations.
Example:

/*The second crtc outputs to a digital screen*/
pMgaModeInfo->flOutput= MGAMODEINFO_DIGITAL2 | MGAMODEINFO_SECOND_CRTC
| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;

- or -

/*The second crtc outputs to an analog screen*/
pMgaModeInfo-> flOutput = MGAMODEINFO_ANALOG2| MGAMODEINFO_SECOND_CRTC
| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;

- or -

/*The second crtc outputs to a tv*/
pMga->pMgaModeInfo->flOutput = MGAMODEINFO_TV | MGAMODEINFO_SECOND_CRTC | MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;

Inputs:
LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.

LPMGAMODEINFO pMgaModeInfo: Pointer to structure containing information about a specific display mode. (You need to fill the structure except the video parameters part which will be filled by the function).

Error:
Returns 0 on success

-------------------------------------------------------------
MGASetMode

Description:

Initializes the board.

Here are the different options for pMgaModeInfo->flOutput:

MGAMODEINFO_FORCE_PITCH
MGAMODEINFO_FORCE_DISPLAYORG
MGAMODEINFO_SECOND_CRTC
MGAMODEINFO_ANALOG1
MGAMODEINFO_ANALOG2
MGAMODEINFO_DIGITAL1
MGAMODEINFO_DIGITAL2
MGAMODEINFO_TV

These options can be combined together to set different combinations.
Example:

/*The second crtc outputs to a digital screen*/
pMgaModeInfo->flOutput= MGAMODEINFO_DIGITAL2 | MGAMODEINFO_SECOND_CRTC
| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;

- or -

/*The second crtc outputs to an analog screen*/
pMgaModeInfo-> flOutput = MGAMODEINFO_ANALOG2| MGAMODEINFO_SECOND_CRTC
| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;

- or -

/*The second crtc outputs to a tv*/
pMga->pMgaModeInfo->flOutput = MGAMODEINFO_TV | MGAMODEINFO_SECOND_CRTC | MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;

Inputs:
LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.

LPMGAMODEINFO pMgaModeInfo: Pointer to structure containing information about a specific display mode. (You need to fill the structure except the video parameters part which will be filled by the function).

Error:
Returns 0 on success

------------------------------------------------------------

MGASetVgaMode

Description:

Switchs the VGA mode

Inputs:
LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.

Error:
Returns 0 on success

------------------------------------------------------------

MGARestoreVgaState

Description:

Restores the VGA State

Inputs:
LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.

Error:
Returns 0 on success

------------------------------------------------------------

MGASaveVgaState

Description:

Saves the VGA state

Inputs:
LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.

Error:
Returns 0 on success

------------------------------------------------------------

MGACloseLibrary

Description:

Closes the library

Inputs:
LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.

Error:
Returns 0 on success