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) 1997 Apple Computer, Inc.
28 * sdouglas 22 Oct 97 - first checked in.
29 * sdouglas 23 Jul 98 - start IOKit
32 #ifndef _IOKIT_IODISPLAY_H
33 #define _IOKIT_IODISPLAY_H
35 #include <IOKit/IOService.h>
36 #include <IOKit/graphics/IOFramebuffer.h>
38 extern const OSSymbol
* gIODisplayParametersKey
;
39 extern const OSSymbol
* gIODisplayGUIDKey
;
41 extern const OSSymbol
* gIODisplayValueKey
;
42 extern const OSSymbol
* gIODisplayMinValueKey
;
43 extern const OSSymbol
* gIODisplayMaxValueKey
;
45 extern const OSSymbol
* gIODisplayContrastKey
;
46 extern const OSSymbol
* gIODisplayBrightnessKey
;
47 extern const OSSymbol
* gIODisplayHorizontalPositionKey
;
48 extern const OSSymbol
* gIODisplayHorizontalSizeKey
;
49 extern const OSSymbol
* gIODisplayVerticalPositionKey
;
50 extern const OSSymbol
* gIODisplayVerticalSizeKey
;
51 extern const OSSymbol
* gIODisplayTrapezoidKey
;
52 extern const OSSymbol
* gIODisplayPincushionKey
;
53 extern const OSSymbol
* gIODisplayParallelogramKey
;
54 extern const OSSymbol
* gIODisplayRotationKey
;
56 extern const OSSymbol
* gIODisplayParametersCommitKey
;
57 extern const OSSymbol
* gIODisplayParametersDefaultKey
;
60 kIODisplayMaxPowerStates
= 4
63 struct DisplayPMVars
// these are the private instance variables for power management
66 // control bytes we send to the framebuffer to control syncs
67 UInt32 syncControls
[kIODisplayMaxPowerStates
];
68 // mask bits that go with the control byte
70 // current state of sync signals
72 // highest state number normally, lowest usable state in emergency
73 unsigned long max_display_state
;
74 bool displayIdle
; // true if the display has had power lowered due to user inactivity
75 bool powerControllable
; // false if no sync control available on video display
78 class IODisplayConnect
: public IOService
80 OSDeclareDefaultStructors(IODisplayConnect
)
86 virtual bool initWithConnection( IOIndex connection
);
87 virtual IOFramebuffer
* getFramebuffer( void );
88 virtual IOIndex
getConnection( void );
89 virtual IOReturn
getAttributeForConnection( IOIndex
, IOSelect
, UInt32
* );
90 virtual IOReturn
setAttributeForConnection( IOIndex
, IOSelect
, UInt32
);
91 virtual void joinPMtree ( IOService
* driver
);
94 class IODisplay
: public IOService
96 OSDeclareAbstractStructors(IODisplay
)
99 static void initialize( void );
103 // used to query the framebuffer controller
104 IODisplayConnect
* connection
;
106 // pointer to protected instance variables for power management
107 struct DisplayPMVars
* displayPMVars
;
109 /* Reserved for future expansion. */
110 int _IODisplay_reserved
[2];
112 virtual void initForPM ( IOService
* );
114 virtual IOReturn
setProperties( OSObject
* properties
);
116 virtual IOReturn
setAggressiveness ( unsigned long, unsigned long newLevel
);
117 virtual IOReturn
setPowerState ( unsigned long, IOService
* );
118 virtual unsigned long maxCapabilityForDomainState ( IOPMPowerFlags
);
119 virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags
);
120 virtual unsigned long powerStateForDomainState ( IOPMPowerFlags
);
123 virtual IOService
* probe( IOService
* provider
,
126 virtual bool start( IOService
* provider
);
128 virtual IODisplayConnect
* getConnection( void );
130 virtual IOReturn
getConnectFlagsForDisplayMode(
131 IODisplayModeID mode
, UInt32
* flags
) = 0;
133 virtual IOReturn
getGammaTableByIndex(
134 UInt32
* channelCount
, UInt32
* dataCount
,
135 UInt32
* dataWidth
, void ** data
);
137 virtual void dropOneLevel ( void );
138 virtual void makeDisplayUsable ( void );
139 IOReturn
registerPowerDriver ( IOService
*, IOPMPowerState
*, unsigned long );
142 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
144 class AppleSenseDisplay
: public IODisplay
146 OSDeclareDefaultStructors(AppleSenseDisplay
)
149 virtual IOService
* probe( IOService
* provider
,
152 virtual IOReturn
getConnectFlagsForDisplayMode(
153 IODisplayModeID mode
, UInt32
* flags
);
156 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
158 class AppleNoSenseDisplay
: public IODisplay
160 OSDeclareDefaultStructors(AppleNoSenseDisplay
)
163 virtual IOReturn
getConnectFlagsForDisplayMode(
164 IODisplayModeID mode
, UInt32
* flags
);
167 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
169 #endif /* ! _IOKIT_IODISPLAY_H */