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, uint8 *andMask, uint8 *xorMask); 50 void vesa_move_cursor(uint16 x, uint16 y); 51 void vesa_show_cursor(bool is_visible); 52 53 // accelerant engine 54 uint32 vesa_accelerant_engine_count(void); 55 status_t vesa_acquire_engine(uint32 capabilities, uint32 maxWait, 56 sync_token *st, engine_token **et); 57 status_t vesa_release_engine(engine_token *et, sync_token *st); 58 void vesa_wait_engine_idle(void); 59 status_t vesa_get_sync_token(engine_token *et, sync_token *st); 60 status_t vesa_sync_to_token(sync_token *st); 61 62 // 2D acceleration 63 void vesa_screen_to_screen_blit(engine_token *et, blit_params *list, 64 uint32 count); 65 void vesa_fill_rectangle(engine_token *et, uint32 color, fill_rect_params *list, 66 uint32 count); 67 void vesa_invert_rectangle(engine_token *et, fill_rect_params *list, 68 uint32 count); 69 void vesa_fill_span(engine_token *et, uint32 color, uint16 *list, uint32 count); 70 71 // overlay 72 uint32 vesa_overlay_count(const display_mode *dm); 73 const uint32 *vesa_overlay_supported_spaces(const display_mode *dm); 74 uint32 vesa_overlay_supported_features(uint32 a_color_space); 75 const overlay_buffer *vesa_allocate_overlay_buffer(color_space cs, uint16 width, 76 uint16 height); 77 status_t vesa_release_overlay_buffer(const overlay_buffer *ob); 78 status_t vesa_get_overlay_constraints(const display_mode *dm, 79 const overlay_buffer *ob, overlay_constraints *oc); 80 overlay_token vesa_allocate_overlay(void); 81 status_t vesa_release_overlay(overlay_token ot); 82 status_t vesa_configure_overlay(overlay_token ot, const overlay_buffer *ob, 83 const overlay_window *ow, const overlay_view *ov); 84 85 #ifdef __cplusplus 86 } 87 #endif 88 89 #endif /* _ACCELERANT_PROTOS_H */ 90