xref: /haiku/src/add-ons/accelerants/vesa/accelerant_protos.h (revision 4a55cc230cf7566cadcbb23b1928eefff8aea9a2)
1 /*
2  * Copyright 2005-2008, Axel Dörfler, axeld@pinc-software.de.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef _ACCELERANT_PROTOS_H
6 #define _ACCELERANT_PROTOS_H
7 
8 
9 #include <Accelerant.h>
10 #include "video_overlay.h"
11 
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 // general
18 status_t vesa_init_accelerant(int fd);
19 ssize_t vesa_accelerant_clone_info_size(void);
20 void vesa_get_accelerant_clone_info(void *data);
21 status_t vesa_clone_accelerant(void *data);
22 void vesa_uninit_accelerant(void);
23 status_t vesa_get_accelerant_device_info(accelerant_device_info *adi);
24 sem_id vesa_accelerant_retrace_semaphore(void);
25 
26 // modes & constraints
27 uint32 vesa_accelerant_mode_count(void);
28 status_t vesa_get_mode_list(display_mode *dm);
29 status_t vesa_propose_display_mode(display_mode *target,
30 	const display_mode *low, const display_mode *high);
31 status_t vesa_set_display_mode(display_mode *modeToSet);
32 status_t vesa_get_display_mode(display_mode *currentMode);
33 status_t vesa_get_edid_info(void *info, size_t size, uint32 *_version);
34 status_t vesa_get_frame_buffer_config(frame_buffer_config *config);
35 status_t vesa_get_pixel_clock_limits(display_mode *dm, uint32 *low,
36 	uint32 *high);
37 status_t vesa_move_display(uint16 hDisplayStart, uint16 vDisplayStart);
38 status_t vesa_get_timing_constraints(display_timing_constraints *dtc);
39 void vesa_set_indexed_colors(uint count, uint8 first, uint8 *colorData,
40 	uint32 flags);
41 
42 // DPMS
43 uint32 vesa_dpms_capabilities(void);
44 uint32 vesa_dpms_mode(void);
45 status_t vesa_set_dpms_mode(uint32 dpmsFlags);
46 
47 // cursor
48 status_t vesa_set_cursor_shape(uint16 width, uint16 height, uint16 hotX,
49 	uint16 hotY, const uint8 *andMask, const uint8 *xorMask);
50 status_t vesa_set_cursor_bitmap(uint16 width, uint16 height, uint16 hotX,
51 	uint16 hotY, color_space colorSpace, uint16 bytesPerRow,
52 	const uint8* bitmapData);
53 void vesa_move_cursor(uint16 x, uint16 y);
54 void vesa_show_cursor(bool is_visible);
55 
56 // 2D acceleration
57 void vesa_screen_to_screen_blit(engine_token *et, blit_params *list,
58 	uint32 count);
59 void vesa_fill_rectangle(engine_token *et, uint32 color, fill_rect_params *list,
60 	uint32 count);
61 void vesa_invert_rectangle(engine_token *et, fill_rect_params *list,
62 	uint32 count);
63 void vesa_fill_span(engine_token *et, uint32 color, uint16 *list, uint32 count);
64 
65 // overlay
66 uint32 vesa_overlay_count(const display_mode *dm);
67 const uint32 *vesa_overlay_supported_spaces(const display_mode *dm);
68 uint32 vesa_overlay_supported_features(uint32 a_color_space);
69 const overlay_buffer *vesa_allocate_overlay_buffer(color_space cs, uint16 width,
70 	uint16 height);
71 status_t vesa_release_overlay_buffer(const overlay_buffer *ob);
72 status_t vesa_get_overlay_constraints(const display_mode *dm,
73 	const overlay_buffer *ob, overlay_constraints *oc);
74 overlay_token vesa_allocate_overlay(void);
75 status_t vesa_release_overlay(overlay_token ot);
76 status_t vesa_configure_overlay(overlay_token ot, const overlay_buffer *ob,
77 	const overlay_window *ow, const overlay_view *ov);
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif	/* _ACCELERANT_PROTOS_H */
84