xref: /haiku/src/add-ons/accelerants/vesa/accelerant_protos.h (revision 2f470aec1c92ce6917b8a903e343795dc77af41f)
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 #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, const display_mode *low, const display_mode *high);
30 status_t vesa_set_display_mode(display_mode *mode_to_set);
31 status_t vesa_get_display_mode(display_mode *current_mode);
32 status_t vesa_get_frame_buffer_config(frame_buffer_config *config);
33 status_t vesa_get_pixel_clock_limits(display_mode *dm, uint32 *low, uint32 *high);
34 status_t vesa_move_display(uint16 h_display_start, uint16 v_display_start);
35 status_t vesa_get_timing_constraints(display_timing_constraints *dtc);
36 void vesa_set_indexed_colors(uint count, uint8 first, uint8 *color_data, uint32 flags);
37 
38 // DPMS
39 uint32 vesa_dpms_capabilities(void);
40 uint32 vesa_dpms_mode(void);
41 status_t vesa_set_dpms_mode(uint32 dpms_flags);
42 
43 // cursor
44 status_t vesa_set_cursor_shape(uint16 width, uint16 height, uint16 hot_x, uint16 hot_y, uint8 *andMask, uint8 *xorMask);
45 void vesa_move_cursor(uint16 x, uint16 y);
46 void vesa_show_cursor(bool is_visible);
47 
48 // accelerant engine
49 uint32 vesa_accelerant_engine_count(void);
50 status_t vesa_acquire_engine(uint32 capabilities, uint32 max_wait, sync_token *st, engine_token **et);
51 status_t vesa_release_engine(engine_token *et, sync_token *st);
52 void vesa_wait_engine_idle(void);
53 status_t vesa_get_sync_token(engine_token *et, sync_token *st);
54 status_t vesa_sync_to_token(sync_token *st);
55 
56 // 2D acceleration
57 void vesa_screen_to_screen_blit(engine_token *et, blit_params *list, uint32 count);
58 void vesa_fill_rectangle(engine_token *et, uint32 color, fill_rect_params *list, uint32 count);
59 void vesa_invert_rectangle(engine_token *et, fill_rect_params *list, uint32 count);
60 void vesa_fill_span(engine_token *et, uint32 color, uint16 *list, uint32 count);
61 
62 // overlay
63 uint32 vesa_overlay_count(const display_mode *dm);
64 const uint32 *vesa_overlay_supported_spaces(const display_mode *dm);
65 uint32 vesa_overlay_supported_features(uint32 a_color_space);
66 const overlay_buffer *vesa_allocate_overlay_buffer(color_space cs, uint16 width, uint16 height);
67 status_t vesa_release_overlay_buffer(const overlay_buffer *ob);
68 status_t vesa_get_overlay_constraints(const display_mode *dm, const overlay_buffer *ob, overlay_constraints *oc);
69 overlay_token vesa_allocate_overlay(void);
70 status_t vesa_release_overlay(overlay_token ot);
71 status_t vesa_configure_overlay(overlay_token ot, const overlay_buffer *ob, const overlay_window *ow, const overlay_view *ov);
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif	/* _ACCELERANT_PROTOS_H */
78