xref: /haiku/src/add-ons/accelerants/radeon_hd/hooks.cpp (revision 46b7da1f4f40f7157d74fc7fb26ff9ec7f2416f2)
1a90ebd77SClemens Zeidler /*
2a90ebd77SClemens Zeidler  * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
3a90ebd77SClemens Zeidler  * Distributed under the terms of the MIT License.
4a90ebd77SClemens Zeidler  *
5a90ebd77SClemens Zeidler  * Authors:
6a90ebd77SClemens Zeidler  *		Axel Dörfler, axeld@pinc-software.de
7db528c00SAlexander von Gluck IV  *		Alexander von Gluck IV, kallisti5@unixzen.com
8a90ebd77SClemens Zeidler  */
9a90ebd77SClemens Zeidler 
10a90ebd77SClemens Zeidler 
11a90ebd77SClemens Zeidler #include "accelerant.h"
1261cf7133SAlexander von Gluck IV #include "accelerant_protos.h"
13a90ebd77SClemens Zeidler 
14a90ebd77SClemens Zeidler 
15a90ebd77SClemens Zeidler extern "C" void*
get_accelerant_hook(uint32 feature,void * data)16a90ebd77SClemens Zeidler get_accelerant_hook(uint32 feature, void* data)
17a90ebd77SClemens Zeidler {
18a90ebd77SClemens Zeidler 	switch (feature) {
19a90ebd77SClemens Zeidler 		/* general */
20a90ebd77SClemens Zeidler 		case B_INIT_ACCELERANT:
21a90ebd77SClemens Zeidler 			return (void*)radeon_init_accelerant;
22a90ebd77SClemens Zeidler 		case B_UNINIT_ACCELERANT:
23a90ebd77SClemens Zeidler 			return (void*)radeon_uninit_accelerant;
24a90ebd77SClemens Zeidler 		/*case B_CLONE_ACCELERANT:
25a90ebd77SClemens Zeidler 			return (void*)radeon_clone_accelerant;
26a90ebd77SClemens Zeidler 		case B_ACCELERANT_CLONE_INFO_SIZE:
27a90ebd77SClemens Zeidler 			return (void*)radeon_accelerant_clone_info_size;
28a90ebd77SClemens Zeidler 		case B_GET_ACCELERANT_CLONE_INFO:
29a90ebd77SClemens Zeidler 			return (void*)radeon_get_accelerant_clone_info;
30a90ebd77SClemens Zeidler 		case B_ACCELERANT_RETRACE_SEMAPHORE:
31a90ebd77SClemens Zeidler 			return (void*)radeon_accelerant_retrace_semaphore;
32a90ebd77SClemens Zeidler 		*/
33db528c00SAlexander von Gluck IV 		case B_GET_ACCELERANT_DEVICE_INFO:
34db528c00SAlexander von Gluck IV 			return (void*)radeon_get_accelerant_device_info;
356ab8261bSAlexander von Gluck IV 
36b54c8119SAlexander von Gluck IV 		/* DPMS */
37b54c8119SAlexander von Gluck IV 		case B_DPMS_CAPABILITIES:
38b54c8119SAlexander von Gluck IV 			return (void*)radeon_dpms_capabilities;
39b54c8119SAlexander von Gluck IV 		case B_DPMS_MODE:
40b54c8119SAlexander von Gluck IV 			return (void*)radeon_dpms_mode;
41b54c8119SAlexander von Gluck IV 		case B_SET_DPMS_MODE:
4200bc40adSAlexander von Gluck IV 			return (void*)radeon_dpms_set_hook;
43b54c8119SAlexander von Gluck IV 
44a90ebd77SClemens Zeidler 		/* mode configuration */
45a90ebd77SClemens Zeidler 		case B_ACCELERANT_MODE_COUNT:
46a90ebd77SClemens Zeidler 			return (void*)radeon_accelerant_mode_count;
47db528c00SAlexander von Gluck IV 		case B_GET_EDID_INFO:
48db528c00SAlexander von Gluck IV 			return (void*)radeon_get_edid_info;
49a90ebd77SClemens Zeidler 		case B_GET_MODE_LIST:
50a90ebd77SClemens Zeidler 			return (void*)radeon_get_mode_list;
514bd6c200SAlexander von Gluck IV 		case B_GET_PREFERRED_DISPLAY_MODE:
524bd6c200SAlexander von Gluck IV 			return (void*)radeon_get_preferred_mode;
53a90ebd77SClemens Zeidler 		case B_SET_DISPLAY_MODE:
54a90ebd77SClemens Zeidler 			return (void*)radeon_set_display_mode;
55a90ebd77SClemens Zeidler 		case B_GET_DISPLAY_MODE:
56a90ebd77SClemens Zeidler 			return (void*)radeon_get_display_mode;
57*69fdc6beSAnarchos 		case B_GET_BRIGHTNESS:
58*69fdc6beSAnarchos 			return (void*)radeon_get_brightness;
59*69fdc6beSAnarchos 		case B_SET_BRIGHTNESS:
60*69fdc6beSAnarchos 			return (void*)radeon_set_brightness;
61a90ebd77SClemens Zeidler 
62db528c00SAlexander von Gluck IV 		/* memory controller */
63a90ebd77SClemens Zeidler 		case B_GET_FRAME_BUFFER_CONFIG:
64a90ebd77SClemens Zeidler 			return (void*)radeon_get_frame_buffer_config;
65a90ebd77SClemens Zeidler 		case B_GET_PIXEL_CLOCK_LIMITS:
66a90ebd77SClemens Zeidler 			return (void*)radeon_get_pixel_clock_limits;
67a90ebd77SClemens Zeidler 
68db528c00SAlexander von Gluck IV 		/* engine */
69db528c00SAlexander von Gluck IV 		case B_ACCELERANT_ENGINE_COUNT:
70db528c00SAlexander von Gluck IV 			return (void*)radeon_accelerant_engine_count;
71a90ebd77SClemens Zeidler 		case B_ACQUIRE_ENGINE:
72a90ebd77SClemens Zeidler 			return (void*)radeon_acquire_engine;
73a90ebd77SClemens Zeidler 		case B_RELEASE_ENGINE:
74a90ebd77SClemens Zeidler 			return (void*)radeon_release_engine;
75db528c00SAlexander von Gluck IV 
76db528c00SAlexander von Gluck IV 		/* 2D acceleration */
77db528c00SAlexander von Gluck IV 		/*
78db528c00SAlexander von Gluck IV 		case B_SCREEN_TO_SCREEN_BLIT:
79db528c00SAlexander von Gluck IV 			return (void*)radeon_screen_to_screen_blit;
80db528c00SAlexander von Gluck IV 		case B_FILL_RECTANGLE:
81db528c00SAlexander von Gluck IV 			return (void*)radeon_fill_rectangle;
82db528c00SAlexander von Gluck IV 		case B_INVERT_RECTANGLE:
83db528c00SAlexander von Gluck IV 			return (void*)radeon_invert_rectangle;
84db528c00SAlexander von Gluck IV 		case B_FILL_SPAN:
85db528c00SAlexander von Gluck IV 			return (void*)radeon_fill_span;
86db528c00SAlexander von Gluck IV 		*/
87a90ebd77SClemens Zeidler 	}
88a90ebd77SClemens Zeidler 
89a90ebd77SClemens Zeidler 	return NULL;
90a90ebd77SClemens Zeidler }
91a90ebd77SClemens Zeidler 
92