xref: /haiku/src/add-ons/accelerants/intel_extreme/hooks.cpp (revision 0c93c0a807b27096abbfad677436afb7d1712d4a)
1 /*
2  * Copyright 2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Axel Dörfler, axeld@pinc-software.de
7  */
8 
9 
10 #include "accelerant_protos.h"
11 #include "accelerant.h"
12 
13 
14 extern "C" void *
15 get_accelerant_hook(uint32 feature, void *data)
16 {
17 	switch (feature) {
18 		/* general */
19 		case B_INIT_ACCELERANT:
20 			return (void*)intel_init_accelerant;
21 		case B_UNINIT_ACCELERANT:
22 			return (void*)intel_uninit_accelerant;
23 		case B_CLONE_ACCELERANT:
24 			return (void*)intel_clone_accelerant;
25 		case B_ACCELERANT_CLONE_INFO_SIZE:
26 			return (void*)intel_accelerant_clone_info_size;
27 		case B_GET_ACCELERANT_CLONE_INFO:
28 			return (void*)intel_get_accelerant_clone_info;
29 		case B_GET_ACCELERANT_DEVICE_INFO:
30 			return (void*)intel_get_accelerant_device_info;
31 		case B_ACCELERANT_RETRACE_SEMAPHORE:
32 			return (void*)intel_accelerant_retrace_semaphore;
33 
34 		/* mode configuration */
35 		case B_ACCELERANT_MODE_COUNT:
36 			return (void*)intel_accelerant_mode_count;
37 		case B_GET_MODE_LIST:
38 			return (void*)intel_get_mode_list;
39 		case B_PROPOSE_DISPLAY_MODE:
40 			return (void*)intel_propose_display_mode;
41 		case B_SET_DISPLAY_MODE:
42 			return (void*)intel_set_display_mode;
43 		case B_GET_DISPLAY_MODE:
44 			return (void*)intel_get_display_mode;
45 		case B_GET_FRAME_BUFFER_CONFIG:
46 			return (void*)intel_get_frame_buffer_config;
47 		case B_GET_PIXEL_CLOCK_LIMITS:
48 			return (void*)intel_get_pixel_clock_limits;
49 		case B_MOVE_DISPLAY:
50 			return (void*)intel_move_display;
51 		case B_SET_INDEXED_COLORS:
52 			return (void*)intel_set_indexed_colors;
53 		case B_GET_TIMING_CONSTRAINTS:
54 			return (void*)intel_get_timing_constraints;
55 
56 		/* DPMS */
57 		case B_DPMS_CAPABILITIES:
58 			return (void*)intel_dpms_capabilities;
59 		case B_DPMS_MODE:
60 			return (void*)intel_dpms_mode;
61 		case B_SET_DPMS_MODE:
62 			return (void*)intel_set_dpms_mode;
63 
64 		/* cursor managment */
65 		case B_SET_CURSOR_SHAPE:
66 			if (gInfo->cursor_memory != NULL)
67 				return (void*)intel_set_cursor_shape;
68 		case B_MOVE_CURSOR:
69 			if (gInfo->cursor_memory != NULL)
70 				return (void*)intel_move_cursor;
71 		case B_SHOW_CURSOR:
72 			if (gInfo->cursor_memory != NULL)
73 				return (void*)intel_show_cursor;
74 
75 			return NULL;
76 
77 		/* engine/synchronization */
78 		case B_ACCELERANT_ENGINE_COUNT:
79 			return (void*)intel_accelerant_engine_count;
80 		case B_ACQUIRE_ENGINE:
81 			return (void*)intel_acquire_engine;
82 		case B_RELEASE_ENGINE:
83 			return (void*)intel_release_engine;
84 		case B_WAIT_ENGINE_IDLE:
85 			return (void*)intel_wait_engine_idle;
86 		case B_GET_SYNC_TOKEN:
87 			return (void*)intel_get_sync_token;
88 		case B_SYNC_TO_TOKEN:
89 			return (void*)intel_sync_to_token;
90 
91 		/* 2D acceleration */
92 		case B_SCREEN_TO_SCREEN_BLIT:
93 			return (void*)intel_screen_to_screen_blit;
94 		case B_FILL_RECTANGLE:
95 			return (void*)intel_fill_rectangle;
96 		case B_INVERT_RECTANGLE:
97 			return (void*)intel_invert_rectangle;
98 		case B_FILL_SPAN:
99 			return NULL;//(void*)intel_fill_span;
100 
101 		// overlay
102 		case B_OVERLAY_COUNT:
103 			return (void*)intel_overlay_supported_spaces;
104 		case B_OVERLAY_SUPPORTED_SPACES:
105 			return (void*)intel_overlay_supported_spaces;
106 		case B_OVERLAY_SUPPORTED_FEATURES:
107 			return (void*)intel_overlay_supported_features;
108 		case B_ALLOCATE_OVERLAY_BUFFER:
109 			return (void*)intel_allocate_overlay_buffer;
110 		case B_RELEASE_OVERLAY_BUFFER:
111 			return (void*)intel_release_overlay_buffer;
112 		case B_GET_OVERLAY_CONSTRAINTS:
113 			return (void*)intel_get_overlay_constraints;
114 		case B_ALLOCATE_OVERLAY:
115 			return (void*)intel_allocate_overlay;
116 		case B_RELEASE_OVERLAY:
117 			return (void*)intel_release_overlay;
118 		case B_CONFIGURE_OVERLAY:
119 			return (void*)intel_configure_overlay;
120 	}
121 
122 	return NULL;
123 }
124 
125