xref: /haiku/src/add-ons/accelerants/vesa/hooks.cpp (revision d3d8b26997fac34a84981e6d2b649521de2cc45a)
1 /*
2  * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "accelerant_protos.h"
8 
9 
10 // ToDo: these are some temporary dummy functions to see if this helps with our current app_server
11 
12 status_t
13 vesa_set_cursor_shape(uint16 width, uint16 height, uint16 hot_x, uint16 hot_y, uint8 *andMask, uint8 *xorMask)
14 {
15 	return B_OK;
16 }
17 
18 
19 void
20 vesa_move_cursor(uint16 x, uint16 y)
21 {
22 }
23 
24 
25 void
26 vesa_show_cursor(bool is_visible)
27 {
28 }
29 
30 
31 extern "C" void *
32 get_accelerant_hook(uint32 feature, void *data)
33 {
34 	switch (feature) {
35 		/* general */
36 		case B_INIT_ACCELERANT:
37 			return (void*)vesa_init_accelerant;
38 		case B_UNINIT_ACCELERANT:
39 			return (void*)vesa_uninit_accelerant;
40 		case B_CLONE_ACCELERANT:
41 			return (void*)vesa_clone_accelerant;
42 		case B_ACCELERANT_CLONE_INFO_SIZE:
43 			return (void*)vesa_accelerant_clone_info_size;
44 		case B_GET_ACCELERANT_CLONE_INFO:
45 			return (void*)vesa_get_accelerant_clone_info;
46 		case B_GET_ACCELERANT_DEVICE_INFO:
47 			return (void*)vesa_get_accelerant_device_info;
48 		case B_ACCELERANT_RETRACE_SEMAPHORE:
49 			return (void*)vesa_accelerant_retrace_semaphore;
50 
51 		/* mode configuration */
52 		case B_ACCELERANT_MODE_COUNT:
53 			return (void*)vesa_accelerant_mode_count;
54 		case B_GET_MODE_LIST:
55 			return (void*)vesa_get_mode_list;
56 		case B_PROPOSE_DISPLAY_MODE:
57 			return (void*)vesa_propose_display_mode;
58 		case B_SET_DISPLAY_MODE:
59 			return (void*)vesa_set_display_mode;
60 		case B_GET_DISPLAY_MODE:
61 			return (void*)vesa_get_display_mode;
62 		case B_GET_FRAME_BUFFER_CONFIG:
63 			return (void*)vesa_get_frame_buffer_config;
64 		case B_GET_PIXEL_CLOCK_LIMITS:
65 			return (void*)vesa_get_pixel_clock_limits;
66 		case B_MOVE_DISPLAY:
67 			return (void*)vesa_move_display;
68 		case B_SET_INDEXED_COLORS:
69 			return (void*)vesa_set_indexed_colors;
70 		case B_GET_TIMING_CONSTRAINTS:
71 			return (void*)vesa_get_timing_constraints;
72 
73 		/* DPMS */
74 		case B_DPMS_CAPABILITIES:
75 			return (void*)vesa_dpms_capabilities;
76 		case B_DPMS_MODE:
77 			return (void*)vesa_dpms_mode;
78 		case B_SET_DPMS_MODE:
79 			return (void*)vesa_set_dpms_mode;
80 
81 		/* cursor managment */
82 		case B_SET_CURSOR_SHAPE:
83 			return (void*)vesa_set_cursor_shape;
84 		case B_MOVE_CURSOR:
85 			return (void*)vesa_move_cursor;
86 		case B_SHOW_CURSOR:
87 			return (void*)vesa_show_cursor;
88 
89 		/* engine/synchronization */
90 		case B_ACCELERANT_ENGINE_COUNT:
91 			return (void*)vesa_accelerant_engine_count;
92 		case B_ACQUIRE_ENGINE:
93 			return (void*)vesa_acquire_engine;
94 		case B_RELEASE_ENGINE:
95 			return (void*)vesa_release_engine;
96 		case B_WAIT_ENGINE_IDLE:
97 			return (void*)vesa_wait_engine_idle;
98 		case B_GET_SYNC_TOKEN:
99 			return (void*)vesa_get_sync_token;
100 		case B_SYNC_TO_TOKEN:
101 			return (void*)vesa_sync_to_token;
102 	}
103 
104 	return NULL;
105 }
106 
107