]>
Commit | Line | Data |
---|---|---|
1c79356b A |
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 | * Copyright (c) 1999 Apple Computer, Inc. | |
24 | * | |
25 | * | |
26 | * HISTORY | |
27 | * | |
28 | */ | |
29 | ||
30 | #ifndef _IOKIT_IODISPLAYWRANGLER_H | |
31 | #define _IOKIT_IODISPLAYWRANGLER_H | |
32 | ||
33 | #include <IOKit/IOService.h> | |
34 | #include <IOKit/graphics/IOFramebuffer.h> | |
35 | #include <IOKit/graphics/IODisplay.h> | |
36 | ||
37 | class IOWorkLoop; | |
38 | class IOCommandQueue; | |
39 | ||
40 | class IODisplayWrangler : public IOService | |
41 | { | |
42 | OSDeclareDefaultStructors( IODisplayWrangler ); | |
43 | ||
44 | private: | |
45 | bool fOpen; | |
46 | IOLock * fMatchingLock; | |
47 | OSSet * fFramebuffers; | |
48 | OSSet * fDisplays; | |
49 | // true: we have informed displays to assume lowest usable state | |
50 | bool emergency_informed; | |
51 | // from control panel: number of idle minutes before dimming | |
52 | unsigned long mins_to_dim; | |
53 | // false: use mins_to_dim unless in emergency situation | |
54 | bool use_general_aggressiveness; | |
55 | ||
56 | virtual void initForPM ( void ); | |
57 | virtual IOReturn setAggressiveness ( unsigned long, unsigned long ); | |
58 | virtual bool activityTickle ( unsigned long, unsigned long ); | |
59 | virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService* whatDevice ); | |
60 | virtual void makeDisplaysUsable ( void ); | |
61 | virtual void idleDisplays ( void ); | |
62 | ||
63 | static bool _displayHandler( void * target, void * ref, | |
64 | IOService * newService ); | |
65 | static bool _displayConnectHandler( void * target, void * ref, | |
66 | IOService * newService ); | |
67 | ||
68 | virtual bool displayHandler( OSSet * set, IODisplay * newDisplay); | |
69 | virtual bool displayConnectHandler( void * ref, IODisplayConnect * connect); | |
70 | ||
71 | virtual bool makeDisplayConnects( IOFramebuffer * fb ); | |
72 | ||
73 | virtual IODisplayConnect * getDisplayConnect( | |
74 | IOFramebuffer * fb, IOIndex connect ); | |
75 | ||
76 | virtual IOReturn getConnectFlagsForDisplayMode( | |
77 | IODisplayConnect * connect, | |
78 | IODisplayModeID mode, UInt32 * flags ); | |
79 | ||
80 | virtual IOReturn getDefaultMode( IOFramebuffer * fb, | |
81 | IODisplayModeID * mode, IOIndex * depth ); | |
82 | ||
83 | virtual IOReturn findStartupMode( IOFramebuffer * fb ); | |
84 | ||
85 | public: | |
86 | ||
87 | IOService * rootDomain; // points to Root Power Domain | |
88 | ||
89 | virtual bool start(IOService * provider); | |
90 | ||
91 | static IOReturn clientStart( IOFramebuffer * fb ); | |
92 | ||
93 | static IOReturn getFlagsForDisplayMode( | |
94 | IOFramebuffer * fb, | |
95 | IODisplayModeID mode, UInt32 * flags ); | |
96 | ||
97 | }; | |
98 | ||
99 | #endif /* _IOKIT_IODISPLAYWRANGLER_H */ |