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) 1998 Apple Computer, Inc. All rights reserved.
27 * 14 Aug 98 sdouglas created.
28 * 08 Dec 98 sdouglas cpp.
31 #define IOFRAMEBUFFER_PRIVATE
32 #include <IOKit/graphics/IOFramebufferShared.h>
33 #include <IOKit/pwr_mgt/RootDomain.h>
34 #include <IOKit/IOLib.h>
35 #include <IOKit/IOMessage.h>
36 #include <libkern/c++/OSContainers.h>
37 #include <IOKit/IOBufferMemoryDescriptor.h>
39 #include <IOKit/IOPlatformExpert.h>
41 #include <IOKit/assert.h>
43 #include "IOFramebufferUserClient.h"
45 #include <IOKit/graphics/IOGraphicsEngine.h>
48 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
51 #define super IOUserClient
53 OSDefineMetaClassAndStructors(IOFramebufferUserClient
, IOUserClient
)
55 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
57 static IOReturn
myHandler(void *, void * , UInt32
, IOService
*, void *, unsigned int);
58 static IOLock
* gSleepFramebuffersLock
;
59 static OSOrderedSet
* gSleepFramebuffers
;
60 static UInt32 gWakeCount
;
62 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
64 IOFramebufferUserClient
* IOFramebufferUserClient::withTask( task_t owningTask
)
66 IOFramebufferUserClient
* inst
;
68 if( 0 == gSleepFramebuffersLock
) {
69 gSleepFramebuffersLock
= IOLockAlloc();
70 gSleepFramebuffers
= OSOrderedSet::withCapacity(6);
71 assert( gSleepFramebuffersLock
&& gSleepFramebuffers
);
74 inst
= new IOFramebufferUserClient
;
76 if( inst
&& !inst
->init()) {
84 bool IOFramebufferUserClient::start( IOService
* _owner
)
86 static const IOExternalMethod methodTemplate
[] = {
87 /* 0 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 3, 0 },
88 /* 1 */ { NULL
, NULL
, kIOUCScalarIStructO
, 3, sizeof( IOPixelInformation
) },
89 /* 2 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 0, 2 },
90 /* 3 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 2, 0 },
91 /* 4 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 2, 0 },
92 /* 5 */ { NULL
, NULL
, kIOUCScalarIStructO
,
93 1, sizeof( IODisplayModeInformation
) },
94 /* 6 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 0, 1 },
95 /* 7 */ { NULL
, NULL
, kIOUCStructIStructO
, 0, 0xffffffff },
96 /* 8 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 1, 1 },
97 /* 9 */ { NULL
, NULL
, kIOUCStructIStructO
, sizeof( Bounds
), 0 },
98 /* 10 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 3, 0 },
99 /* 11 */ { NULL
, NULL
, kIOUCScalarIStructI
, 3, 0xffffffff },
100 /* 12 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 1, 0 },
101 /* 13 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 2, 0 },
102 /* 14 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 0, 0 },
103 /* 15 */ { NULL
, NULL
, kIOUCScalarIStructI
, 1, 0xffffffff },
104 /* 16 */ { NULL
, NULL
, kIOUCScalarIStructI
, 2, 0xffffffff },
105 /* 17 */ { NULL
, NULL
, kIOUCStructIStructO
, 0xffffffff, 0xffffffff },
109 if( !super::start( _owner
))
112 owner
= (IOFramebuffer
*) _owner
;
114 assert( sizeof( methodTemplate
) == sizeof( externals
));
115 bcopy( methodTemplate
, externals
, sizeof( externals
));
117 externals
[0].object
= owner
;
118 externals
[0].func
= (IOMethod
) &IOFramebuffer::createSharedCursor
;
120 externals
[1].object
= owner
;
121 externals
[1].func
= (IOMethod
) &IOFramebuffer::getPixelInformation
;
123 externals
[2].object
= owner
;
124 externals
[2].func
= (IOMethod
) &IOFramebuffer::getCurrentDisplayMode
;
126 externals
[3].object
= owner
;
127 externals
[3].func
= (IOMethod
) &IOFramebuffer::setStartupDisplayMode
;
129 externals
[4].object
= owner
;
130 externals
[4].func
= (IOMethod
) &IOFramebuffer::extSetDisplayMode
;
132 externals
[5].object
= owner
;
134 (IOMethod
) &IOFramebuffer::extGetInformationForDisplayMode
;
136 externals
[6].object
= owner
;
137 externals
[6].func
= (IOMethod
) &IOFramebuffer::extGetDisplayModeCount
;
139 externals
[7].object
= owner
;
140 externals
[7].func
= (IOMethod
) &IOFramebuffer::extGetDisplayModes
;
142 externals
[8].object
= owner
;
143 externals
[8].func
= (IOMethod
) &IOFramebuffer::extGetVRAMMapOffset
;
145 externals
[9].object
= owner
;
146 externals
[9].func
= (IOMethod
) &IOFramebuffer::extSetBounds
;
148 externals
[10].object
= owner
;
149 externals
[10].func
= (IOMethod
) &IOFramebuffer::extSetNewCursor
;
151 externals
[11].object
= owner
;
152 externals
[11].func
= (IOMethod
) &IOFramebuffer::setGammaTable
;
154 externals
[12].object
= owner
;
155 externals
[12].func
= (IOMethod
) &IOFramebuffer::extSetCursorVisible
;
157 externals
[13].object
= owner
;
158 externals
[13].func
= (IOMethod
) &IOFramebuffer::extSetCursorPosition
;
160 externals
[14].object
= this;
161 externals
[14].func
= (IOMethod
) &IOFramebufferUserClient::acknowledgeNotification
;
163 externals
[15].object
= owner
;
164 externals
[15].func
= (IOMethod
) &IOFramebuffer::extSetColorConvertTable
;
166 externals
[16].object
= owner
;
167 externals
[16].func
= (IOMethod
) &IOFramebuffer::extSetCLUTWithEntries
;
169 externals
[17].object
= owner
;
170 externals
[17].func
= (IOMethod
) &IOFramebuffer::extValidateDetailedTiming
;
173 ackFrameBuffer
= false;
176 owner
->serverConnect
= this;
178 // register interest in sleep and wake
179 powerRootNotifier
= registerSleepWakeInterest(myHandler
, (void *) this);
180 // register interest in frame buffer
181 frameBufferNotifier
= owner
->registerInterest( gIOGeneralInterest
, myHandler
, this, 0 );
187 IOFramebufferUserClient::acknowledgeNotification( void )
189 if( ackFrameBuffer
) {
190 ackFrameBuffer
= false;
191 owner
->allowPowerChange((unsigned long)PMrefcon
);
195 owner
->beginSystemSleep(PMrefcon
);
202 // We have registered for notification of power state changes in the framebuffer and the system in general.
203 // We are notified here of such a change. "System" power changes refer to sleep/wake and power down/up.
204 // "Device" changes refer to the framebuffer.
207 myHandler(void * us
, void *, UInt32 messageType
, IOService
*, void * params
, unsigned int)
210 mach_msg_header_t
*msgh
;
211 IOFramebufferUserClient
* self
= (IOFramebufferUserClient
*)us
;
213 switch (messageType
) {
214 case kIOMessageSystemWillSleep
:
215 if ( !(self
->WSKnowsWeAreOff
) ) {
216 msgh
= (mach_msg_header_t
*)(self
->notificationMsg
);
217 if( msgh
&& (self
->WSnotificationPort
) ) {
219 self
->WSKnowsWeAreOff
= true;
220 self
->ackRoot
= true;
221 r
= mach_msg_send_from_kernel( msgh
, msgh
->msgh_size
);
222 if( KERN_SUCCESS
== r
) {
223 // WS will ack within ten seconds
224 ((sleepWakeNote
*)params
)->returnValue
= 10000000;
225 self
->PMrefcon
= ((sleepWakeNote
*)params
)->powerRef
;
226 IOLockLock( gSleepFramebuffersLock
);
227 gSleepFramebuffers
->setObject(self
);
228 IOLockUnlock( gSleepFramebuffersLock
);
229 return kIOReturnSuccess
;
233 self
->ackRoot
= false;
234 ((sleepWakeNote
*)params
)->returnValue
= 0;
235 return kIOReturnSuccess
;
237 case kIOMessageDeviceWillPowerOff
:
238 if ( !self
->WSKnowsWeAreOff
) {
239 msgh
= (mach_msg_header_t
*)(self
->notificationMsg
);
240 if( msgh
&& (self
->WSnotificationPort
) ) {
242 self
->WSKnowsWeAreOff
= true;
243 self
->ackFrameBuffer
= true;
244 r
= mach_msg_send_from_kernel( msgh
, msgh
->msgh_size
);
245 if( KERN_SUCCESS
== r
) {
246 // WS will ack within ten seconds
247 ((sleepWakeNote
*)params
)->returnValue
= 10000000;
248 self
->PMrefcon
= ((sleepWakeNote
*)params
)->powerRef
;
249 IOLockLock( gSleepFramebuffersLock
);
250 gSleepFramebuffers
->setObject(self
);
251 IOLockUnlock( gSleepFramebuffersLock
);
252 return kIOReturnSuccess
;
256 ((sleepWakeNote
*)params
)->returnValue
= 0;
257 self
->ackFrameBuffer
= false;
258 return kIOReturnSuccess
;
260 case kIOMessageDeviceHasPoweredOn
:
262 IOLockLock( gSleepFramebuffersLock
);
264 if( gWakeCount
== gSleepFramebuffers
->getCount()) {
265 while( (self
= (IOFramebufferUserClient
*) gSleepFramebuffers
->getFirstObject())) {
266 if ( self
->WSKnowsWeAreOff
) {
267 msgh
= (mach_msg_header_t
*)(self
->notificationMsg
);
268 if( msgh
&& (self
->WSnotificationPort
)) {
270 self
->WSKnowsWeAreOff
= false;
271 r
= mach_msg_send_from_kernel( msgh
, msgh
->msgh_size
);
274 gSleepFramebuffers
->removeObject( self
);
278 IOLockUnlock( gSleepFramebuffersLock
);
279 return kIOReturnSuccess
;
281 return kIOReturnUnsupported
;
284 IOReturn
IOFramebufferUserClient::registerNotificationPort(
289 static mach_msg_header_t init_msg
= {
290 // mach_msg_bits_t msgh_bits;
291 MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND
,0),
292 // mach_msg_size_t msgh_size;
293 sizeof (mach_msg_header_t
),
294 // mach_port_t msgh_remote_port;
296 // mach_port_t msgh_local_port;
298 // mach_msg_size_t msgh_reserved;
300 // mach_msg_id_t msgh_id;
304 if ( notificationMsg
== NULL
)
305 notificationMsg
= IOMalloc( sizeof (mach_msg_header_t
) );
306 // Initialize the power state change notification message.
307 *((mach_msg_header_t
*)notificationMsg
) = init_msg
;
309 ((mach_msg_header_t
*)notificationMsg
)->msgh_remote_port
= port
;
311 WSnotificationPort
= port
;
312 WSKnowsWeAreOff
= false;
313 return( kIOReturnSuccess
);
316 IOReturn
IOFramebufferUserClient::getNotificationSemaphore(
317 UInt32 interruptType
, semaphore_t
* semaphore
)
319 return( owner
->getNotificationSemaphore(interruptType
, semaphore
) );
322 // The window server is going away.
323 // We disallow power down to prevent idle sleep while the console is running.
324 IOReturn
IOFramebufferUserClient::clientClose( void )
327 if( owner
->isConsoleDevice())
328 getPlatform()->setConsoleInfo( 0, kPEAcquireScreen
);
330 if( powerRootNotifier
) {
331 powerRootNotifier
->remove();
332 powerRootNotifier
= 0;
334 if( frameBufferNotifier
) {
335 frameBufferNotifier
->remove();
336 frameBufferNotifier
= 0;
338 if( notificationMsg
) {
339 IOFree( notificationMsg
, sizeof (mach_msg_header_t
));
342 owner
->serverConnect
= 0;
343 WSnotificationPort
= NULL
;
346 return( kIOReturnSuccess
);
349 IOService
* IOFramebufferUserClient::getService( void )
354 IOReturn
IOFramebufferUserClient::clientMemoryForType( UInt32 type
,
355 IOOptionBits
* flags
, IOMemoryDescriptor
** memory
)
357 IOMemoryDescriptor
* mem
;
362 case kIOFBCursorMemory
:
363 mem
= owner
->sharedCursor
;
367 case kIOFBVRAMMemory
:
368 mem
= owner
->getVRAMRange();
372 mem
= (IOMemoryDescriptor
*) owner
->userAccessRanges
->getObject( type
);
379 err
= kIOReturnSuccess
;
381 err
= kIOReturnBadArgument
;
386 IOExternalMethod
* IOFramebufferUserClient::getExternalMethodForIndex( UInt32 index
)
388 if( index
< (sizeof( externals
) / sizeof( externals
[0])))
389 return( externals
+ index
);
394 IOReturn
IOFramebufferUserClient::setProperties( OSObject
* properties
)
398 IOReturn kr
= kIOReturnUnsupported
;
400 if( !(dict
= OSDynamicCast( OSDictionary
, properties
)))
401 return( kIOReturnBadArgument
);
403 if( (array
= OSDynamicCast(OSArray
,
404 dict
->getObject( kIOFBDetailedTimingsKey
))))
405 kr
= owner
->setDetailedTimings( array
);
407 kr
= kIOReturnBadArgument
;
412 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
414 OSDefineMetaClassAndStructors(IOGraphicsEngineClient
, IOUserClient
)
416 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
418 IOGraphicsEngineClient
* IOGraphicsEngineClient::withTask( task_t owningTask
)
420 IOGraphicsEngineClient
* inst
;
422 inst
= new IOGraphicsEngineClient
;
424 if( inst
&& !inst
->init()) {
429 inst
->owningTask
= owningTask
;
434 bool IOGraphicsEngineClient::start( IOService
* _owner
)
437 static const IOExternalMethod methodTemplate
[] = {
438 /* 0 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 3, 1 },
439 /* 1 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 2, 2 },
440 /* 2 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 3, 2 },
441 /* 3 */ { NULL
, NULL
, kIOUCScalarIScalarO
, 1, 0 },
444 IOGraphicsEngineContext
* mem
;
447 if( !super::start( _owner
))
450 owner
= (IOFramebuffer
*) _owner
;
451 agpDev
= OSDynamicCast( IOAGPDevice
, owner
->getProvider());
452 descriptors
= OSArray::withCapacity( 1 );
454 bcopy( methodTemplate
, externals
, sizeof( methodTemplate
));
456 externals
[0].object
= this;
457 externals
[0].func
= (IOMethod
) &IOGraphicsEngineClient::addUserRange
;
458 externals
[1].object
= this;
459 externals
[1].func
= (IOMethod
) &IOGraphicsEngineClient::createAGPSpace
;
460 externals
[2].object
= this;
461 externals
[2].func
= (IOMethod
) &IOGraphicsEngineClient::commitAGPMemory
;
462 externals
[3].object
= this;
463 externals
[3].func
= (IOMethod
) &IOGraphicsEngineClient::releaseAGPMemory
;
465 if( 0 == owner
->engineContext
) {
467 size
= round_page( sizeof( IOGraphicsEngineContext
));
468 owner
->engineContext
= IOBufferMemoryDescriptor::withCapacity(
469 size
, kIODirectionNone
, false );
470 if( !owner
->engineContext
)
471 return( kIOReturnNoMemory
);
472 owner
->engineContext
->setLength( size
);
474 mem
= (IOGraphicsEngineContext
*)
475 owner
->engineContext
->getBytesNoCopy();
476 memset((char *)mem
, 0, size
);
477 mem
->version
= kIOGraphicsEngineContextVersion
;
478 mem
->structSize
= size
;
484 void IOGraphicsEngineClient::free()
489 if( agpDev
&& haveAGP
)
490 agpDev
->destroyAGPSpace();
495 IOReturn
IOGraphicsEngineClient::clientClose( void )
499 return( kIOReturnSuccess
);
502 IOService
* IOGraphicsEngineClient::getService( void )
507 IOReturn
IOGraphicsEngineClient::clientMemoryForType( UInt32 type
,
508 IOOptionBits
* options
, IOMemoryDescriptor
** memory
)
510 IOMemoryDescriptor
* mem
;
513 case kIOGraphicsEngineContext
:
514 mem
= owner
->engineContext
;
517 mem
= (IOMemoryDescriptor
*) owner
->engineAccessRanges
->getObject( type
);
524 return( kIOReturnSuccess
);
526 return( kIOReturnBadArgument
);
529 IOExternalMethod
* IOGraphicsEngineClient::getExternalMethodForIndex( UInt32 index
)
531 if( index
< (sizeof( externals
) / sizeof( externals
[0])))
532 return( externals
+ index
);
537 IOReturn
IOGraphicsEngineClient::addUserRange( vm_address_t start
,
538 vm_size_t length
, UInt32 apertureIndex
, IOPhysicalAddress
* phys
)
540 IODeviceMemory
* mem
;
541 IOReturn err
= kIOReturnSuccess
;
544 IODeviceMemory
* aperture
545 = owner
->getProvider()->getDeviceMemoryWithIndex( apertureIndex
);
548 return( kIOReturnBadArgument
);
550 ranges
= owner
->engineAccessRanges
;
552 while( (mem
= (IODeviceMemory
*) ranges
->getObject( i
++ ))) {
553 if( (mem
->getPhysicalAddress() ==
554 (start
+ aperture
->getPhysicalAddress()))
555 && (length
<= mem
->getLength()) )
560 mem
= IODeviceMemory::withSubRange(
561 aperture
, start
, length
);
563 owner
->engineAccessRanges
->setObject( mem
);
564 err
= kIOReturnSuccess
;
566 err
= kIOReturnNoResources
;
569 if( kIOReturnSuccess
== err
)
570 *phys
= mem
->getPhysicalAddress();
575 IOReturn
IOGraphicsEngineClient::createAGPSpace( IOOptionBits options
,
576 IOPhysicalLength length
,
577 IOPhysicalAddress
* address
,
578 IOPhysicalLength
* lengthOut
)
583 return( kIOReturnUnsupported
);
586 err
= agpDev
->createAGPSpace( options
, address
, lengthOut
);
587 haveAGP
= (kIOReturnSuccess
== err
);
592 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
594 class _IOGraphicsClientMemory
: public OSObject
{
595 OSDeclareDefaultStructors(_IOGraphicsClientMemory
)
597 IOMemoryDescriptor
* memory
;
598 IOAGPDevice
* agpDev
;
599 IOByteCount agpOffset
;
605 OSDefineMetaClassAndStructors(_IOGraphicsClientMemory
, OSObject
)
607 bool _IOGraphicsClientMemory::init()
609 return( OSObject::init());
612 void _IOGraphicsClientMemory::free()
615 agpDev
->getAGPRangeAllocator()->deallocate( agpOffset
,
616 memory
->getLength() );
624 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
626 IOReturn
IOGraphicsEngineClient::commitAGPMemory( vm_address_t start
,
627 vm_size_t length
, IOOptionBits options
,
628 void ** ref
, IOByteCount
* offset
)
630 _IOGraphicsClientMemory
* graphicsMem
;
631 IORangeAllocator
* rangeAllocator
;
632 IOByteCount agpOffset
;
633 IOReturn err
= kIOReturnNoMemory
;
637 return( kIOReturnUnsupported
);
638 if( (!start
) || (!length
))
639 return( kIOReturnBadArgument
);
640 rangeAllocator
= agpDev
->getAGPRangeAllocator();
642 return( kIOReturnUnsupported
);
645 graphicsMem
= new _IOGraphicsClientMemory
;
646 if( (!graphicsMem
) || (!graphicsMem
->init()))
649 ok
= rangeAllocator
->allocate( length
, (IORangeScalar
*) &agpOffset
);
651 err
= kIOReturnNoSpace
;
655 graphicsMem
->agpDev
= agpDev
;
656 graphicsMem
->agpOffset
= agpOffset
;
658 graphicsMem
->memory
= IOMemoryDescriptor::withAddress( start
, length
,
659 kIODirectionOut
, owningTask
);
660 if( !graphicsMem
->memory
)
663 err
= graphicsMem
->memory
->prepare();
664 if( err
!= kIOReturnSuccess
)
667 err
= agpDev
->commitAGPMemory( graphicsMem
->memory
, agpOffset
);
668 if( err
!= kIOReturnSuccess
)
671 *ref
= (void *) descriptors
->getCount();
673 descriptors
->setObject( graphicsMem
);
678 graphicsMem
->release();
680 if( (kIOReturnSuccess
!= err
) && (!graphicsMem
))
681 rangeAllocator
->deallocate( agpOffset
, length
);
686 IOReturn
IOGraphicsEngineClient::releaseAGPMemory( void * ref
)
688 _IOGraphicsClientMemory
* graphicsMem
;
689 UInt32 index
= (UInt32
) ref
;
691 if( 0 == (graphicsMem
= (_IOGraphicsClientMemory
*)
692 descriptors
->getObject( index
)))
693 return( kIOReturnBadArgument
);
695 descriptors
->removeObject( index
);
697 return( kIOReturnSuccess
);
700 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
702 OSDefineMetaClassAndStructors(IOFramebufferSharedUserClient
, IOUserClient
)
704 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
706 IOFramebufferSharedUserClient
* IOFramebufferSharedUserClient::withTask(
709 IOFramebufferSharedUserClient
* inst
;
711 inst
= new IOFramebufferSharedUserClient
;
713 if( inst
&& !inst
->init()) {
721 bool IOFramebufferSharedUserClient::start( IOService
* _owner
)
724 static const IOExternalMethod methodTemplate
[] = {
727 if( !super::start( _owner
))
730 owner
= (IOFramebuffer
*) _owner
;
732 bcopy( methodTemplate
, externals
, sizeof( methodTemplate
));
737 void IOFramebufferSharedUserClient::free( void )
740 owner
->sharedConnect
= 0;
745 void IOFramebufferSharedUserClient::release() const
750 IOReturn
IOFramebufferSharedUserClient::clientClose( void )
752 return( kIOReturnSuccess
);
755 IOService
* IOFramebufferSharedUserClient::getService( void )
760 IOReturn
IOFramebufferSharedUserClient::clientMemoryForType( UInt32 type
,
761 IOOptionBits
* options
, IOMemoryDescriptor
** memory
)
763 IOMemoryDescriptor
* mem
= 0;
768 case kIOFBCursorMemory
:
769 mem
= owner
->sharedCursor
;
771 *options
= kIOMapReadOnly
;
774 case kIOFBVRAMMemory
:
775 mem
= owner
->getVRAMRange();
781 err
= kIOReturnSuccess
;
783 err
= kIOReturnBadArgument
;
788 IOReturn
IOFramebufferSharedUserClient::getNotificationSemaphore(
789 UInt32 interruptType
, semaphore_t
* semaphore
)
791 return( owner
->getNotificationSemaphore(interruptType
, semaphore
) );
794 IOExternalMethod
* IOFramebufferSharedUserClient::getExternalMethodForIndex( UInt32 index
)
796 if( index
< (sizeof( externals
) / sizeof( externals
[0])))
797 return( externals
+ index
);