193ee2104SAxel Dörfler /* 23f2f8b4cSStephan Aßmus * Copyright 2005-2008, Axel Dörfler, axeld@pinc-software.de. 33f2f8b4cSStephan Aßmus * All rights reserved. Distributed under the terms of the MIT License. 493ee2104SAxel Dörfler */ 593ee2104SAxel Dörfler #ifndef _ACCELERANT_PROTOS_H 693ee2104SAxel Dörfler #define _ACCELERANT_PROTOS_H 793ee2104SAxel Dörfler 893ee2104SAxel Dörfler 993ee2104SAxel Dörfler #include <Accelerant.h> 1093ee2104SAxel Dörfler #include "video_overlay.h" 1193ee2104SAxel Dörfler 1293ee2104SAxel Dörfler 1393ee2104SAxel Dörfler #ifdef __cplusplus 1493ee2104SAxel Dörfler extern "C" { 1593ee2104SAxel Dörfler #endif 1693ee2104SAxel Dörfler 1793ee2104SAxel Dörfler // general 1893ee2104SAxel Dörfler status_t vesa_init_accelerant(int fd); 1993ee2104SAxel Dörfler ssize_t vesa_accelerant_clone_info_size(void); 2093ee2104SAxel Dörfler void vesa_get_accelerant_clone_info(void *data); 2193ee2104SAxel Dörfler status_t vesa_clone_accelerant(void *data); 2293ee2104SAxel Dörfler void vesa_uninit_accelerant(void); 2393ee2104SAxel Dörfler status_t vesa_get_accelerant_device_info(accelerant_device_info *adi); 2493ee2104SAxel Dörfler sem_id vesa_accelerant_retrace_semaphore(void); 2593ee2104SAxel Dörfler 2693ee2104SAxel Dörfler // modes & constraints 2793ee2104SAxel Dörfler uint32 vesa_accelerant_mode_count(void); 2893ee2104SAxel Dörfler status_t vesa_get_mode_list(display_mode *dm); 29d16ddc57SAxel Dörfler status_t vesa_propose_display_mode(display_mode *target, 30d16ddc57SAxel Dörfler const display_mode *low, const display_mode *high); 313f2f8b4cSStephan Aßmus status_t vesa_set_display_mode(display_mode *modeToSet); 323f2f8b4cSStephan Aßmus status_t vesa_get_display_mode(display_mode *currentMode); 33d16ddc57SAxel Dörfler status_t vesa_get_edid_info(void *info, size_t size, uint32 *_version); 3493ee2104SAxel Dörfler status_t vesa_get_frame_buffer_config(frame_buffer_config *config); 35d16ddc57SAxel Dörfler status_t vesa_get_pixel_clock_limits(display_mode *dm, uint32 *low, 36d16ddc57SAxel Dörfler uint32 *high); 373f2f8b4cSStephan Aßmus status_t vesa_move_display(uint16 hDisplayStart, uint16 vDisplayStart); 3893ee2104SAxel Dörfler status_t vesa_get_timing_constraints(display_timing_constraints *dtc); 393f2f8b4cSStephan Aßmus void vesa_set_indexed_colors(uint count, uint8 first, uint8 *colorData, 40d16ddc57SAxel Dörfler uint32 flags); 4193ee2104SAxel Dörfler 4293ee2104SAxel Dörfler // DPMS 4393ee2104SAxel Dörfler uint32 vesa_dpms_capabilities(void); 4493ee2104SAxel Dörfler uint32 vesa_dpms_mode(void); 453f2f8b4cSStephan Aßmus status_t vesa_set_dpms_mode(uint32 dpmsFlags); 4693ee2104SAxel Dörfler 4793ee2104SAxel Dörfler // cursor 483f2f8b4cSStephan Aßmus status_t vesa_set_cursor_shape(uint16 width, uint16 height, uint16 hotX, 493f2f8b4cSStephan Aßmus uint16 hotY, uint8 *andMask, uint8 *xorMask); 50*ed80f189SAxel Dörfler status_t vesa_set_cursor_bitmap(uint16 width, uint16 height, uint16 hotX, 51*ed80f189SAxel Dörfler uint16 hotY, uint32 colorSpace, uint16 bytesPerRow, uint8* bitmapData); 5293ee2104SAxel Dörfler void vesa_move_cursor(uint16 x, uint16 y); 5393ee2104SAxel Dörfler void vesa_show_cursor(bool is_visible); 5493ee2104SAxel Dörfler 5593ee2104SAxel Dörfler // accelerant engine 5693ee2104SAxel Dörfler uint32 vesa_accelerant_engine_count(void); 573f2f8b4cSStephan Aßmus status_t vesa_acquire_engine(uint32 capabilities, uint32 maxWait, 58d16ddc57SAxel Dörfler sync_token *st, engine_token **et); 5993ee2104SAxel Dörfler status_t vesa_release_engine(engine_token *et, sync_token *st); 6093ee2104SAxel Dörfler void vesa_wait_engine_idle(void); 6193ee2104SAxel Dörfler status_t vesa_get_sync_token(engine_token *et, sync_token *st); 6293ee2104SAxel Dörfler status_t vesa_sync_to_token(sync_token *st); 6393ee2104SAxel Dörfler 6493ee2104SAxel Dörfler // 2D acceleration 65d16ddc57SAxel Dörfler void vesa_screen_to_screen_blit(engine_token *et, blit_params *list, 66d16ddc57SAxel Dörfler uint32 count); 67d16ddc57SAxel Dörfler void vesa_fill_rectangle(engine_token *et, uint32 color, fill_rect_params *list, 68d16ddc57SAxel Dörfler uint32 count); 69d16ddc57SAxel Dörfler void vesa_invert_rectangle(engine_token *et, fill_rect_params *list, 70d16ddc57SAxel Dörfler uint32 count); 7193ee2104SAxel Dörfler void vesa_fill_span(engine_token *et, uint32 color, uint16 *list, uint32 count); 7293ee2104SAxel Dörfler 7393ee2104SAxel Dörfler // overlay 7493ee2104SAxel Dörfler uint32 vesa_overlay_count(const display_mode *dm); 7593ee2104SAxel Dörfler const uint32 *vesa_overlay_supported_spaces(const display_mode *dm); 7693ee2104SAxel Dörfler uint32 vesa_overlay_supported_features(uint32 a_color_space); 77d16ddc57SAxel Dörfler const overlay_buffer *vesa_allocate_overlay_buffer(color_space cs, uint16 width, 78d16ddc57SAxel Dörfler uint16 height); 7993ee2104SAxel Dörfler status_t vesa_release_overlay_buffer(const overlay_buffer *ob); 80d16ddc57SAxel Dörfler status_t vesa_get_overlay_constraints(const display_mode *dm, 81d16ddc57SAxel Dörfler const overlay_buffer *ob, overlay_constraints *oc); 8293ee2104SAxel Dörfler overlay_token vesa_allocate_overlay(void); 8393ee2104SAxel Dörfler status_t vesa_release_overlay(overlay_token ot); 84d16ddc57SAxel Dörfler status_t vesa_configure_overlay(overlay_token ot, const overlay_buffer *ob, 85d16ddc57SAxel Dörfler const overlay_window *ow, const overlay_view *ov); 8693ee2104SAxel Dörfler 8793ee2104SAxel Dörfler #ifdef __cplusplus 8893ee2104SAxel Dörfler } 8993ee2104SAxel Dörfler #endif 9093ee2104SAxel Dörfler 9193ee2104SAxel Dörfler #endif /* _ACCELERANT_PROTOS_H */ 92