|
|
1.1 root 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 unsigned long maxCapabilityForDomainState ( IOPMPowerFlags );
60: virtual unsigned long powerStateForDomainState ( IOPMPowerFlags );
61: virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags );
62: virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService* whatDevice );
63: virtual void makeDisplaysUsable ( void );
64: virtual void idleDisplays ( void );
65:
66: static bool _displayHandler( void * target, void * ref,
67: IOService * newService );
68: static bool _displayConnectHandler( void * target, void * ref,
69: IOService * newService );
70:
71: virtual bool displayHandler( OSSet * set, IODisplay * newDisplay);
72: virtual bool displayConnectHandler( void * ref, IODisplayConnect * connect);
73:
74: virtual bool makeDisplayConnects( IOFramebuffer * fb );
75:
76: virtual IODisplayConnect * getDisplayConnect(
77: IOFramebuffer * fb, IOIndex connect );
78:
79: virtual IOReturn getConnectFlagsForDisplayMode(
80: IODisplayConnect * connect,
81: IODisplayModeID mode, UInt32 * flags );
82:
83: virtual IOReturn getDefaultMode( IOFramebuffer * fb,
84: IODisplayModeID * mode, IOIndex * depth );
85:
86: virtual IOReturn findStartupMode( IOFramebuffer * fb );
87:
88: public:
89:
90: virtual bool start(IOService * provider);
91:
92: static IOReturn clientStart( IOFramebuffer * fb );
93:
94: static IOReturn getFlagsForDisplayMode(
95: IOFramebuffer * fb,
96: IODisplayModeID mode, UInt32 * flags );
97:
98: };
99:
100: #endif /* _IOKIT_IODISPLAYWRANGLER_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.