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
24#ifndef _IOKIT_IOFRAMEBUFFERUSERCLIENT_H
25#define _IOKIT_IOFRAMEBUFFERUSERCLIENT_H
26
27#include <IOKit/IOUserClient.h>
28#include <IOKit/graphics/IOFramebuffer.h>
29#include <IOKit/pci/IOAGPDevice.h>
30
31/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
32
33class IOFramebufferUserClient : public IOUserClient
34{
35    OSDeclareDefaultStructors(IOFramebufferUserClient)
36
37public:
38    IOFramebuffer *     owner;
39    IOFramebuffer *     other;
40
41    // IOUserClient methods
42    virtual IOReturn clientClose( void );
43
44    virtual IOService * getService( void );
45
46    virtual IOReturn clientMemoryForType( UInt32 type,
47        IOOptionBits * options, IOMemoryDescriptor ** memory );
48
49    virtual IOReturn externalMethod( uint32_t selector, IOExternalMethodArguments * args,
50                                        IOExternalMethodDispatch * dispatch, OSObject * target, void * reference );
51
52    virtual IOReturn registerNotificationPort( mach_port_t, UInt32, UInt32 );
53    virtual IOReturn getNotificationSemaphore( UInt32 interruptType,
54                                               semaphore_t * semaphore );
55
56    virtual IOReturn connectClient( IOUserClient * other );
57
58    // others
59
60    static IOFramebufferUserClient * withTask( task_t owningTask );
61
62    virtual bool start( IOService * provider );
63    virtual IOReturn setProperties( OSObject * properties );
64};
65
66/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
67
68class IOFramebufferSharedUserClient : public IOUserClient
69{
70    OSDeclareDefaultStructors(IOFramebufferSharedUserClient)
71
72private:
73
74    IOFramebuffer *      owner;
75
76public:
77    virtual void free();
78    virtual void release() const;
79
80    // IOUserClient methods
81    virtual IOReturn clientClose( void );
82
83    virtual IOService * getService( void );
84
85    virtual IOReturn clientMemoryForType( UInt32 type,
86        IOOptionBits * options, IOMemoryDescriptor ** memory );
87
88    virtual IOReturn getNotificationSemaphore( UInt32 notification_type,
89                                    semaphore_t * semaphore );
90
91    // others
92    static IOFramebufferSharedUserClient * withTask( task_t owningTask );
93    virtual bool start( IOService * provider );
94};
95
96
97#endif /* ! _IOKIT_IOFRAMEBUFFERUSERCLIENT_H */
98