63 строки
2.5 KiB
C
63 строки
2.5 KiB
C
|
/*
|
||
|
* (c) 2010, SWD Embedded Systems Limited, http://www.kpda.ru
|
||
|
*/
|
||
|
|
||
|
|
||
|
#include <graphics/display.h>
|
||
|
#include <graphics/disputil.h>
|
||
|
#include <graphics/vesa.h>
|
||
|
#include <graphics/vbios.h>
|
||
|
|
||
|
typedef struct {
|
||
|
disp_adapter_t *adapter;
|
||
|
unsigned char *vidptr;
|
||
|
unsigned vidsize;
|
||
|
unsigned vidstride;
|
||
|
unsigned vidbase;
|
||
|
unsigned current_mode_caps;
|
||
|
disp_surface_t visible;
|
||
|
int visible_allocated;
|
||
|
int mode_set;
|
||
|
uint32_t format;
|
||
|
int free_context;
|
||
|
} vb_context_t;
|
||
|
|
||
|
int vesa_mem_init(disp_adapter_t *adapter, char *optstring);
|
||
|
void vesa_mem_fini(disp_adapter_t *adapter);
|
||
|
int vesa_mem_reset(disp_adapter_t *adapter, disp_surface_t *surf);
|
||
|
disp_surface_t *vesa_alloc_surface(disp_adapter_t *adapter,
|
||
|
int width, int height, unsigned format, unsigned flags, unsigned user_flags);
|
||
|
int vesa_free_surface(disp_adapter_t *adapter, disp_surface_t *surf);
|
||
|
unsigned long vesa_mem_avail(disp_adapter_t *adapter, unsigned sflags);
|
||
|
|
||
|
int vesa_get_modelist(disp_adapter_t *ctx, int dispno, unsigned short *list,
|
||
|
int index, int size);
|
||
|
int vesa_get_modeinfo(disp_adapter_t *ctx, int dispno,
|
||
|
disp_mode_t mode, disp_mode_info_t *info);
|
||
|
int vesa_set_mode(disp_adapter_t *ctx, int dispno, disp_mode_t mode,
|
||
|
disp_crtc_settings_t *settings, disp_surface_t *surface, unsigned flags);
|
||
|
void vesa_disable_vga(disp_adapter_t *ctx);
|
||
|
void vesa_restore_vga(disp_adapter_t *ctx);
|
||
|
int vesa_set_dpms_mode(disp_adapter_t *ctx, int dispno, int dpms_mode);
|
||
|
int vesa_set_display_offset(disp_adapter_t *ctx, int dispno,
|
||
|
unsigned offset, int wait_vsync);
|
||
|
int vesa_set_palette(disp_adapter_t *ctx, int dispno,
|
||
|
int index, int count, disp_color_t *pal);
|
||
|
void vesa_set_scroll_pos(disp_adapter_t *adapter, int dispno,
|
||
|
unsigned xoff, unsigned yoff);
|
||
|
|
||
|
void vesa_module_info(disp_adapter_t *adapter, disp_module_info_t *info);
|
||
|
int vesa_attach_external(disp_adapter_t *adapter, disp_aperture_t aper[]);
|
||
|
int vesa_detach_external(disp_adapter_t *adapter);
|
||
|
int vesa_recover(disp_adapter_t *adapter);
|
||
|
|
||
|
int vesa_query_apertures(disp_adapter_t *adp, disp_aperture_t *aptertures);
|
||
|
int vesa_query_surface(disp_adapter_t *adapter,
|
||
|
disp_surface_t *surf, disp_surface_info_t *info);
|
||
|
int vesa_get_alloc_info(disp_adapter_t *adp,
|
||
|
int width, int height, unsigned format,
|
||
|
unsigned flags, unsigned user_flags, disp_alloc_info_t *info);
|
||
|
int vesa_get_alloc_layer_info(disp_adapter_t *adp, int dispno[], int layer_idx[],
|
||
|
int nlayers, unsigned format, int surface_index, int width, int height,
|
||
|
unsigned sflags, unsigned hint_flags, disp_alloc_info_t *info);
|