1 /* 2 Copyright 2008 Haiku, Inc. All rights reserved. 3 Distributed under the terms of the MIT license. 4 5 Authors: 6 Gerald Zajac 2008 7 */ 8 9 #include "accel.h" 10 11 12 extern "C" void* 13 get_accelerant_hook(uint32 feature, void* data) 14 { 15 (void)data; // avoid compiler warning for unused arg 16 17 switch (feature) { 18 // General 19 case B_INIT_ACCELERANT: return (void*)InitAccelerant; 20 case B_UNINIT_ACCELERANT: return (void*)UninitAccelerant; 21 case B_CLONE_ACCELERANT: return (void*)CloneAccelerant; 22 case B_ACCELERANT_CLONE_INFO_SIZE: return (void*)AccelerantCloneInfoSize; 23 case B_GET_ACCELERANT_CLONE_INFO: return (void*)GetAccelerantCloneInfo; 24 case B_GET_ACCELERANT_DEVICE_INFO: return (void*)GetAccelerantDeviceInfo; 25 case B_ACCELERANT_RETRACE_SEMAPHORE: return (void*)AccelerantRetraceSemaphore; 26 27 // Mode Configuration 28 case B_ACCELERANT_MODE_COUNT: return (void*)AccelerantModeCount; 29 case B_GET_MODE_LIST: return (void*)GetModeList; 30 case B_PROPOSE_DISPLAY_MODE: return (void*)ProposeDisplayMode; 31 case B_SET_DISPLAY_MODE: return (void*)SetDisplayMode; 32 case B_GET_DISPLAY_MODE: return (void*)GetDisplayMode; 33 #ifdef __HAIKU__ 34 case B_GET_PREFERRED_DISPLAY_MODE: return (void*)GetPreferredDisplayMode; 35 case B_GET_EDID_INFO: return (void*)GetEdidInfo; 36 #endif 37 case B_GET_FRAME_BUFFER_CONFIG: return (void*)GetFrameBufferConfig; 38 case B_GET_PIXEL_CLOCK_LIMITS: return (void*)GetPixelClockLimits; 39 case B_MOVE_DISPLAY: return (void*)MoveDisplay; 40 case B_SET_INDEXED_COLORS: return (void*)(gInfo.SetIndexedColors); 41 case B_GET_TIMING_CONSTRAINTS: return (void*)GetTimingConstraints; 42 43 // DPMS 44 case B_DPMS_CAPABILITIES: return (void*)(gInfo.DPMSCapabilities); 45 case B_DPMS_MODE: return (void*)(gInfo.DPMSMode); 46 case B_SET_DPMS_MODE: return (void*)(gInfo.SetDPMSMode); 47 48 // Cursor 49 case B_SET_CURSOR_SHAPE: return (void*)SetCursorShape; 50 case B_MOVE_CURSOR: return (void*)MoveCursor; 51 case B_SHOW_CURSOR: return (void*)(gInfo.ShowCursor); 52 53 // Engine Management 54 case B_ACCELERANT_ENGINE_COUNT: return (void*)AccelerantEngineCount; 55 case B_ACQUIRE_ENGINE: return (void*)AcquireEngine; 56 case B_RELEASE_ENGINE: return (void*)ReleaseEngine; 57 case B_WAIT_ENGINE_IDLE: return (void*)WaitEngineIdle; 58 case B_GET_SYNC_TOKEN: return (void*)GetSyncToken; 59 case B_SYNC_TO_TOKEN: return (void*)SyncToToken; 60 61 // 2D acceleration 62 case B_SCREEN_TO_SCREEN_BLIT: return (void*)(gInfo.ScreenToScreenBlit); 63 case B_FILL_RECTANGLE: return (void*)(gInfo.FillRectangle); 64 case B_INVERT_RECTANGLE: return (void*)(gInfo.InvertRectangle); 65 case B_FILL_SPAN: return (void*)(gInfo.FillSpan); 66 } 67 68 return NULL; // Return null pointer for any feature not handled above 69 } 70