xref: /haiku/src/add-ons/accelerants/ati/hooks.cpp (revision 124cdd4f576b15760ed343fddb0d6bb8efcaee27)
180829ec8SRene Gollent /*
2*124cdd4fSRene Gollent 	Copyright 2008, 2011 Haiku, Inc.  All rights reserved.
380829ec8SRene Gollent 	Distributed under the terms of the MIT license.
480829ec8SRene Gollent 
580829ec8SRene Gollent 	Authors:
6*124cdd4fSRene Gollent 	Gerald Zajac
780829ec8SRene Gollent */
880829ec8SRene Gollent 
980829ec8SRene Gollent #include "accelerant.h"
1080829ec8SRene Gollent 
1180829ec8SRene Gollent 
1280829ec8SRene Gollent extern "C" void*
get_accelerant_hook(uint32 feature,void * data)1380829ec8SRene Gollent get_accelerant_hook(uint32 feature, void* data)
1480829ec8SRene Gollent {
1580829ec8SRene Gollent 	(void)data;		// avoid compiler warning for unused arg
1680829ec8SRene Gollent 
1780829ec8SRene Gollent 	switch (feature) {
1880829ec8SRene Gollent 		// General
19*124cdd4fSRene Gollent 		case B_INIT_ACCELERANT:
20*124cdd4fSRene Gollent 			return (void*)InitAccelerant;
21*124cdd4fSRene Gollent 		case B_UNINIT_ACCELERANT:
22*124cdd4fSRene Gollent 			return (void*)UninitAccelerant;
23*124cdd4fSRene Gollent 		case B_CLONE_ACCELERANT:
24*124cdd4fSRene Gollent 			return (void*)CloneAccelerant;
25*124cdd4fSRene Gollent 		case B_ACCELERANT_CLONE_INFO_SIZE:
26*124cdd4fSRene Gollent 			return (void*)AccelerantCloneInfoSize;
27*124cdd4fSRene Gollent 		case B_GET_ACCELERANT_CLONE_INFO:
28*124cdd4fSRene Gollent 			return (void*)GetAccelerantCloneInfo;
29*124cdd4fSRene Gollent 		case B_GET_ACCELERANT_DEVICE_INFO:
30*124cdd4fSRene Gollent 			return (void*)GetAccelerantDeviceInfo;
31*124cdd4fSRene Gollent 		case B_ACCELERANT_RETRACE_SEMAPHORE:
32*124cdd4fSRene Gollent 			return (void*)AccelerantRetraceSemaphore;
3380829ec8SRene Gollent 
3480829ec8SRene Gollent 		// Mode Configuration
35*124cdd4fSRene Gollent 		case B_ACCELERANT_MODE_COUNT:
36*124cdd4fSRene Gollent 			return (void*)AccelerantModeCount;
37*124cdd4fSRene Gollent 		case B_GET_MODE_LIST:
38*124cdd4fSRene Gollent 			return (void*)GetModeList;
39*124cdd4fSRene Gollent 		case B_PROPOSE_DISPLAY_MODE:
40*124cdd4fSRene Gollent 			return (void*)ProposeDisplayMode;
41*124cdd4fSRene Gollent 		case B_SET_DISPLAY_MODE:
42*124cdd4fSRene Gollent 			return (void*)SetDisplayMode;
43*124cdd4fSRene Gollent 		case B_GET_DISPLAY_MODE:
44*124cdd4fSRene Gollent 			return (void*)GetDisplayMode;
45*124cdd4fSRene Gollent 		case B_GET_PREFERRED_DISPLAY_MODE:
46*124cdd4fSRene Gollent 			return (void*)GetPreferredDisplayMode;
47*124cdd4fSRene Gollent 		case B_GET_EDID_INFO:
48*124cdd4fSRene Gollent 			return (void*)GetEdidInfo;
49*124cdd4fSRene Gollent 		case B_GET_FRAME_BUFFER_CONFIG:
50*124cdd4fSRene Gollent 			return (void*)GetFrameBufferConfig;
51*124cdd4fSRene Gollent 		case B_GET_PIXEL_CLOCK_LIMITS:
52*124cdd4fSRene Gollent 			return (void*)GetPixelClockLimits;
53*124cdd4fSRene Gollent 		case B_MOVE_DISPLAY:
54*124cdd4fSRene Gollent 			return (void*)MoveDisplay;
55*124cdd4fSRene Gollent 		case B_SET_INDEXED_COLORS:
56*124cdd4fSRene Gollent 			return (void*)(gInfo.SetIndexedColors);
57*124cdd4fSRene Gollent 		case B_GET_TIMING_CONSTRAINTS:
58*124cdd4fSRene Gollent 			return (void*)GetTimingConstraints;
5980829ec8SRene Gollent 
6080829ec8SRene Gollent 		// DPMS
61*124cdd4fSRene Gollent 		case B_DPMS_CAPABILITIES:
62*124cdd4fSRene Gollent 			return (void*)(gInfo.DPMSCapabilities);
63*124cdd4fSRene Gollent 		case B_DPMS_MODE:
64*124cdd4fSRene Gollent 			return (void*)(gInfo.GetDPMSMode);
65*124cdd4fSRene Gollent 		case B_SET_DPMS_MODE:
66*124cdd4fSRene Gollent 			return (void*)(gInfo.SetDPMSMode);
6780829ec8SRene Gollent 
6880829ec8SRene Gollent 		// Cursor
69*124cdd4fSRene Gollent 		case B_SET_CURSOR_SHAPE:
70*124cdd4fSRene Gollent 			return (void*)SetCursorShape;
71*124cdd4fSRene Gollent 		case B_MOVE_CURSOR:
72*124cdd4fSRene Gollent 			return (void*)MoveCursor;
73*124cdd4fSRene Gollent 		case B_SHOW_CURSOR:
74*124cdd4fSRene Gollent 			return (void*)(gInfo.ShowCursor);
7580829ec8SRene Gollent 
7680829ec8SRene Gollent 		// Engine Management
77*124cdd4fSRene Gollent 		case B_ACCELERANT_ENGINE_COUNT:
78*124cdd4fSRene Gollent 			return (void*)AccelerantEngineCount;
79*124cdd4fSRene Gollent 		case B_ACQUIRE_ENGINE:
80*124cdd4fSRene Gollent 			return (void*)AcquireEngine;
81*124cdd4fSRene Gollent 		case B_RELEASE_ENGINE:
82*124cdd4fSRene Gollent 			return (void*)ReleaseEngine;
83*124cdd4fSRene Gollent 		case B_WAIT_ENGINE_IDLE:
84*124cdd4fSRene Gollent 			return (void*)WaitEngineIdle;
85*124cdd4fSRene Gollent 		case B_GET_SYNC_TOKEN:
86*124cdd4fSRene Gollent 			return (void*)GetSyncToken;
87*124cdd4fSRene Gollent 		case B_SYNC_TO_TOKEN:
88*124cdd4fSRene Gollent 			return (void*)SyncToToken;
8980829ec8SRene Gollent 
9080829ec8SRene Gollent 		// 2D acceleration
91*124cdd4fSRene Gollent 		case B_SCREEN_TO_SCREEN_BLIT:
92*124cdd4fSRene Gollent 			return (void*)(gInfo.ScreenToScreenBlit);
93*124cdd4fSRene Gollent 		case B_FILL_RECTANGLE:
94*124cdd4fSRene Gollent 			return (void*)(gInfo.FillRectangle);
95*124cdd4fSRene Gollent 		case B_INVERT_RECTANGLE:
96*124cdd4fSRene Gollent 			return (void*)(gInfo.InvertRectangle);
97*124cdd4fSRene Gollent 		case B_FILL_SPAN:
98*124cdd4fSRene Gollent 			return (void*)(gInfo.FillSpan);
99*124cdd4fSRene Gollent 
100*124cdd4fSRene Gollent 		// Overlay
101*124cdd4fSRene Gollent 		case B_OVERLAY_COUNT:
102*124cdd4fSRene Gollent 			return (void*)OverlayCount;
103*124cdd4fSRene Gollent 		case B_OVERLAY_SUPPORTED_SPACES:
104*124cdd4fSRene Gollent 			return (void*)OverlaySupportedSpaces;
105*124cdd4fSRene Gollent 		case B_OVERLAY_SUPPORTED_FEATURES:
106*124cdd4fSRene Gollent 			return (void*)OverlaySupportedFeatures;
107*124cdd4fSRene Gollent 		case B_ALLOCATE_OVERLAY_BUFFER:
108*124cdd4fSRene Gollent 			return (void*)AllocateOverlayBuffer;
109*124cdd4fSRene Gollent 		case B_RELEASE_OVERLAY_BUFFER:
110*124cdd4fSRene Gollent 			return (void*)ReleaseOverlayBuffer;
111*124cdd4fSRene Gollent 		case B_GET_OVERLAY_CONSTRAINTS:
112*124cdd4fSRene Gollent 			return (void*)GetOverlayConstraints;
113*124cdd4fSRene Gollent 		case B_ALLOCATE_OVERLAY:
114*124cdd4fSRene Gollent 			return (void*)AllocateOverlay;
115*124cdd4fSRene Gollent 		case B_RELEASE_OVERLAY:
116*124cdd4fSRene Gollent 			return (void*)ReleaseOverlay;
117*124cdd4fSRene Gollent 		case B_CONFIGURE_OVERLAY:
118*124cdd4fSRene Gollent 			return (void*)ConfigureOverlay;
11980829ec8SRene Gollent 	}
12080829ec8SRene Gollent 
12180829ec8SRene Gollent 	return NULL;	// Return null pointer for any feature not handled above
12280829ec8SRene Gollent }
123