]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/ndrvsupport/IOMacOSVideo.h
xnu-124.13.tar.gz
[apple/xnu.git] / iokit / IOKit / ndrvsupport / IOMacOSVideo.h
1 /*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 File: Video.h
24
25 Contains: Video Driver Interfaces.
26
27 Copyright: (c) 1986-2000 by Apple Computer, Inc., all rights reserved
28
29 Bugs?: For bug reports, consult the following page on
30 the World Wide Web:
31
32 http://developer.apple.com/bugreporter/
33
34 */
35 #ifndef __IOMACOSVIDEO__
36 #define __IOMACOSVIDEO__
37
38 #ifdef IOKIT
39
40 #define PRAGMA_STRUCT_ALIGN 1
41 #define FOUR_CHAR_CODE(x) (x)
42 #include <IOKit/ndrvsupport/IOMacOSTypes.h>
43
44 #else /* IOKIT */
45
46 #ifndef __QUICKDRAW__
47 #include <Quickdraw.h>
48 #endif
49
50 #endif /* IOKIT */
51
52 #if PRAGMA_ONCE
53 #pragma once
54 #endif
55
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59
60 #if PRAGMA_IMPORT
61 #pragma import on
62 #endif
63
64 #if PRAGMA_STRUCT_ALIGN
65 #pragma options align=mac68k
66 #elif PRAGMA_STRUCT_PACKPUSH
67 #pragma pack(push, 2)
68 #elif PRAGMA_STRUCT_PACK
69 #pragma pack(2)
70 #endif
71
72 enum {
73 mBaseOffset = 1, /*Id of mBaseOffset.*/
74 mRowBytes = 2, /*Video sResource parameter Id's */
75 mBounds = 3, /*Video sResource parameter Id's */
76 mVersion = 4, /*Video sResource parameter Id's */
77 mHRes = 5, /*Video sResource parameter Id's */
78 mVRes = 6, /*Video sResource parameter Id's */
79 mPixelType = 7, /*Video sResource parameter Id's */
80 mPixelSize = 8, /*Video sResource parameter Id's */
81 mCmpCount = 9, /*Video sResource parameter Id's */
82 mCmpSize = 10, /*Video sResource parameter Id's */
83 mPlaneBytes = 11, /*Video sResource parameter Id's */
84 mVertRefRate = 14, /*Video sResource parameter Id's */
85 mVidParams = 1, /*Video parameter block id.*/
86 mTable = 2, /*Offset to the table.*/
87 mPageCnt = 3, /*Number of pages*/
88 mDevType = 4, /*Device Type*/
89 oneBitMode = 128, /*Id of OneBitMode Parameter list.*/
90 twoBitMode = 129, /*Id of TwoBitMode Parameter list.*/
91 fourBitMode = 130, /*Id of FourBitMode Parameter list.*/
92 eightBitMode = 131 /*Id of EightBitMode Parameter list.*/
93 };
94
95 enum {
96 sixteenBitMode = 132, /*Id of SixteenBitMode Parameter list.*/
97 thirtyTwoBitMode = 133, /*Id of ThirtyTwoBitMode Parameter list.*/
98 firstVidMode = 128, /*The new, better way to do the above. */
99 secondVidMode = 129, /* QuickDraw only supports six video */
100 thirdVidMode = 130, /* at this time. */
101 fourthVidMode = 131,
102 fifthVidMode = 132,
103 sixthVidMode = 133,
104 spGammaDir = 64,
105 spVidNamesDir = 65
106 };
107
108
109 /* csTimingFormat values in VDTimingInfo */
110 /* look in the declaration rom for timing info */
111 enum {
112 kDeclROMtables = FOUR_CHAR_CODE('decl'),
113 kDetailedTimingFormat = FOUR_CHAR_CODE('arba') /* Timing is a detailed timing*/
114 };
115
116 /* Size of a block of EDID (Extended Display Identification Data) */
117 enum {
118 kDDCBlockSize = 128
119 };
120
121 /* ddcBlockType constants*/
122 enum {
123 kDDCBlockTypeEDID = 0 /* EDID block type. */
124 };
125
126 /* ddcFlags constants*/
127 enum {
128 kDDCForceReadBit = 0, /* Force a new read of the EDID. */
129 kDDCForceReadMask = (1 << kDDCForceReadBit) /* Mask for kddcForceReadBit. */
130 };
131
132
133 /* Timing mode constants for Display Manager MultiMode support
134 Corresponding .h equates are in Video.h
135 .a equates are in Video.a
136 .r equates are in DepVideoEqu.r
137
138 The second enum is the old names (for compatibility).
139 The first enum is the new names.
140 */
141 enum {
142 timingInvalid = 0, /* Unknown timing... force user to confirm. */
143 timingInvalid_SM_T24 = 8, /* Work around bug in SM Thunder24 card.*/
144 timingApple_FixedRateLCD = 42, /* Lump all fixed-rate LCDs into one category.*/
145 timingApple_512x384_60hz = 130, /* 512x384 (60 Hz) Rubik timing. */
146 timingApple_560x384_60hz = 135, /* 560x384 (60 Hz) Rubik-560 timing. */
147 timingApple_640x480_67hz = 140, /* 640x480 (67 Hz) HR timing. */
148 timingApple_640x400_67hz = 145, /* 640x400 (67 Hz) HR-400 timing. */
149 timingVESA_640x480_60hz = 150, /* 640x480 (60 Hz) VGA timing. */
150 timingVESA_640x480_72hz = 152, /* 640x480 (72 Hz) VGA timing. */
151 timingVESA_640x480_75hz = 154, /* 640x480 (75 Hz) VGA timing. */
152 timingVESA_640x480_85hz = 158, /* 640x480 (85 Hz) VGA timing. */
153 timingGTF_640x480_120hz = 159, /* 640x480 (120 Hz) VESA Generalized Timing Formula */
154 timingApple_640x870_75hz = 160, /* 640x870 (75 Hz) FPD timing.*/
155 timingApple_640x818_75hz = 165, /* 640x818 (75 Hz) FPD-818 timing.*/
156 timingApple_832x624_75hz = 170, /* 832x624 (75 Hz) GoldFish timing.*/
157 timingVESA_800x600_56hz = 180, /* 800x600 (56 Hz) SVGA timing. */
158 timingVESA_800x600_60hz = 182, /* 800x600 (60 Hz) SVGA timing. */
159 timingVESA_800x600_72hz = 184, /* 800x600 (72 Hz) SVGA timing. */
160 timingVESA_800x600_75hz = 186, /* 800x600 (75 Hz) SVGA timing. */
161 timingVESA_800x600_85hz = 188, /* 800x600 (85 Hz) SVGA timing. */
162 timingVESA_1024x768_60hz = 190, /* 1024x768 (60 Hz) VESA 1K-60Hz timing. */
163 timingVESA_1024x768_70hz = 200, /* 1024x768 (70 Hz) VESA 1K-70Hz timing. */
164 timingVESA_1024x768_75hz = 204, /* 1024x768 (75 Hz) VESA 1K-75Hz timing (very similar to timingApple_1024x768_75hz). */
165 timingVESA_1024x768_85hz = 208, /* 1024x768 (85 Hz) VESA timing. */
166 timingApple_1024x768_75hz = 210, /* 1024x768 (75 Hz) Apple 19" RGB. */
167 timingApple_1152x870_75hz = 220, /* 1152x870 (75 Hz) Apple 21" RGB. */
168 timingAppleNTSC_ST = 230, /* 512x384 (60 Hz, interlaced, non-convolved). */
169 timingAppleNTSC_FF = 232, /* 640x480 (60 Hz, interlaced, non-convolved). */
170 timingAppleNTSC_STconv = 234, /* 512x384 (60 Hz, interlaced, convolved). */
171 timingAppleNTSC_FFconv = 236, /* 640x480 (60 Hz, interlaced, convolved). */
172 timingApplePAL_ST = 238, /* 640x480 (50 Hz, interlaced, non-convolved). */
173 timingApplePAL_FF = 240, /* 768x576 (50 Hz, interlaced, non-convolved). */
174 timingApplePAL_STconv = 242, /* 640x480 (50 Hz, interlaced, convolved). */
175 timingApplePAL_FFconv = 244, /* 768x576 (50 Hz, interlaced, convolved). */
176 timingVESA_1280x960_75hz = 250, /* 1280x960 (75 Hz) */
177 timingVESA_1280x960_60hz = 252, /* 1280x960 (60 Hz) */
178 timingVESA_1280x960_85hz = 254, /* 1280x960 (85 Hz) */
179 timingVESA_1280x1024_60hz = 260, /* 1280x1024 (60 Hz) */
180 timingVESA_1280x1024_75hz = 262, /* 1280x1024 (75 Hz) */
181 timingVESA_1280x1024_85hz = 268, /* 1280x1024 (85 Hz) */
182 timingVESA_1600x1200_60hz = 280, /* 1600x1200 (60 Hz) VESA timing. */
183 timingVESA_1600x1200_65hz = 282, /* 1600x1200 (65 Hz) VESA timing. */
184 timingVESA_1600x1200_70hz = 284, /* 1600x1200 (70 Hz) VESA timing. */
185 timingVESA_1600x1200_75hz = 286, /* 1600x1200 (75 Hz) VESA timing (pixel clock is 189.2 Mhz dot clock). */
186 timingVESA_1600x1200_80hz = 288, /* 1600x1200 (80 Hz) VESA timing (pixel clock is 216>? Mhz dot clock) - proposed only. */
187 timingVESA_1600x1200_85hz = 289, /* 1600x1200 (85 Hz) VESA timing (pixel clock is 229.5 Mhz dot clock). */
188 timingVESA_1792x1344_60hz = 296, /* 1792x1344 (60 Hz) VESA timing (204.75 Mhz dot clock). */
189 timingVESA_1792x1344_75hz = 298, /* 1792x1344 (75 Hz) VESA timing (261.75 Mhz dot clock). */
190 timingVESA_1856x1392_60hz = 300, /* 1856x1392 (60 Hz) VESA timing (218.25 Mhz dot clock). */
191 timingVESA_1856x1392_75hz = 302, /* 1856x1392 (75 Hz) VESA timing (288 Mhz dot clock). */
192 timingVESA_1920x1440_60hz = 304, /* 1920x1440 (60 Hz) VESA timing (234 Mhz dot clock). */
193 timingVESA_1920x1440_75hz = 306, /* 1920x1440 (75 Hz) VESA timing (297 Mhz dot clock). */
194 timingSMPTE240M_60hz = 400, /* 60Hz V, 33.75KHz H, interlaced timing, 16:9 aspect, typical resolution of 1920x1035. */
195 timingFilmRate_48hz = 410, /* 48Hz V, 25.20KHz H, non-interlaced timing, typical resolution of 640x480. */
196 timingSony_1600x1024_76hz = 500, /* 1600x1024 (76 Hz) Sony timing (pixel clock is 170.447 Mhz dot clock). */
197 timingSony_1920x1080_60hz = 510, /* 1920x1080 (60 Hz) Sony timing (pixel clock is 159.84 Mhz dot clock). */
198 timingSony_1920x1080_72hz = 520, /* 1920x1080 (72 Hz) Sony timing (pixel clock is 216.023 Mhz dot clock). */
199 timingSony_1920x1200_76hz = 540, /* 1900x1200 (76 Hz) Sony timing (pixel clock is 243.20 Mhz dot clock). */
200 timingApple_0x0_0hz_Offline = 550 /* Indicates that this timing will take the display off-line and remove it from the system. */
201 };
202
203
204 /* Deprecated timing names.*/
205 enum {
206 timingApple12 = timingApple_512x384_60hz,
207 timingApple12x = timingApple_560x384_60hz,
208 timingApple13 = timingApple_640x480_67hz,
209 timingApple13x = timingApple_640x400_67hz,
210 timingAppleVGA = timingVESA_640x480_60hz,
211 timingApple15 = timingApple_640x870_75hz,
212 timingApple15x = timingApple_640x818_75hz,
213 timingApple16 = timingApple_832x624_75hz,
214 timingAppleSVGA = timingVESA_800x600_56hz,
215 timingApple1Ka = timingVESA_1024x768_60hz,
216 timingApple1Kb = timingVESA_1024x768_70hz,
217 timingApple19 = timingApple_1024x768_75hz,
218 timingApple21 = timingApple_1152x870_75hz,
219 timingSony_1900x1200_74hz = 530, /* 1900x1200 (74 Hz) Sony timing (pixel clock is 236.25 Mhz dot clock). */
220 timingSony_1900x1200_76hz = timingSony_1920x1200_76hz /* 1900x1200 (76 Hz) Sony timing (pixel clock is 245.48 Mhz dot clock). */
221 };
222
223 /* csConnectFlags values in VDDisplayConnectInfo */
224 enum {
225 kAllModesValid = 0, /* All modes not trimmed by primary init are good close enough to try */
226 kAllModesSafe = 1, /* All modes not trimmed by primary init are know to be safe */
227 kReportsTagging = 2, /* Can detect tagged displays (to identify smart monitors) */
228 kHasDirectConnection = 3, /* True implies that driver can talk directly to device (e.g. serial data link via sense lines) */
229 kIsMonoDev = 4, /* Says whether there's an RGB (0) or Monochrome (1) connection. */
230 kUncertainConnection = 5, /* There may not be a display (no sense lines?). */
231 kTaggingInfoNonStandard = 6, /* Set when csConnectTaggedType/csConnectTaggedData are non-standard (i.e., not the Apple CRT sense codes). */
232 kReportsDDCConnection = 7, /* Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display). */
233 kHasDDCConnection = 8, /* Card has ddc connect now. */
234 kConnectionInactive = 9, /* Set when the connection is NOT currently active (generally used in a multiconnection environment). */
235 kDependentConnection = 10, /* Set when some ascpect of THIS connection depends on another (will generally be set in a kModeSimulscan environment). */
236 kBuiltInConnection = 11, /* Set when connection is KNOWN to be built-in (this is not the same as kHasDirectConnection). */
237 kOverrideConnection = 12, /* Set when the reported connection is not the true one, but is one that has been forced through a SetConnection call */
238 kFastCheckForDDC = 13, /* Set when all 3 are true: 1) sense codes indicate DDC display could be attached 2) attempted fast check 3) DDC failed */
239 kReportsHotPlugging = 14 /* Detects and reports hot pluggging on connector (via VSL also implies DDC will be up to date w/o force read) */
240 };
241
242
243 /* csDisplayType values in VDDisplayConnectInfo */
244 enum {
245 kUnknownConnect = 1, /* Not sure how we'll use this, but seems like a good idea. */
246 kPanelConnect = 2, /* For use with fixed-in-place LCD panels. */
247 kPanelTFTConnect = 2, /* Alias for kPanelConnect */
248 kFixedModeCRTConnect = 3, /* For use with fixed-mode (i.e., very limited range) displays. */
249 kMultiModeCRT1Connect = 4, /* 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe */
250 kMultiModeCRT2Connect = 5, /* 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe */
251 kMultiModeCRT3Connect = 6, /* 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain */
252 kMultiModeCRT4Connect = 7, /* Expansion to large multi mode (not yet used) */
253 kModelessConnect = 8, /* Expansion to modeless model (not yet used) */
254 kFullPageConnect = 9, /* 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) */
255 kVGAConnect = 10, /* 640x480 VGA default -- question everything else */
256 kNTSCConnect = 11, /* NTSC ST (default), FF, STconv, FFconv */
257 kPALConnect = 12, /* PAL ST (default), FF, STconv, FFconv */
258 kHRConnect = 13, /* Straight-6 connect -- 640x480 and 640x400 (to get 8bpp in 256K case) (these two only) */
259 kPanelFSTNConnect = 14, /* For use with fixed-in-place LCD FSTN (aka "Supertwist") panels */
260 kMonoTwoPageConnect = 15, /* 1152x870 Apple color two-page display */
261 kColorTwoPageConnect = 16, /* 1152x870 Apple B&W two-page display */
262 kColor16Connect = 17, /* 832x624 Apple B&W two-page display */
263 kColor19Connect = 18, /* 1024x768 Apple B&W two-page display */
264 kGenericCRT = 19, /* Indicates nothing except that connection is CRT in nature. */
265 kGenericLCD = 20, /* Indicates nothing except that connection is LCD in nature. */
266 kDDCConnect = 21, /* DDC connection, always set kHasDDCConnection */
267 kNoConnect = 22 /* No display is connected - load sensing or similar level of hardware detection is assumed (used by resident drivers that support hot plugging when nothing is currently connected) */
268 };
269
270 /* csTimingFlags values in VDTimingInfoRec */
271 enum {
272 kModeValid = 0, /* Says that this mode should NOT be trimmed. */
273 kModeSafe = 1, /* This mode does not need confirmation */
274 kModeDefault = 2, /* This is the default mode for this type of connection */
275 kModeShowNow = 3, /* This mode should always be shown (even though it may require a confirm) */
276 kModeNotResize = 4, /* This mode should not be used to resize the display (eg. mode selects a different connector on card) */
277 kModeRequiresPan = 5, /* This mode has more pixels than are actually displayed */
278 kModeInterlaced = 6, /* This mode is interlaced (single pixel lines look bad). */
279 kModeShowNever = 7, /* This mode should not be shown in the user interface. */
280 kModeSimulscan = 8, /* Indicates that more than one display connection can be driven from a single framebuffer controller. */
281 kModeNotPreset = 9, /* Indicates that the timing is not a factory preset for the current display (geometry may need correction) */
282 kModeBuiltIn = 10, /* Indicates that the display mode is for the built-in connect only (on multiconnect devices like the PB 3400) Only the driver is quieried */
283 kModeStretched = 11 /* Indicates that the display mode will be stretched/distorted to match the display aspect ratio */
284 };
285
286 /* csDepthFlags in VDVideoParametersInfoRec */
287 enum {
288 kDepthDependent = 0 /* Says that this depth mode may cause dependent changes in other framebuffers (and . */
289 };
290
291 /* csResolutionFlags bit flags for VDResolutionInfoRec */
292 enum {
293 kResolutionHasMultipleDepthSizes = 0 /* Says that this mode has different csHorizontalPixels, csVerticalLines at different depths (usually slightly larger at lower depths) */
294 };
295
296
297 enum {
298 /* Power Mode constants for VDPowerStateRec.powerState. Note the numeric order does not match the power state order */
299 kAVPowerOff = 0, /* Power fully off*/
300 kAVPowerStandby = 1,
301 kAVPowerSuspend = 2,
302 kAVPowerOn = 3,
303 kHardwareSleep = 128,
304 kHardwareWake = 129,
305 kHardwareWakeFromSuspend = 130,
306 kHardwareWakeToDoze = 131,
307 kHardwareWakeToDozeFromSuspend = 132
308 };
309
310 enum {
311 /* Power Mode masks and bits for VDPowerStateRec.powerFlags. */
312 kPowerStateNeedsRefresh = 0, /* When leaving this power mode, a display will need refreshing */
313 kPowerStateSleepAwareBit = 1, /* if gestaltPCCardDockingSelectorFix, Docking mgr checks this bit before checking kPowerStateSleepAllowedBit */
314 kPowerStateSleepForbiddenBit = 2, /* if kPowerStateSleepAwareBit, Docking mgr checks this bit before sleeping */
315 kPowerStateSleepCanPowerOffBit = 3, /* supports power down sleep (ie PCI power off)*/
316 kPowerStateSleepNoDPMSBit = 4, /* Bug #2425210. Do not use DPMS with this display.*/
317 kPowerStateSleepWaketoDozeBit = 5, /* Supports Wake to Doze */
318 kPowerStateNeedsRefreshMask = (1L << kPowerStateNeedsRefresh),
319 kPowerStateSleepAwareMask = (1L << kPowerStateSleepAwareBit),
320 kPowerStateSleepForbiddenMask = (1L << kPowerStateSleepForbiddenBit),
321 kPowerStateSleepCanPowerOffMask = (1L << kPowerStateSleepCanPowerOffBit),
322 kPowerStateSleepNoDPMSMask = (1L << kPowerStateSleepNoDPMSBit),
323 kPowerStateSleepWaketoDozeMask = (1L << kPowerStateSleepWaketoDozeBit)
324 };
325
326
327 enum {
328 /* Control Codes */
329 cscReset = 0,
330 cscKillIO = 1,
331 cscSetMode = 2,
332 cscSetEntries = 3,
333 cscSetGamma = 4,
334 cscGrayPage = 5,
335 cscGrayScreen = 5,
336 cscSetGray = 6,
337 cscSetInterrupt = 7,
338 cscDirectSetEntries = 8,
339 cscSetDefaultMode = 9,
340 cscSwitchMode = 10,
341 cscSetSync = 11,
342 cscSavePreferredConfiguration = 16,
343 cscSetHardwareCursor = 22,
344 cscDrawHardwareCursor = 23,
345 cscSetConvolution = 24,
346 cscSetPowerState = 25,
347 cscPrivateControlCall = 26, /* Takes a VDPrivateSelectorDataRec*/
348 cscSetMultiConnect = 28, /* From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core.*/
349 cscSetClutBehavior = 29, /* Takes a VDClutBehavior */
350 cscSetDetailedTiming = 31, /* Takes a VDDetailedTimingPtr */
351 cscDoCommunication = 33, /* Takes a VDCommunicationPtr */
352 cscUnusedCall = 127 /* This call used to expend the scrn resource. Its imbedded data contains more control info */
353 };
354
355 enum {
356 /* Status Codes */
357 cscGetMode = 2,
358 cscGetEntries = 3,
359 cscGetPageCnt = 4,
360 cscGetPages = 4, /* This is what C&D 2 calls it. */
361 cscGetPageBase = 5,
362 cscGetBaseAddr = 5, /* This is what C&D 2 calls it. */
363 cscGetGray = 6,
364 cscGetInterrupt = 7,
365 cscGetGamma = 8,
366 cscGetDefaultMode = 9,
367 cscGetCurMode = 10,
368 cscGetSync = 11,
369 cscGetConnection = 12, /* Return information about the connection to the display */
370 cscGetModeTiming = 13, /* Return timing info for a mode */
371 cscGetModeBaseAddress = 14, /* Return base address information about a particular mode */
372 cscGetScanProc = 15, /* QuickTime scan chasing routine */
373 cscGetPreferredConfiguration = 16,
374 cscGetNextResolution = 17,
375 cscGetVideoParameters = 18,
376 cscGetGammaInfoList = 20,
377 cscRetrieveGammaTable = 21,
378 cscSupportsHardwareCursor = 22,
379 cscGetHardwareCursorDrawState = 23,
380 cscGetConvolution = 24,
381 cscGetPowerState = 25,
382 cscPrivateStatusCall = 26, /* Takes a VDPrivateSelectorDataRec*/
383 cscGetDDCBlock = 27, /* Takes a VDDDCBlockRec */
384 cscGetMultiConnect = 28, /* From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core.*/
385 cscGetClutBehavior = 29, /* Takes a VDClutBehavior */
386 cscGetTimingRanges = 30, /* Takes a VDDisplayTimingRangePtr */
387 cscGetDetailedTiming = 31, /* Takes a VDDetailedTimingPtr */
388 cscGetCommunicationInfo = 32 /* Takes a VDCommunicationInfoPtr */
389 };
390
391 /* Bit definitions for the Get/Set Sync call*/
392 enum {
393 kDisableHorizontalSyncBit = 0,
394 kDisableVerticalSyncBit = 1,
395 kDisableCompositeSyncBit = 2,
396 kEnableSyncOnBlue = 3,
397 kEnableSyncOnGreen = 4,
398 kEnableSyncOnRed = 5,
399 kNoSeparateSyncControlBit = 6,
400 kTriStateSyncBit = 7,
401 kHorizontalSyncMask = 0x01,
402 kVerticalSyncMask = 0x02,
403 kCompositeSyncMask = 0x04,
404 kDPMSSyncMask = 0x07,
405 kTriStateSyncMask = 0x80,
406 kSyncOnBlueMask = 0x08,
407 kSyncOnGreenMask = 0x10,
408 kSyncOnRedMask = 0x20,
409 kSyncOnMask = 0x38
410 };
411
412 enum {
413 /* Power Mode constants for translating DPMS modes to Get/SetSync calls. */
414 kDPMSSyncOn = 0,
415 kDPMSSyncStandby = 1,
416 kDPMSSyncSuspend = 2,
417 kDPMSSyncOff = 7
418 };
419
420 /* Bit definitions for the Get/Set Convolution call*/
421 enum {
422 kConvolved = 0,
423 kLiveVideoPassThru = 1,
424 kConvolvedMask = 0x01,
425 kLiveVideoPassThruMask = 0x02
426 };
427
428
429
430 struct VPBlock {
431 long vpBaseOffset; /*Offset to page zero of video RAM (From minorBaseOS).*/
432 short vpRowBytes; /*Width of each row of video memory.*/
433 Rect vpBounds; /*BoundsRect for the video display (gives dimensions).*/
434 short vpVersion; /*PixelMap version number.*/
435 short vpPackType;
436 long vpPackSize;
437 long vpHRes; /*Horizontal resolution of the device (pixels per inch).*/
438 long vpVRes; /*Vertical resolution of the device (pixels per inch).*/
439 short vpPixelType; /*Defines the pixel type.*/
440 short vpPixelSize; /*Number of bits in pixel.*/
441 short vpCmpCount; /*Number of components in pixel.*/
442 short vpCmpSize; /*Number of bits per component*/
443 long vpPlaneBytes; /*Offset from one plane to the next.*/
444 };
445 typedef struct VPBlock VPBlock;
446 typedef VPBlock * VPBlockPtr;
447
448 struct VDEntryRecord {
449 Ptr csTable; /*(long) pointer to color table entry=value, r,g,b:INTEGER*/
450 };
451 typedef struct VDEntryRecord VDEntryRecord;
452
453 typedef VDEntryRecord * VDEntRecPtr;
454 /* Parm block for SetGray control call */
455
456 struct VDGrayRecord {
457 Boolean csMode; /*Same as GDDevType value (0=color, 1=mono)*/
458 SInt8 filler;
459 };
460 typedef struct VDGrayRecord VDGrayRecord;
461
462 typedef VDGrayRecord * VDGrayPtr;
463 /* Parm block for SetInterrupt call */
464
465 struct VDFlagRecord {
466 SInt8 csMode;
467 SInt8 filler;
468 };
469 typedef struct VDFlagRecord VDFlagRecord;
470
471 typedef VDFlagRecord * VDFlagRecPtr;
472 /* Parm block for SetEntries control call */
473
474 struct VDSetEntryRecord {
475 ColorSpec * csTable; /*Pointer to an array of color specs*/
476 short csStart; /*Which spec in array to start with, or -1*/
477 short csCount; /*Number of color spec entries to set*/
478 };
479 typedef struct VDSetEntryRecord VDSetEntryRecord;
480
481 typedef VDSetEntryRecord * VDSetEntryPtr;
482 /* Parm block for SetGamma control call */
483
484 struct VDGammaRecord {
485 Ptr csGTable; /*pointer to gamma table*/
486 };
487 typedef struct VDGammaRecord VDGammaRecord;
488
489 typedef VDGammaRecord * VDGamRecPtr;
490
491 struct VDBaseAddressInfoRec {
492 long csDevData; /* LONGINT - (long) timing mode */
493 long csDevBase; /* LONGINT - (long) base address of the mode */
494 short csModeReserved; /* INTEGER - (short) will some day be the depth */
495 long csModeBase; /* LONGINT - (long) reserved */
496 };
497 typedef struct VDBaseAddressInfoRec VDBaseAddressInfoRec;
498
499 typedef VDBaseAddressInfoRec * VDBaseAddressInfoPtr;
500
501 struct VDSwitchInfoRec {
502 unsigned short csMode; /*(word) mode depth*/
503 unsigned long csData; /*(long) functional sResource of mode*/
504 unsigned short csPage; /*(word) page to switch in*/
505 Ptr csBaseAddr; /*(long) base address of page (return value)*/
506 unsigned long csReserved; /*(long) Reserved (set to 0) */
507 };
508 typedef struct VDSwitchInfoRec VDSwitchInfoRec;
509
510 typedef VDSwitchInfoRec * VDSwitchInfoPtr;
511
512 struct VDTimingInfoRec {
513 unsigned long csTimingMode; /* LONGINT - (long) timing mode (a la InitGDevice) */
514 unsigned long csTimingReserved; /* LONGINT - (long) reserved */
515 unsigned long csTimingFormat; /* LONGINT - (long) what format is the timing info */
516 unsigned long csTimingData; /* LONGINT - (long) data supplied by driver */
517 unsigned long csTimingFlags; /* LONGINT - (long) mode within device */
518 };
519 typedef struct VDTimingInfoRec VDTimingInfoRec;
520
521 typedef VDTimingInfoRec * VDTimingInfoPtr;
522
523 struct VDDisplayConnectInfoRec {
524 unsigned short csDisplayType; /* INTEGER - (word) Type of display connected */
525 unsigned char csConnectTaggedType; /* BYTE - type of tagging */
526 unsigned char csConnectTaggedData; /* BYTE - tagging data */
527 unsigned long csConnectFlags; /* LONGINT - (long) tell us about the connection */
528 unsigned long csDisplayComponent; /* LONGINT - (long) if the card has a direct connection to the display, it returns the display component here (FUTURE) */
529 unsigned long csConnectReserved; /* LONGINT - (long) reserved */
530 };
531 typedef struct VDDisplayConnectInfoRec VDDisplayConnectInfoRec;
532
533 typedef VDDisplayConnectInfoRec * VDDisplayConnectInfoPtr;
534
535 struct VDMultiConnectInfoRec {
536 unsigned long csDisplayCountOrNumber; /* For GetMultiConnect, returns count n of 1..n connections; otherwise, indicates the ith connection.*/
537 VDDisplayConnectInfoRec csConnectInfo; /* Standard VDDisplayConnectionInfo for connection i.*/
538 };
539 typedef struct VDMultiConnectInfoRec VDMultiConnectInfoRec;
540
541 typedef VDMultiConnectInfoRec * VDMultiConnectInfoPtr;
542 /* RawSenseCode
543 This abstract data type is not exactly abstract. Rather, it is merely enumerated constants
544 for the possible raw sense code values when 'standard' sense code hardware is implemented.
545
546 For 'standard' sense code hardware, the raw sense is obtained as follows:
547 o Instruct the frame buffer controller NOT to actively drive any of the monitor sense lines
548 o Read the state of the monitor sense lines 2, 1, and 0. (2 is the MSB, 0 the LSB)
549
550 IMPORTANT Note:
551 When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants
552 are valid 'csConnectTaggedType' values in 'VDDisplayConnectInfo'
553
554 */
555 typedef unsigned char RawSenseCode;
556 enum {
557 kRSCZero = 0,
558 kRSCOne = 1,
559 kRSCTwo = 2,
560 kRSCThree = 3,
561 kRSCFour = 4,
562 kRSCFive = 5,
563 kRSCSix = 6,
564 kRSCSeven = 7
565 };
566
567
568 /* ExtendedSenseCode
569 This abstract data type is not exactly abstract. Rather, it is merely enumerated constants
570 for the values which are possible when the extended sense algorithm is applied to hardware
571 which implements 'standard' sense code hardware.
572
573 For 'standard' sense code hardware, the extended sense code algorithm is as follows:
574 (Note: as described here, sense line 'A' corresponds to '2', 'B' to '1', and 'C' to '0')
575 o Drive sense line 'A' low and read the values of 'B' and 'C'.
576 o Drive sense line 'B' low and read the values of 'A' and 'C'.
577 o Drive sense line 'C' low and read the values of 'A' and 'B'.
578
579 In this way, a six-bit number of the form BC/AC/AB is generated.
580
581 IMPORTANT Note:
582 When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants
583 are valid 'csConnectTaggedData' values in 'VDDisplayConnectInfo'
584
585 */
586 typedef unsigned char ExtendedSenseCode;
587 enum {
588 kESCZero21Inch = 0x00, /* 21" RGB */
589 kESCOnePortraitMono = 0x14, /* Portrait Monochrome */
590 kESCTwo12Inch = 0x21, /* 12" RGB */
591 kESCThree21InchRadius = 0x31, /* 21" RGB (Radius) */
592 kESCThree21InchMonoRadius = 0x34, /* 21" Monochrome (Radius) */
593 kESCThree21InchMono = 0x35, /* 21" Monochrome */
594 kESCFourNTSC = 0x0A, /* NTSC */
595 kESCFivePortrait = 0x1E, /* Portrait RGB */
596 kESCSixMSB1 = 0x03, /* MultiScan Band-1 (12" thru 1Six") */
597 kESCSixMSB2 = 0x0B, /* MultiScan Band-2 (13" thru 19") */
598 kESCSixMSB3 = 0x23, /* MultiScan Band-3 (13" thru 21") */
599 kESCSixStandard = 0x2B, /* 13"/14" RGB or 12" Monochrome */
600 kESCSevenPAL = 0x00, /* PAL */
601 kESCSevenNTSC = 0x14, /* NTSC */
602 kESCSevenVGA = 0x17, /* VGA */
603 kESCSeven16Inch = 0x2D, /* 16" RGB (GoldFish) */
604 kESCSevenPALAlternate = 0x30, /* PAL (Alternate) */
605 kESCSeven19Inch = 0x3A, /* Third-Party 19" */
606 kESCSevenDDC = 0x3E, /* DDC display */
607 kESCSevenNoDisplay = 0x3F /* No display connected */
608 };
609
610 /* DepthMode
611 This abstract data type is used to to reference RELATIVE pixel depths.
612 Its definition is largely derived from its past usage, analogous to 'xxxVidMode'
613
614 Bits per pixel DOES NOT directly map to 'DepthMode' For example, on some
615 graphics hardware, 'kDepthMode1' may represent 1 BPP, whereas on other
616 hardware, 'kDepthMode1' may represent 8BPP.
617
618 DepthMode IS considered to be ordinal, i.e., operations such as <, >, ==, etc.
619 behave as expected. The values of the constants which comprise the set are such
620 that 'kDepthMode4 < kDepthMode6' behaves as expected.
621 */
622 typedef unsigned short DepthMode;
623 enum {
624 kDepthMode1 = 128,
625 kDepthMode2 = 129,
626 kDepthMode3 = 130,
627 kDepthMode4 = 131,
628 kDepthMode5 = 132,
629 kDepthMode6 = 133
630 };
631
632 enum {
633 kFirstDepthMode = 128, /* These constants are obsolete, and just included */
634 kSecondDepthMode = 129, /* for clients that have converted to the above */
635 kThirdDepthMode = 130, /* kDepthModeXXX constants. */
636 kFourthDepthMode = 131,
637 kFifthDepthMode = 132,
638 kSixthDepthMode = 133
639 };
640
641
642
643 struct VDPageInfo {
644 short csMode; /*(word) mode within device*/
645 long csData; /*(long) data supplied by driver*/
646 short csPage; /*(word) page to switch in*/
647 Ptr csBaseAddr; /*(long) base address of page*/
648 };
649 typedef struct VDPageInfo VDPageInfo;
650
651 typedef VDPageInfo * VDPgInfoPtr;
652
653 struct VDSizeInfo {
654 short csHSize; /*(word) desired/returned h size*/
655 short csHPos; /*(word) desired/returned h position*/
656 short csVSize; /*(word) desired/returned v size*/
657 short csVPos; /*(word) desired/returned v position*/
658 };
659 typedef struct VDSizeInfo VDSizeInfo;
660
661 typedef VDSizeInfo * VDSzInfoPtr;
662
663 struct VDSettings {
664 short csParamCnt; /*(word) number of params*/
665 short csBrightMax; /*(word) max brightness*/
666 short csBrightDef; /*(word) default brightness*/
667 short csBrightVal; /*(word) current brightness*/
668 short csCntrstMax; /*(word) max contrast*/
669 short csCntrstDef; /*(word) default contrast*/
670 short csCntrstVal; /*(word) current contrast*/
671 short csTintMax; /*(word) max tint*/
672 short csTintDef; /*(word) default tint*/
673 short csTintVal; /*(word) current tint*/
674 short csHueMax; /*(word) max hue*/
675 short csHueDef; /*(word) default hue*/
676 short csHueVal; /*(word) current hue*/
677 short csHorizDef; /*(word) default horizontal*/
678 short csHorizVal; /*(word) current horizontal*/
679 short csHorizMax; /*(word) max horizontal*/
680 short csVertDef; /*(word) default vertical*/
681 short csVertVal; /*(word) current vertical*/
682 short csVertMax; /*(word) max vertical*/
683 };
684 typedef struct VDSettings VDSettings;
685 typedef VDSettings * VDSettingsPtr;
686
687 struct VDDefMode {
688 UInt8 csID;
689 SInt8 filler;
690 };
691 typedef struct VDDefMode VDDefMode;
692 typedef VDDefMode * VDDefModePtr;
693
694 struct VDSyncInfoRec {
695 UInt8 csMode;
696 UInt8 csFlags;
697 };
698 typedef struct VDSyncInfoRec VDSyncInfoRec;
699
700 typedef VDSyncInfoRec * VDSyncInfoPtr;
701 typedef UInt32 AVIDType;
702 typedef AVIDType DisplayIDType;
703 typedef UInt32 DisplayModeID;
704 typedef UInt32 VideoDeviceType;
705 typedef UInt32 GammaTableID;
706 /*
707 All displayModeID values from 0x80000000 to 0xFFFFFFFF and 0x00
708 are reserved for Apple Computer.
709 */
710 /* Constants for the cscGetNextResolution call */
711 enum {
712 kDisplayModeIDCurrent = 0x00, /* Reference the Current DisplayModeID */
713 kDisplayModeIDInvalid = (long)0xFFFFFFFF, /* A bogus DisplayModeID in all cases */
714 kDisplayModeIDFindFirstResolution = (long)0xFFFFFFFE, /* Used in cscGetNextResolution to reset iterator */
715 kDisplayModeIDNoMoreResolutions = (long)0xFFFFFFFD, /* Used in cscGetNextResolution to indicate End Of List */
716 kDisplayModeIDFindFirstProgrammable = (long)0xFFFFFFFC, /* Used in cscGetNextResolution to find unused programmable timing */
717 kDisplayModeIDBootProgrammable = (long)0xFFFFFFFB, /* This is the ID given at boot time by the OF driver to a programmable timing */
718 kDisplayModeIDReservedBase = (long)0x80000000 /* Lowest (unsigned) DisplayModeID reserved by Apple */
719 };
720
721 /* Constants for the GetGammaInfoList call */
722 enum {
723 kGammaTableIDFindFirst = (long)0xFFFFFFFE, /* Get the first gamma table ID */
724 kGammaTableIDNoMoreTables = (long)0xFFFFFFFD, /* Used to indicate end of list */
725 kGammaTableIDSpecific = 0x00 /* Return the info for the given table id */
726 };
727
728 /* Constants for GetMultiConnect call*/
729 enum {
730 kGetConnectionCount = (long)0xFFFFFFFF, /* Used to get the number of possible connections in a "multi-headed" framebuffer environment.*/
731 kActivateConnection = (0 << kConnectionInactive), /* Used for activating a connection (csConnectFlags value).*/
732 kDeactivateConnection = (1 << kConnectionInactive) /* Used for deactivating a connection (csConnectFlags value.)*/
733 };
734
735 /* VDCommunicationRec.csBusID values*/
736 enum {
737 kVideoDefaultBus = 0
738 };
739
740
741 /* VDCommunicationInfoRec.csBusType values*/
742 enum {
743 kVideoBusTypeInvalid = 0,
744 kVideoBusTypeI2C = 1
745 };
746
747
748 /* VDCommunicationRec.csSendType and VDCommunicationRec.csReplyType values*/
749 enum {
750 kVideoNoTransactionType = 0, /* No transaction*/
751 kVideoSimpleI2CType = 1, /* Simple I2C message*/
752 kVideoDDCciReplyType = 2 /* DDC/ci message (with imbedded length)*/
753 };
754
755 // VDCommunicationRec.csCommFlags and VDCommunicationInfoRec.csSupportedCommFlags
756 enum {
757 kVideoReplyMicroSecDelayMask = (1<<0) /* If set, the driver should delay csMinReplyDelay micro seconds between send and receive*/
758 };
759
760
761 struct VDResolutionInfoRec {
762 DisplayModeID csPreviousDisplayModeID; /* ID of the previous resolution in a chain */
763 DisplayModeID csDisplayModeID; /* ID of the next resolution */
764 unsigned long csHorizontalPixels; /* # of pixels in a horizontal line at the max depth */
765 unsigned long csVerticalLines; /* # of lines in a screen at the max depth */
766 Fixed csRefreshRate; /* Vertical Refresh Rate in Hz */
767 DepthMode csMaxDepthMode; /* 0x80-based number representing max bit depth */
768 unsigned long csResolutionFlags; /* Reserved - flag bits */
769 unsigned long csReserved; /* Reserved */
770 };
771 typedef struct VDResolutionInfoRec VDResolutionInfoRec;
772
773 typedef VDResolutionInfoRec * VDResolutionInfoPtr;
774
775 struct VDVideoParametersInfoRec {
776 DisplayModeID csDisplayModeID; /* the ID of the resolution we want info on */
777 DepthMode csDepthMode; /* The bit depth we want the info on (0x80 based) */
778 VPBlockPtr csVPBlockPtr; /* Pointer to a video parameter block */
779 unsigned long csPageCount; /* Number of pages supported by the resolution */
780 VideoDeviceType csDeviceType; /* Device Type: Direct, Fixed or CLUT; */
781 UInt32 csDepthFlags; /* Flags */
782 };
783 typedef struct VDVideoParametersInfoRec VDVideoParametersInfoRec;
784
785 typedef VDVideoParametersInfoRec * VDVideoParametersInfoPtr;
786
787 struct VDGammaInfoRec {
788 GammaTableID csLastGammaID; /* the ID of the previous gamma table */
789 GammaTableID csNextGammaID; /* the ID of the next gamma table */
790 Ptr csGammaPtr; /* Ptr to a gamma table data */
791 unsigned long csReserved; /* Reserved */
792 };
793 typedef struct VDGammaInfoRec VDGammaInfoRec;
794
795 typedef VDGammaInfoRec * VDGammaInfoPtr;
796
797 struct VDGetGammaListRec {
798 GammaTableID csPreviousGammaTableID; /* ID of the previous gamma table */
799 GammaTableID csGammaTableID; /* ID of the gamma table following csPreviousDisplayModeID */
800 unsigned long csGammaTableSize; /* Size of the gamma table in bytes */
801 char * csGammaTableName; /* Gamma table name (c-string) */
802 };
803 typedef struct VDGetGammaListRec VDGetGammaListRec;
804
805 typedef VDGetGammaListRec * VDGetGammaListPtr;
806
807 struct VDRetrieveGammaRec {
808 GammaTableID csGammaTableID; /* ID of gamma table to retrieve */
809 GammaTbl * csGammaTablePtr; /* Location to copy desired gamma to */
810 };
811 typedef struct VDRetrieveGammaRec VDRetrieveGammaRec;
812
813 typedef VDRetrieveGammaRec * VDRetrieveGammaPtr;
814
815 struct VDSetHardwareCursorRec {
816 void * csCursorRef; /* reference to cursor data */
817 UInt32 csReserved1; /* reserved for future use */
818 UInt32 csReserved2; /* should be ignored */
819 };
820 typedef struct VDSetHardwareCursorRec VDSetHardwareCursorRec;
821
822 typedef VDSetHardwareCursorRec * VDSetHardwareCursorPtr;
823
824 struct VDDrawHardwareCursorRec {
825 SInt32 csCursorX; /* x coordinate */
826 SInt32 csCursorY; /* y coordinate */
827 UInt32 csCursorVisible; /* true if cursor is must be visible */
828 UInt32 csReserved1; /* reserved for future use */
829 UInt32 csReserved2; /* should be ignored */
830 };
831 typedef struct VDDrawHardwareCursorRec VDDrawHardwareCursorRec;
832
833 typedef VDDrawHardwareCursorRec * VDDrawHardwareCursorPtr;
834
835 struct VDSupportsHardwareCursorRec {
836 UInt32 csSupportsHardwareCursor;
837 /* true if hardware cursor is supported */
838 UInt32 csReserved1; /* reserved for future use */
839 UInt32 csReserved2; /* must be zero */
840 };
841 typedef struct VDSupportsHardwareCursorRec VDSupportsHardwareCursorRec;
842
843 typedef VDSupportsHardwareCursorRec * VDSupportsHardwareCursorPtr;
844
845 struct VDHardwareCursorDrawStateRec {
846 SInt32 csCursorX; /* x coordinate */
847 SInt32 csCursorY; /* y coordinate */
848 UInt32 csCursorVisible; /* true if cursor is visible */
849 UInt32 csCursorSet; /* true if cursor successfully set by last set control call */
850 UInt32 csReserved1; /* reserved for future use */
851 UInt32 csReserved2; /* must be zero */
852 };
853 typedef struct VDHardwareCursorDrawStateRec VDHardwareCursorDrawStateRec;
854
855 typedef VDHardwareCursorDrawStateRec * VDHardwareCursorDrawStatePtr;
856
857 struct VDConvolutionInfoRec {
858 DisplayModeID csDisplayModeID; /* the ID of the resolution we want info on */
859 DepthMode csDepthMode; /* The bit depth we want the info on (0x80 based) */
860 unsigned long csPage;
861 UInt32 csFlags;
862 UInt32 csReserved;
863 };
864 typedef struct VDConvolutionInfoRec VDConvolutionInfoRec;
865
866 typedef VDConvolutionInfoRec * VDConvolutionInfoPtr;
867
868 struct VDPowerStateRec {
869 unsigned long powerState;
870 unsigned long powerFlags;
871
872 unsigned long powerReserved1;
873 unsigned long powerReserved2;
874 };
875 typedef struct VDPowerStateRec VDPowerStateRec;
876
877 typedef VDPowerStateRec * VDPowerStatePtr;
878 /*
879 Private Data to video drivers.
880
881 In versions of MacOS with multiple address spaces (System 8), the OS
882 must know the extent of parameters in order to move them between the caller
883 and driver. The old private-selector model for video drivers does not have
884 this information so:
885
886 For post-7.x Systems private calls should be implemented using the cscPrivateCall
887 */
888
889 struct VDPrivateSelectorDataRec {
890 LogicalAddress privateParameters; /* Caller's parameters*/
891 ByteCount privateParametersSize; /* Size of data sent from caller to driver*/
892 LogicalAddress privateResults; /* Caller's return area. Can be nil, or same as privateParameters.*/
893 ByteCount privateResultsSize; /* Size of data driver returns to caller. Can be nil, or same as privateParametersSize.*/
894 };
895 typedef struct VDPrivateSelectorDataRec VDPrivateSelectorDataRec;
896
897
898 struct VDPrivateSelectorRec {
899 UInt32 reserved; /* Reserved (set to 0). */
900 VDPrivateSelectorDataRec data[1];
901 };
902 typedef struct VDPrivateSelectorRec VDPrivateSelectorRec;
903
904 struct VDDDCBlockRec {
905 UInt32 ddcBlockNumber; /* Input -- DDC EDID (Extended Display Identification Data) number (1-based) */
906 ResType ddcBlockType; /* Input -- DDC block type (EDID/VDIF) */
907 UInt32 ddcFlags; /* Input -- DDC Flags*/
908 UInt32 ddcReserved; /* Reserved */
909 Byte ddcBlockData[128]; /* Output -- DDC EDID/VDIF data (kDDCBlockSize) */
910 };
911 typedef struct VDDDCBlockRec VDDDCBlockRec;
912
913 typedef VDDDCBlockRec * VDDDCBlockPtr;
914
915 enum {
916 /* timingSyncConfiguration*/
917 kSyncInterlaceMask = (1 << 7),
918 kSyncAnalogCompositeMask = 0,
919 kSyncAnalogCompositeSerrateMask = (1 << 2),
920 kSyncAnalogCompositeRGBSyncMask = (1 << 1),
921 kSyncAnalogBipolarMask = (1 << 3),
922 kSyncAnalogBipolarSerrateMask = (1 << 2),
923 kSyncAnalogBipolarSRGBSyncMask = (1 << 1),
924 kSyncDigitalCompositeMask = (1 << 4),
925 kSyncDigitalCompositeSerrateMask = (1 << 2),
926 kSyncDigitalCompositeMatchHSyncMask = (1 << 2),
927 kSyncDigitalSeperateMask = (1 << 4) + (1 << 3),
928 kSyncDigitalVSyncPositiveMask = (1 << 2),
929 kSyncDigitalHSyncPositiveMask = (1 << 1)
930 };
931
932
933
934
935 struct VDDisplayTimingRangeRec {
936 UInt32 csRangeSize; /* Init to sizeof(VDDisplayTimingRangeRec) */
937 UInt32 csRangeType; /* Init to 0 */
938 UInt32 csRangeVersion; /* Init to 0 */
939 UInt32 csRangeReserved; /* Init to 0 */
940
941 UInt32 csRangeBlockIndex; /* Requested block (first index is 0)*/
942 UInt32 csRangeGroup; /* set to 0 */
943 UInt32 csRangeBlockCount; /* # blocks */
944 UInt32 csRangeFlags; /* dependent video */
945
946 UInt64 csMinPixelClock; /* Min dot clock in Hz */
947 UInt64 csMaxPixelClock; /* Max dot clock in Hz */
948
949 UInt32 csMaxPixelError; /* Max dot clock error */
950 UInt32 csTimingRangeSyncFlags;
951 UInt32 csTimingRangeSignalLevels;
952 UInt32 csReserved0;
953
954 UInt32 csMinFrameRate; /* Hz */
955 UInt32 csMaxFrameRate; /* Hz */
956 UInt32 csMinLineRate; /* Hz */
957 UInt32 csMaxLineRate; /* Hz */
958
959
960 UInt32 csMaxHorizontalTotal; /* Clocks - Maximum total (active + blanking) */
961 UInt32 csMaxVerticalTotal; /* Clocks - Maximum total (active + blanking) */
962 UInt32 csMaxTotalReserved1; /* Reserved */
963 UInt32 csMaxTotalReserved2; /* Reserved */
964
965
966
967 /* Some cards require that some timing elements*/
968 /* be multiples of a "character size" (often 8*/
969 /* clocks). The "xxxxCharSize" fields document*/
970 /* those requirements.*/
971
972
973 UInt8 csCharSizeHorizontalActive; /* Character size */
974 UInt8 csCharSizeHorizontalBlanking; /* Character size */
975 UInt8 csCharSizeHorizontalSyncOffset; /* Character size */
976 UInt8 csCharSizeHorizontalSyncPulse; /* Character size */
977
978 UInt8 csCharSizeVerticalActive; /* Character size */
979 UInt8 csCharSizeVerticalBlanking; /* Character size */
980 UInt8 csCharSizeVerticalSyncOffset; /* Character size */
981 UInt8 csCharSizeVerticalSyncPulse; /* Character size */
982
983 UInt8 csCharSizeHorizontalBorderLeft; /* Character size */
984 UInt8 csCharSizeHorizontalBorderRight; /* Character size */
985 UInt8 csCharSizeVerticalBorderTop; /* Character size */
986 UInt8 csCharSizeVerticalBorderBottom; /* Character size */
987
988 UInt8 csCharSizeHorizontalTotal; /* Character size for active + blanking */
989 UInt8 csCharSizeVerticalTotal; /* Character size for active + blanking */
990 UInt16 csCharSizeReserved1; /* Reserved (Init to 0) */
991
992
993 UInt32 csMinHorizontalActiveClocks;
994 UInt32 csMaxHorizontalActiveClocks;
995 UInt32 csMinHorizontalBlankingClocks;
996 UInt32 csMaxHorizontalBlankingClocks;
997
998 UInt32 csMinHorizontalSyncOffsetClocks;
999 UInt32 csMaxHorizontalSyncOffsetClocks;
1000 UInt32 csMinHorizontalPulseWidthClocks;
1001 UInt32 csMaxHorizontalPulseWidthClocks;
1002
1003 UInt32 csMinVerticalActiveClocks;
1004 UInt32 csMaxVerticalActiveClocks;
1005 UInt32 csMinVerticalBlankingClocks;
1006 UInt32 csMaxVerticalBlankingClocks;
1007
1008 UInt32 csMinVerticalSyncOffsetClocks;
1009 UInt32 csMaxVerticalSyncOffsetClocks;
1010 UInt32 csMinVerticalPulseWidthClocks;
1011 UInt32 csMaxVerticalPulseWidthClocks;
1012
1013
1014 UInt32 csMinHorizontalBorderLeft;
1015 UInt32 csMaxHorizontalBorderLeft;
1016 UInt32 csMinHorizontalBorderRight;
1017 UInt32 csMaxHorizontalBorderRight;
1018
1019 UInt32 csMinVerticalBorderTop;
1020 UInt32 csMaxVerticalBorderTop;
1021 UInt32 csMinVerticalBorderBottom;
1022 UInt32 csMaxVerticalBorderBottom;
1023
1024 UInt32 csReserved1; /* Reserved (Init to 0)*/
1025 UInt32 csReserved2; /* Reserved (Init to 0)*/
1026 UInt32 csReserved3; /* Reserved (Init to 0)*/
1027 UInt32 csReserved4; /* Reserved (Init to 0)*/
1028
1029 UInt32 csReserved5; /* Reserved (Init to 0)*/
1030 UInt32 csReserved6; /* Reserved (Init to 0)*/
1031 UInt32 csReserved7; /* Reserved (Init to 0)*/
1032 UInt32 csReserved8; /* Reserved (Init to 0)*/
1033 };
1034 typedef struct VDDisplayTimingRangeRec VDDisplayTimingRangeRec;
1035
1036 typedef VDDisplayTimingRangeRec * VDDisplayTimingRangePtr;
1037
1038 enum {
1039 /* csDisplayModeState*/
1040 kDMSModeReady = 0, /* Display Mode ID is configured and ready*/
1041 kDMSModeNotReady = 1, /* Display Mode ID is is being programmed*/
1042 kDMSModeFree = 2 /* Display Mode ID is not associated with a timing*/
1043 };
1044
1045
1046 /* Video driver Errors -10930 to -10959 */
1047 enum {
1048 kTimingChangeRestrictedErr = -10930,
1049 kVideoI2CReplyPendingErr = -10931,
1050 kVideoI2CTransactionErr = -10932,
1051 kVideoI2CBusyErr = -10933,
1052 kVideoI2CTransactionTypeErr = -10934,
1053 kVideoBufferSizeErr = -10935
1054 };
1055
1056
1057 enum {
1058 /* csTimingRangeSignalLevels*/
1059 kRangeSupportsSignal_0700_0300_Bit = 0,
1060 kRangeSupportsSignal_0714_0286_Bit = 1,
1061 kRangeSupportsSignal_1000_0400_Bit = 2,
1062 kRangeSupportsSignal_0700_0000_Bit = 3,
1063 kRangeSupportsSignal_0700_0300_Mask = (1 << kRangeSupportsSignal_0700_0300_Bit),
1064 kRangeSupportsSignal_0714_0286_Mask = (1 << kRangeSupportsSignal_0714_0286_Bit),
1065 kRangeSupportsSignal_1000_0400_Mask = (1 << kRangeSupportsSignal_1000_0400_Bit),
1066 kRangeSupportsSignal_0700_0000_Mask = (1 << kRangeSupportsSignal_0700_0000_Bit)
1067 };
1068
1069
1070 enum {
1071 /* csSignalConfig*/
1072 kDigitalSignalBit = 0, /* Do not set. Mac OS does not currently support arbitrary digital timings*/
1073 kAnalogSetupExpectedBit = 1, /* Analog displays - display expects a blank-to-black setup or pedestal. See VESA signal standards.*/
1074 kDigitalSignalMask = (1 << kDigitalSignalBit),
1075 kAnalogSetupExpectedMask = (1 << kAnalogSetupExpectedBit)
1076 };
1077
1078
1079 enum {
1080 /* csSignalLevels for analog*/
1081 kAnalogSignalLevel_0700_0300 = 0,
1082 kAnalogSignalLevel_0714_0286 = 1,
1083 kAnalogSignalLevel_1000_0400 = 2,
1084 kAnalogSignalLevel_0700_0000 = 3
1085 };
1086
1087
1088 enum {
1089 /* csTimingRangeSyncFlags*/
1090 kRangeSupportsSeperateSyncsBit = 0,
1091 kRangeSupportsSyncOnGreenBit = 1,
1092 kRangeSupportsCompositeSyncBit = 2,
1093 kRangeSupportsVSyncSerrationBit = 3,
1094 kRangeSupportsSeperateSyncsMask = (1 << kRangeSupportsSeperateSyncsBit),
1095 kRangeSupportsSyncOnGreenMask = (1 << kRangeSupportsSyncOnGreenBit),
1096 kRangeSupportsCompositeSyncMask = (1 << kRangeSupportsCompositeSyncBit),
1097 kRangeSupportsVSyncSerrationMask = (1 << kRangeSupportsVSyncSerrationBit)
1098 };
1099
1100
1101
1102 enum {
1103 /* csHorizontalSyncConfig and csVerticalSyncConfig*/
1104 kSyncPositivePolarityBit = 0, /* Digital separate sync polarity for analog interfaces (0 => negative polarity)*/
1105 kSyncPositivePolarityMask = (1 << kSyncPositivePolarityBit)
1106 };
1107
1108
1109
1110
1111 /* For timings with kDetailedTimingFormat.*/
1112
1113 struct VDDetailedTimingRec {
1114 UInt32 csTimingSize; /* Init to sizeof(VDDetailedTimingRec)*/
1115 UInt32 csTimingType; /* Init to 0*/
1116 UInt32 csTimingVersion; /* Init to 0*/
1117 UInt32 csTimingReserved; /* Init to 0*/
1118
1119 DisplayModeID csDisplayModeID; /* Init to 0*/
1120 UInt32 csDisplayModeSeed; /* */
1121 UInt32 csDisplayModeState; /* Display Mode state*/
1122 UInt32 csDisplayModeAlias; /* Mode to use when programmed.*/
1123
1124 UInt32 csSignalConfig;
1125 UInt32 csSignalLevels;
1126
1127 UInt64 csPixelClock; /* Hz*/
1128
1129 UInt64 csMinPixelClock; /* Hz - With error what is slowest actual clock */
1130 UInt64 csMaxPixelClock; /* Hz - With error what is fasted actual clock */
1131
1132
1133 UInt32 csHorizontalActive; /* Pixels*/
1134 UInt32 csHorizontalBlanking; /* Pixels*/
1135 UInt32 csHorizontalSyncOffset; /* Pixels*/
1136 UInt32 csHorizontalSyncPulseWidth; /* Pixels*/
1137
1138 UInt32 csVerticalActive; /* Lines*/
1139 UInt32 csVerticalBlanking; /* Lines*/
1140 UInt32 csVerticalSyncOffset; /* Lines*/
1141 UInt32 csVerticalSyncPulseWidth; /* Lines*/
1142
1143 UInt32 csHorizontalBorderLeft; /* Pixels*/
1144 UInt32 csHorizontalBorderRight; /* Pixels*/
1145 UInt32 csVerticalBorderTop; /* Lines*/
1146 UInt32 csVerticalBorderBottom; /* Lines*/
1147
1148 UInt32 csHorizontalSyncConfig;
1149 UInt32 csHorizontalSyncLevel; /* Future use (init to 0)*/
1150 UInt32 csVerticalSyncConfig;
1151 UInt32 csVerticalSyncLevel; /* Future use (init to 0)*/
1152
1153 UInt32 csReserved1; /* Init to 0*/
1154 UInt32 csReserved2; /* Init to 0*/
1155 UInt32 csReserved3; /* Init to 0*/
1156 UInt32 csReserved4; /* Init to 0*/
1157
1158 UInt32 csReserved5; /* Init to 0*/
1159 UInt32 csReserved6; /* Init to 0*/
1160 UInt32 csReserved7; /* Init to 0*/
1161 UInt32 csReserved8; /* Init to 0*/
1162 };
1163 typedef struct VDDetailedTimingRec VDDetailedTimingRec;
1164
1165 typedef VDDetailedTimingRec * VDDetailedTimingPtr;
1166 typedef UInt32 VDClutBehavior;
1167 typedef VDClutBehavior * VDClutBehaviorPtr;
1168 enum {
1169 kSetClutAtSetEntries = 0, /* SetEntries behavior is to update clut during SetEntries call*/
1170 kSetClutAtVBL = 1 /* SetEntries behavior is to upate clut at next vbl*/
1171 };
1172
1173
1174
1175 struct VDCommunicationRec {
1176 SInt32 csBusID; /* kVideoDefaultBus for single headed cards.*/
1177 UInt32 csCommFlags; /* Always zero*/
1178 UInt32 csMinReplyDelay; /* Minimum delay between send and reply transactions (units depend on csCommFlags)*/
1179 UInt32 csReserved2; /* Always zero*/
1180
1181 UInt32 csSendAddress; /* Usually I2C address (eg 0x6E)*/
1182 UInt32 csSendType; /* See kVideoSimpleI2CType etc.*/
1183 LogicalAddress csSendBuffer; /* Pointer to the send buffer*/
1184 ByteCount csSendSize; /* Number of bytes to send*/
1185
1186 UInt32 csReplyAddress; /* Address from which to read (eg 0x6F for kVideoDDCciReplyType I2C address)*/
1187 UInt32 csReplyType; /* See kVideoDDCciReplyType etc.*/
1188 LogicalAddress csReplyBuffer; /* Pointer to the reply buffer*/
1189 ByteCount csReplySize; /* Max bytes to reply (size of csReplyBuffer)*/
1190
1191 UInt32 csReserved3;
1192 UInt32 csReserved4;
1193 UInt32 csReserved5; /* Always zero*/
1194 UInt32 csReserved6; /* Always zero*/
1195 };
1196 typedef struct VDCommunicationRec VDCommunicationRec;
1197
1198 typedef VDCommunicationRec * VDCommunicationPtr;
1199
1200 struct VDCommunicationInfoRec {
1201 SInt32 csBusID; /* kVideoDefaultBus for single headed cards. */
1202 UInt32 csBusType; /* See kVideoBusI2C etc.*/
1203 SInt32 csMinBus; /* Minimum bus (usually kVideoDefaultBus). Used to probe additional busses*/
1204 SInt32 csMaxBus; /* Max bus (usually kVideoDefaultBus). Used to probe additional busses*/
1205
1206 UInt32 csSupportedTypes; /* Bit field for first 32 supported transaction types. Eg. 0x07 => support for kVideoNoTransactionType, kVideoSimpleI2CType and kVideoDDCciReplyType.*/
1207 UInt32 csSupportedCommFlags; /* Return the flags csCommFlags understood by this driver. */
1208 UInt32 csReserved2; /* Always zero*/
1209 UInt32 csReserved3; /* Always zero*/
1210
1211 UInt32 csReserved4; /* Always zero*/
1212 UInt32 csReserved5; /* Always zero*/
1213 UInt32 csReserved6; /* Always zero*/
1214 UInt32 csReserved7; /* Always zero*/
1215 };
1216 typedef struct VDCommunicationInfoRec VDCommunicationInfoRec;
1217
1218 typedef VDCommunicationInfoRec * VDCommunicationInfoPtr;
1219
1220 #if PRAGMA_STRUCT_ALIGN
1221 #pragma options align=reset
1222 #elif PRAGMA_STRUCT_PACKPUSH
1223 #pragma pack(pop)
1224 #elif PRAGMA_STRUCT_PACK
1225 #pragma pack()
1226 #endif
1227
1228 #ifdef PRAGMA_IMPORT_OFF
1229 #pragma import off
1230 #elif PRAGMA_IMPORT
1231 #pragma import reset
1232 #endif
1233
1234 #ifdef __cplusplus
1235 }
1236 #endif
1237
1238 #endif /* __IOMACOSVIDEO__ */
1239