1/*
2 * Copyright (c) 1999-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#ifndef _IOKIT_IOGRAPHICSINTERFACE_H
24#define _IOKIT_IOGRAPHICSINTERFACE_H
25
26#ifdef KERNEL
27#define NO_CFPLUGIN     1
28#endif
29
30#ifndef NO_CFPLUGIN
31#include <IOKit/IOCFPlugIn.h>
32#endif /* ! NO_CFPLUGIN */
33
34#define IOGA_COMPAT     1
35
36#include <IOKit/graphics/IOGraphicsInterfaceTypes.h>
37
38#define kIOGraphicsAcceleratorTypeID                    \
39        (CFUUIDGetConstantUUIDWithBytes(NULL,           \
40                                0xAC, 0xCF, 0x00, 0x00, \
41                                0x00, 0x00,             \
42                                0x00, 0x00,             \
43                                0x00, 0x00,             \
44                                0x00, 0x0a, 0x27, 0x89, 0x90, 0x4e))
45
46// IOGraphicsAcceleratorType objects must implement the
47// IOGraphicsAcceleratorInterface
48
49#define kIOGraphicsAcceleratorInterfaceID               \
50        (CFUUIDGetConstantUUIDWithBytes(NULL,           \
51                                0x67, 0x66, 0xE9, 0x4A, \
52                                0x00, 0x00,             \
53                                0x00, 0x00,             \
54                                0x00, 0x00,             \
55                                0x00, 0x0a, 0x27, 0x89, 0x90, 0x4e))
56
57/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
58
59typedef
60IOReturn (*IOBlitAccumulatePtr)(void *thisPointer,
61                                SInt32 a, SInt32 b, SInt32 c,
62                                SInt32 d, SInt32 e, SInt32 f );
63
64#ifdef IOGA_COMPAT
65typedef
66IOReturn (*IOBlitProcPtr)(void *thisPointer,
67                          IOOptionBits options,
68                          IOBlitType type, IOBlitSourceDestType sourceDestType,
69                          IOBlitOperation * operation,
70                          void * source, void * destination,
71                          IOBlitCompletionToken * completionToken );
72#endif
73
74typedef
75IOReturn (*IOBlitterPtr)(void *thisPointer,
76                          IOOptionBits options,
77                          IOBlitType type, IOBlitSourceType sourceType,
78                          IOBlitOperation * operation,
79                          void * source );
80
81/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
82
83#ifndef NO_CFPLUGIN
84
85typedef struct IOGraphicsAcceleratorInterfaceStruct {
86    IUNKNOWN_C_GUTS;
87    IOCFPLUGINBASE;
88
89    IOReturn (*Reset)
90        (void *thisPointer, IOOptionBits options);
91    IOReturn (*CopyCapabilities)
92        (void *thisPointer, FourCharCode select, CFTypeRef * capabilities);
93#ifdef IOGA_COMPAT
94    IOReturn (*GetBlitProc)
95        (void *thisPointer, IOOptionBits options,
96         IOBlitType type, IOBlitSourceDestType sourceDestType,
97         IOBlitProcPtr * blitProc );
98#else
99    void * __gaInterfaceReserved0;
100#endif
101
102    IOReturn (*Flush)
103        (void *thisPointer, IOOptionBits options);
104#ifdef IOGA_COMPAT
105    IOReturn (*WaitForCompletion)
106        (void *thisPointer, IOOptionBits options,
107         IOBlitCompletionToken completionToken);
108#else
109    void * __gaInterfaceReserved1;
110#endif
111    IOReturn (*Synchronize)
112        (void *thisPointer, UInt32 options,
113         UInt32 x, UInt32 y, UInt32 w, UInt32 h );
114    IOReturn (*GetBeamPosition)
115        (void *thisPointer, IOOptionBits options, SInt32 * position);
116    IOReturn (*AllocateSurface)
117        (void *thisPointer, IOOptionBits options,
118         IOBlitSurface * surface, void * cgsSurfaceID );
119    IOReturn (*FreeSurface)
120        (void *thisPointer, IOOptionBits options, IOBlitSurface * surface);
121    IOReturn (*LockSurface)
122        (void *thisPointer, IOOptionBits options, IOBlitSurface * surface,
123         vm_address_t * address );
124    IOReturn (*UnlockSurface)
125        (void *thisPointer, IOOptionBits options, IOBlitSurface * surface,
126         IOOptionBits * swapFlags);
127    IOReturn (*SwapSurface)
128        (void *thisPointer, IOOptionBits options,
129         IOBlitSurface * surface, IOOptionBits * swapFlags);
130
131    IOReturn (*SetDestination)
132        (void *thisPointer, IOOptionBits options, IOBlitSurface * surface );
133
134    IOReturn (*GetBlitter)
135        (void *thisPointer, IOOptionBits options,
136         IOBlitType type, IOBlitSourceType sourceType,
137         IOBlitterPtr * blitter );
138    IOReturn (*WaitComplete)
139        (void *thisPointer, IOOptionBits options);
140
141    void * __gaInterfaceReserved[ 24 ];
142
143} IOGraphicsAcceleratorInterface;
144
145#endif /* ! NO_CFPLUGIN */
146
147/* Helper function for plugin use */
148IOReturn IOAccelFindAccelerator( io_service_t framebuffer,
149                                 io_service_t * pAccelerator, UInt32 * pFramebufferIndex );
150
151/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
152
153#endif /* !_IOKIT_IOGRAPHICSINTERFACE_H */
154