2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
30 #ifndef _IOKIT_IOGRAPHICSTYPES_H
31 #define _IOKIT_IOGRAPHICSTYPES_H
34 #include <IOKit/IOTypes.h>
41 typedef SInt32 IOIndex
;
42 typedef UInt32 IOSelect
;
43 typedef UInt32 IOFixed1616
;
44 typedef SInt32 IODisplayModeID
;
45 typedef UInt32 IODisplayVendorID
;
46 typedef UInt32 IODisplayProductID
;
51 typedef char IOPixelEncoding
[ kIOMaxPixelBits
];
53 // Common Apple pixel formats
55 #define IO1BitIndexedPixels "P"
56 #define IO2BitIndexedPixels "PP"
57 #define IO4BitIndexedPixels "PPPP"
58 #define IO8BitIndexedPixels "PPPPPPPP"
59 #define IO16BitDirectPixels "-RRRRRGGGGGBBBBB"
60 #define IO32BitDirectPixels "--------RRRRRRRRGGGGGGGGBBBBBBBB"
62 // other possible pixel formats
64 #define IOYUV422Pixels "Y4U2V2"
65 #define IO8BitOverlayPixels "O8"
67 #define IOPagedPixels "Page1"
69 #define IO_SampleTypeAlpha 'A'
70 #define IO_SampleTypeSkip '-'
72 // Info about a pixel format
75 kIOFixedCLUTPixels
= 1,
76 kIORGBDirectPixels
= 2,
77 kIOMonoDirectPixels
= 3,
78 kIOMonoInverseDirectPixels
= 4,
81 struct IOPixelInformation
{
82 IOByteCount bytesPerRow
;
83 IOByteCount bytesPerPlane
;
86 UInt32 componentCount
;
87 UInt32 bitsPerComponent
;
88 UInt32 componentMasks
[ 8 * 2 ];
89 IOPixelEncoding pixelFormat
;
95 typedef struct IOPixelInformation IOPixelInformation
;
97 // Info about a display mode
98 typedef UInt32 IOAppleTimingID
;
100 struct IODisplayModeInformation
{
102 UInt32 nominalHeight
;
103 IOFixed1616 refreshRate
;
104 IOIndex maxDepthIndex
;
106 UInt32 reserved
[ 4 ];
108 typedef struct IODisplayModeInformation IODisplayModeInformation
;
112 kDisplayModeSafetyFlags
= 0x00000007,
114 kDisplayModeAlwaysShowFlag
= 0x00000008,
115 kDisplayModeNeverShowFlag
= 0x00000080,
116 kDisplayModeNotResizeFlag
= 0x00000010,
117 kDisplayModeRequiresPanFlag
= 0x00000020,
119 kDisplayModeInterlacedFlag
= 0x00000040,
121 kDisplayModeSimulscanFlag
= 0x00000100,
122 kDisplayModeBuiltInFlag
= 0x00000400,
123 kDisplayModeNotPresetFlag
= 0x00000200,
124 kDisplayModeStretchedFlag
= 0x00000800
127 kDisplayModeValidFlag
= 0x00000001,
128 kDisplayModeSafeFlag
= 0x00000002,
129 kDisplayModeDefaultFlag
= 0x00000004,
134 struct IOFramebufferInformation
{
135 IOPhysicalAddress baseAddress
;
138 IOByteCount bytesPerRow
;
139 IOByteCount bytesPerPlane
;
143 UInt32 reserved
[ 4 ];
145 typedef struct IOFramebufferInformation IOFramebufferInformation
;
149 kFramebufferSupportsCopybackCache
= 0x00010000,
150 kFramebufferSupportsWritethruCache
= 0x00020000,
151 kFramebufferSupportsGammaCorrection
= 0x00040000,
152 kFramebufferDisableAltivecAccess
= 0x00080000,
155 // Aperture is an index into supported pixel formats for a mode & depth
156 typedef IOIndex IOPixelAperture
;
158 kIOFBSystemAperture
= 0
163 typedef UInt16 IOColorComponent
;
165 struct IOColorEntry
{
167 IOColorComponent red
;
168 IOColorComponent green
;
169 IOColorComponent blue
;
171 typedef struct IOColorEntry IOColorEntry
;
175 kSetCLUTByValue
= 0x00000001, // else at index
176 kSetCLUTImmediately
= 0x00000002, // else at VBL
177 kSetCLUTWithLuminance
= 0x00000004 // else RGB
180 //// Controller attributes
183 kIOPowerAttribute
= 'powr',
184 kIOHardwareCursorAttribute
= 'crsr'
187 //// Display mode timing information
189 struct IODetailedTimingInformation
{
191 UInt32 pixelClock
; // Hertz
192 UInt32 horizontalActive
; // pixels
193 UInt32 horizontalBlanking
; // pixels
194 UInt32 horizontalBorder
; // pixels
195 UInt32 horizontalSyncOffset
; // pixels
196 UInt32 horizontalSyncWidth
; // pixels
197 UInt32 verticalActive
; // lines
198 UInt32 verticalBlanking
; // lines
199 UInt32 verticalBorder
; // lines
200 UInt32 verticalSyncOffset
; // lines
201 UInt32 verticalSyncWidth
; // lines
203 typedef struct IODetailedTimingInformation IODetailedTimingInformation
;
205 struct IOTimingInformation
{
206 IOAppleTimingID appleTimingID
; // appleTimingXXX const
208 IODetailedTimingInformation detailedInfo
;
210 typedef struct IOTimingInformation IOTimingInformation
;
213 // b0-7 from EDID flags
214 kIODetailedTimingValid
= 0x80000000
220 kOrConnections
= 0xffffffe,
221 kAndConnections
= 0xffffffd
225 kConnectionEnable
= 'enab',
226 kConnectionSyncEnable
= 'sync',
227 kConnectionSyncFlags
= 'sycf',
228 kConnectionSupportsAppleSense
= 'asns',
229 kConnectionSupportsLLDDCSense
= 'lddc',
230 kConnectionSupportsHLDDCSense
= 'hddc'
233 // kConnectionSyncControl values
235 kIOHSyncDisable
= 0x00000001,
236 kIOVSyncDisable
= 0x00000002,
237 kIOCSyncDisable
= 0x00000004,
238 kIONoSeparateSyncControl
= 0x00000040,
239 kIOTriStateSyncs
= 0x00000080,
240 kIOSyncOnBlue
= 0x00000008,
241 kIOSyncOnGreen
= 0x00000010,
242 kIOSyncOnRed
= 0x00000020
246 #define IO_DISPLAY_CAN_FILL 0x00000040
247 #define IO_DISPLAY_CAN_BLIT 0x00000020
249 #define IO_24BPP_TRANSFER_TABLE_SIZE 256
250 #define IO_15BPP_TRANSFER_TABLE_SIZE 256
251 #define IO_8BPP_TRANSFER_TABLE_SIZE 256
252 #define IO_12BPP_TRANSFER_TABLE_SIZE 256
253 #define IO_2BPP_TRANSFER_TABLE_SIZE 256
255 #define STDFB_BM256_TO_BM38_MAP_SIZE 256
256 #define STDFB_BM38_TO_BM256_MAP_SIZE 256
257 #define STDFB_BM38_TO_256_WITH_LOGICAL_SIZE \
258 (STDFB_BM38_TO_BM256_MAP_SIZE + (256/sizeof(int)))
260 #define STDFB_4BPS_TO_5BPS_MAP_SIZE 16
261 #define STDFB_5BPS_TO_4BPS_MAP_SIZE 32
264 // connection types for IOServiceOpen
265 kIOFBServerConnectType
= 0,
266 kIOFBSharedConnectType
= 1,
267 kIOFBEngineControllerConnectType
= 20,
268 kIOFBEngineConnectType
= 21
275 typedef struct IOGPoint IOGPoint
;
281 typedef struct IOGSize IOGSize
;
289 typedef struct IOGBounds IOGBounds
;
291 #if !defined(__Point__) && !defined(BINTREE_H) && !defined(__MACTYPES__)
293 typedef IOGPoint Point
;
296 #if !defined(__Bounds__) && !defined(BINTREE_H) && !defined(__MACTYPES__)
298 typedef IOGBounds Bounds
;
304 kIOFBVBLInterruptType
= 'vbl ',
305 kIOFBHBLInterruptType
= 'hbl ',
306 kIOFBFrameInterruptType
= 'fram',
307 kIOFBConnectInterruptType
= 'dci '
312 #define kIOFramebufferInfoKey "IOFramebufferInformation"
314 #define kIOFBWidthKey "IOFBWidth"
315 #define kIOFBHeightKey "IOFBHeight"
316 #define kIOFBRefreshRateKey "IOFBRefreshRate"
317 #define kIOFBFlagsKey "IOFBFlags"
318 #define kIOFBBytesPerRowKey "IOFBBytesPerRow"
319 #define kIOFBBytesPerPlaneKey "IOFBBytesPerPlane"
320 #define kIOFBBitsPerPixelKey "IOFBBitsPerPixel"
321 #define kIOFBComponentCountKey "IOFBComponentCount"
322 #define kIOFBBitsPerComponentKey "IOFBBitsPerComponent"
324 #define kIOFBDetailedTimingsKey "IOFBDetailedTimings"
325 #define kIOFBTimingRangeKey "IOFBTimingRange"
327 #define kIOFBHostAccessFlagsKey "IOFBHostAccessFlags"
329 #define kIODisplayEDIDKey "IODisplayEDID"
330 #define kIODisplayLocationKey "IODisplayLocation"
333 kDisplayVendorIDUnknown
= 'unkn',
334 kDisplayProductIDGeneric
= 0x717
337 #define kDisplayVendorID "DisplayVendorID" // CFNumber
338 #define kDisplayProductID "DisplayProductID" // CFNumber
339 #define kDisplaySerialNumber "DisplaySerialNumber" // CFNumber
340 #define kDisplaySerialString "DisplaySerialString" // CFString
341 #define kDisplayWeekOfManufacture "DisplayWeekManufacture" // CFNumber
342 #define kDisplayYearOfManufacture "DisplayYearManufacture" // CFNumber
344 // CFDictionary of language-locale keys, name values
345 // eg. "en"="Color LCD", "en-GB"="Colour LCD"
346 #define kDisplayProductName "DisplayProductName"
348 // all CFNumber or CFArray of CFNumber (floats)
349 #define kDisplayWhitePointX "DisplayWhitePointX"
350 #define kDisplayWhitePointY "DisplayWhitePointY"
351 #define kDisplayRedPointX "DisplayRedPointX"
352 #define kDisplayRedPointY "DisplayRedPointY"
353 #define kDisplayGreenPointX "DisplayGreenPointX"
354 #define kDisplayGreenPointY "DisplayGreenPointY"
355 #define kDisplayBluePointX "DisplayBluePointX"
356 #define kDisplayBluePointY "DisplayBluePointY"
357 #define kDisplayWhiteGamma "DisplayWhiteGamma"
358 #define kDisplayRedGamma "DisplayRedGamma"
359 #define kDisplayGreenGamma "DisplayGreenGamma"
360 #define kDisplayBlueGamma "DisplayBlueGamma"
363 #define kDisplayCSProfile "DisplayCSProfile"
366 #define kDisplayHorizontalImageSize "DisplayHorizontalImageSize"
367 #define kDisplayVerticalImageSize "DisplayVerticalImageSize"
369 // Display parameters
371 #define kIODisplayParametersKey "IODisplayParameters"
372 #define kIODisplayGUIDKey "IODisplayGUID"
374 #define kIODisplayValueKey "value"
375 #define kIODisplayMinValueKey "min"
376 #define kIODisplayMaxValueKey "max"
378 #define kIODisplayBrightnessKey "brightness"
379 #define kIODisplayContrastKey "contrast"
380 #define kIODisplayHorizontalPositionKey "horizontal-position"
381 #define kIODisplayHorizontalSizeKey "horizontal-size"
382 #define kIODisplayVerticalPositionKey "vertical-position"
383 #define kIODisplayVerticalSizeKey "vertical-size"
384 #define kIODisplayTrapezoidKey "trapezoid"
385 #define kIODisplayPincushionKey "pincushion"
386 #define kIODisplayParallelogramKey "parallelogram"
387 #define kIODisplayRotationKey "rotation"
388 #define kIODisplayTheatreModeKey "theatre-mode"
390 #define kIODisplayParametersCommitKey "commit"
391 #define kIODisplayParametersDefaultKey "defaults"
397 #endif /* ! _IOKIT_IOGRAPHICSTYPES_H */