1/* 2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23 24#ifndef _IOACCEL_SURFACE_CONTROL_H 25#define _IOACCEL_SURFACE_CONTROL_H 26 27#include <IOKit/graphics/IOAccelSurfaceConnect.h> 28 29#define IOACCEL_SURFACE_CONTROL_REV 8 30 31typedef struct IOAccelConnectStruct *IOAccelConnect; 32 33 34/* Create an accelerated surface and attach it to a CGS surface */ 35IOReturn IOAccelCreateSurface( io_service_t service, UInt32 wid, eIOAccelSurfaceModeBits modebits, IOAccelConnect *connect ); 36 37/* Fix surface size & scaling */ 38IOReturn IOAccelSetSurfaceScale( IOAccelConnect connect, IOOptionBits options, 39 IOAccelSurfaceScaling * scaling, UInt32 scalingSize ); 40 41/* Detach an an accelerated surface from a CGS surface and destroy it*/ 42IOReturn IOAccelDestroySurface( IOAccelConnect connect ); 43 44/* Change the visible region of the accelerated surface */ 45IOReturn IOAccelSetSurfaceFramebufferShapeWithBacking( IOAccelConnect connect, IOAccelDeviceRegion *rgn, 46 eIOAccelSurfaceShapeBits options, UInt32 framebufferIndex, 47 IOVirtualAddress backing, UInt32 rowbytes ); 48 49IOReturn IOAccelSetSurfaceFramebufferShapeWithBackingAndLength( IOAccelConnect connect, IOAccelDeviceRegion *rgn, 50 eIOAccelSurfaceShapeBits options, UInt32 framebufferIndex, 51 IOVirtualAddress backing, UInt32 rowbytes, UInt32 backingLength ); 52 53IOReturn IOAccelSetSurfaceFramebufferShape( IOAccelConnect connect, IOAccelDeviceRegion *rgn, 54 eIOAccelSurfaceShapeBits options, UInt32 framebufferIndex ); 55 56/* Block until the last visible region change applied to an accelerated surface is complete */ 57IOReturn IOAccelWaitForSurface( IOAccelConnect connect ); 58 59/* Get the back buffer of the surface. Supplies client virtual address. */ 60 61IOReturn IOAccelWriteLockSurfaceWithOptions( IOAccelConnect connect, IOOptionBits options, 62 IOAccelSurfaceInformation * info, UInt32 infoSize ); 63IOReturn IOAccelWriteUnlockSurfaceWithOptions( IOAccelConnect connect, IOOptionBits options ); 64IOReturn IOAccelReadLockSurfaceWithOptions( IOAccelConnect connect, IOOptionBits options, 65 IOAccelSurfaceInformation * info, UInt32 infoSize ); 66IOReturn IOAccelReadUnlockSurfaceWithOptions( IOAccelConnect connect, IOOptionBits options ); 67 68IOReturn IOAccelQueryLockSurface( IOAccelConnect connect ); 69IOReturn IOAccelWriteLockSurface( IOAccelConnect connect, IOAccelSurfaceInformation * info, UInt32 infoSize ); 70IOReturn IOAccelWriteUnlockSurface( IOAccelConnect connect ); 71IOReturn IOAccelReadLockSurface( IOAccelConnect connect, IOAccelSurfaceInformation * info, UInt32 infoSize ); 72IOReturn IOAccelReadUnlockSurface( IOAccelConnect connect ); 73 74/* Flush surface to visible region */ 75IOReturn IOAccelFlushSurfaceOnFramebuffers( IOAccelConnect connect, IOOptionBits options, UInt32 framebufferMask ); 76 77 78/* Read surface back buffer */ 79IOReturn IOAccelReadSurface( IOAccelConnect connect, IOAccelSurfaceReadData * parameters ); 80 81IOReturn IOAccelCreateAccelID(IOOptionBits options, IOAccelID * identifier); 82IOReturn IOAccelDestroyAccelID(IOOptionBits options, IOAccelID identifier); 83 84IOReturn IOAccelSurfaceControl( IOAccelConnect connect, 85 UInt32 selector, UInt32 arg, UInt32 * result); 86 87#endif /* _IOACCEL_SURFACE_CONTROL_H */ 88 89