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) 1999 Apple Computer, Inc.
30 #ifndef _IOKIT_IODISPLAYWRANGLER_H
31 #define _IOKIT_IODISPLAYWRANGLER_H
33 #include <IOKit/IOService.h>
34 #include <IOKit/graphics/IOFramebuffer.h>
35 #include <IOKit/graphics/IODisplay.h>
40 class IODisplayWrangler
: public IOService
42 OSDeclareDefaultStructors( IODisplayWrangler
);
46 IOLock
* fMatchingLock
;
47 OSSet
* fFramebuffers
;
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
;
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 );
63 static bool _displayHandler( void * target
, void * ref
,
64 IOService
* newService
);
65 static bool _displayConnectHandler( void * target
, void * ref
,
66 IOService
* newService
);
68 virtual bool displayHandler( OSSet
* set
, IODisplay
* newDisplay
);
69 virtual bool displayConnectHandler( void * ref
, IODisplayConnect
* connect
);
71 virtual bool makeDisplayConnects( IOFramebuffer
* fb
);
73 virtual IODisplayConnect
* getDisplayConnect(
74 IOFramebuffer
* fb
, IOIndex connect
);
76 virtual IOReturn
getConnectFlagsForDisplayMode(
77 IODisplayConnect
* connect
,
78 IODisplayModeID mode
, UInt32
* flags
);
80 virtual IOReturn
getDefaultMode( IOFramebuffer
* fb
,
81 IODisplayModeID
* mode
, IOIndex
* depth
);
83 virtual IOReturn
findStartupMode( IOFramebuffer
* fb
);
87 IOService
* rootDomain
; // points to Root Power Domain
89 virtual bool start(IOService
* provider
);
91 static IOReturn
clientStart( IOFramebuffer
* fb
);
93 static IOReturn
getFlagsForDisplayMode(
95 IODisplayModeID mode
, UInt32
* flags
);
99 #endif /* _IOKIT_IODISPLAYWRANGLER_H */