]> git.saurik.com Git - apple/xnu.git/blob - iokit/Families/IOGraphics/IOFramebufferUserClient.h
78d5be5d5f7614a3dc569ca51c691b92f2f26bd5
[apple/xnu.git] / iokit / Families / IOGraphics / IOFramebufferUserClient.h
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) 1997 Apple Computer, Inc.
24 *
25 *
26 * HISTORY
27 *
28 */
29
30
31 #ifndef _IOKIT_IOFRAMEBUFFERUSERCLIENT_H
32 #define _IOKIT_IOFRAMEBUFFERUSERCLIENT_H
33
34 #include <IOKit/IOUserClient.h>
35 #include <IOKit/graphics/IOFramebuffer.h>
36 #include <IOKit/pci/IOAGPDevice.h>
37
38 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
39
40 class IOFramebufferUserClient : public IOUserClient
41 {
42 OSDeclareDefaultStructors(IOFramebufferUserClient)
43
44 private:
45
46 IONotifier * powerRootNotifier;
47 IONotifier * frameBufferNotifier;
48
49 IOExternalMethod externals[ 18 ];
50
51
52
53 public:
54
55 IOFramebuffer * owner;
56 mach_port_t WSnotificationPort; // how we tell window server of power changes
57 void * notificationMsg; // Msg to be sent to Window Server.
58
59 bool WSKnowsWeAreOff; // true after informing WS that framebuffer is off
60 bool ackRoot; // true if we must ack the root domain
61 bool ackFrameBuffer; // true if we must ack the framebuffer
62 void * PMrefcon; // refcon to return to Power Management
63
64 // IOUserClient methods
65 virtual IOReturn clientClose( void );
66
67 virtual IOService * getService( void );
68
69 virtual IOReturn clientMemoryForType( UInt32 type,
70 IOOptionBits * options, IOMemoryDescriptor ** memory );
71
72 virtual IOExternalMethod * getExternalMethodForIndex( UInt32 index );
73
74 virtual IOReturn registerNotificationPort( mach_port_t, UInt32, UInt32 );
75 virtual IOReturn getNotificationSemaphore( UInt32 interruptType,
76 semaphore_t * semaphore );
77
78 // others
79
80 static IOFramebufferUserClient * withTask( task_t owningTask );
81
82 virtual bool start( IOService * provider );
83 virtual IOReturn setProperties( OSObject * properties );
84
85 virtual IOReturn acknowledgeNotification(void);
86
87 };
88
89 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
90
91 class IOGraphicsEngineClient : public IOUserClient
92 {
93 OSDeclareDefaultStructors(IOGraphicsEngineClient)
94
95 private:
96
97 IOFramebuffer * owner;
98 task_t owningTask;
99 IOAGPDevice * agpDev;
100 bool haveAGP;
101 OSArray * descriptors;
102
103 IOExternalMethod externals[ 4 ];
104
105 public:
106 // IOUserClient methods
107 virtual IOReturn clientClose( void );
108 virtual void free();
109
110 virtual IOService * getService( void );
111
112 virtual IOReturn clientMemoryForType( UInt32 type,
113 IOOptionBits * options, IOMemoryDescriptor ** memory );
114
115 virtual IOExternalMethod * getExternalMethodForIndex( UInt32 index );
116
117 // others
118
119 static IOGraphicsEngineClient * withTask( task_t owningTask );
120 virtual bool start( IOService * provider );
121
122 virtual IOReturn addUserRange( vm_address_t start, vm_size_t length,
123 UInt32 aperture, IOPhysicalAddress * phys );
124
125 virtual IOReturn createAGPSpace( IOOptionBits options,
126 IOPhysicalLength length,
127 IOPhysicalAddress * address,
128 IOPhysicalLength * lengthOut );
129
130 virtual IOReturn commitAGPMemory( vm_address_t start,
131 vm_size_t length, IOOptionBits options,
132 void ** ref, IOByteCount * offset );
133
134 virtual IOReturn releaseAGPMemory( void * ref );
135
136 };
137
138 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
139
140 class IOFramebufferSharedUserClient : public IOUserClient
141 {
142 OSDeclareDefaultStructors(IOFramebufferSharedUserClient)
143
144 private:
145
146 IOFramebuffer * owner;
147
148 IOExternalMethod externals[ 0 ];
149
150 public:
151 virtual void free();
152 virtual void release() const;
153
154 // IOUserClient methods
155 virtual IOReturn clientClose( void );
156
157 virtual IOService * getService( void );
158
159 virtual IOReturn clientMemoryForType( UInt32 type,
160 IOOptionBits * options, IOMemoryDescriptor ** memory );
161
162 virtual IOReturn getNotificationSemaphore( UInt32 notification_type,
163 semaphore_t * semaphore );
164
165 virtual IOExternalMethod * getExternalMethodForIndex( UInt32 index );
166
167 // others
168 static IOFramebufferSharedUserClient * withTask( task_t owningTask );
169 virtual bool start( IOService * provider );
170 };
171
172
173 #endif /* ! _IOKIT_IOFRAMEBUFFERUSERCLIENT_H */