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