xref: /haiku/src/add-ons/accelerants/radeon_hd/hooks.cpp (revision 68ea01249e1e2088933cb12f9c28d4e5c5d1c9ef)
1 /*
2  * Copyright 2006-2009, 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  *		Alexander von Gluck IV, kallisti5@unixzen.com
8  */
9 
10 
11 #include "accelerant.h"
12 #include "accelerant_protos.h"
13 
14 
15 extern "C" void*
16 get_accelerant_hook(uint32 feature, void* data)
17 {
18 	switch (feature) {
19 		/* general */
20 		case B_INIT_ACCELERANT:
21 			return (void*)radeon_init_accelerant;
22 		case B_UNINIT_ACCELERANT:
23 			return (void*)radeon_uninit_accelerant;
24 		/*case B_CLONE_ACCELERANT:
25 			return (void*)radeon_clone_accelerant;
26 		case B_ACCELERANT_CLONE_INFO_SIZE:
27 			return (void*)radeon_accelerant_clone_info_size;
28 		case B_GET_ACCELERANT_CLONE_INFO:
29 			return (void*)radeon_get_accelerant_clone_info;
30 		case B_ACCELERANT_RETRACE_SEMAPHORE:
31 			return (void*)radeon_accelerant_retrace_semaphore;
32 		*/
33 		case B_GET_ACCELERANT_DEVICE_INFO:
34 			return (void*)radeon_get_accelerant_device_info;
35 
36 		/* DPMS */
37 		case B_DPMS_CAPABILITIES:
38 			return (void*)radeon_dpms_capabilities;
39 		case B_DPMS_MODE:
40 			return (void*)radeon_dpms_mode;
41 		case B_SET_DPMS_MODE:
42 			return (void*)radeon_dpms_set_hook;
43 
44 		/* mode configuration */
45 		case B_ACCELERANT_MODE_COUNT:
46 			return (void*)radeon_accelerant_mode_count;
47 		case B_GET_EDID_INFO:
48 			return (void*)radeon_get_edid_info;
49 		case B_GET_MODE_LIST:
50 			return (void*)radeon_get_mode_list;
51 		case B_GET_PREFERRED_DISPLAY_MODE:
52 			return (void*)radeon_get_preferred_mode;
53 		case B_SET_DISPLAY_MODE:
54 			return (void*)radeon_set_display_mode;
55 		case B_GET_DISPLAY_MODE:
56 			return (void*)radeon_get_display_mode;
57 
58 		/* memory controller */
59 		case B_GET_FRAME_BUFFER_CONFIG:
60 			return (void*)radeon_get_frame_buffer_config;
61 		case B_GET_PIXEL_CLOCK_LIMITS:
62 			return (void*)radeon_get_pixel_clock_limits;
63 
64 		/* engine */
65 		case B_ACCELERANT_ENGINE_COUNT:
66 			return (void*)radeon_accelerant_engine_count;
67 		case B_ACQUIRE_ENGINE:
68 			return (void*)radeon_acquire_engine;
69 		case B_RELEASE_ENGINE:
70 			return (void*)radeon_release_engine;
71 
72 		/* 2D acceleration */
73 		/*
74 		case B_SCREEN_TO_SCREEN_BLIT:
75 			return (void*)radeon_screen_to_screen_blit;
76 		case B_FILL_RECTANGLE:
77 			return (void*)radeon_fill_rectangle;
78 		case B_INVERT_RECTANGLE:
79 			return (void*)radeon_invert_rectangle;
80 		case B_FILL_SPAN:
81 			return (void*)radeon_fill_span;
82 		*/
83 	}
84 
85 	return NULL;
86 }
87 
88