blob: dd1aa189547a212ae45bae941f6196e053c7b90e [file] [log] [blame]
Kevin O'Connor2f2ec112016-08-05 11:14:58 -04001// Misc function and variable declarations.
2#ifndef __VGAUTIL_H
3#define __VGAUTIL_H
4
5#include "types.h" // u8
6
Kevin O'Connor65bc0a72016-08-05 11:53:32 -04007// cbvga.c
8struct vgamode_s *cbvga_find_mode(int mode);
9void cbvga_list_modes(u16 seg, u16 *dest, u16 *last);
10int cbvga_get_window(struct vgamode_s *vmode_g, int window);
11int cbvga_set_window(struct vgamode_s *vmode_g, int window, int val);
12int cbvga_get_linelength(struct vgamode_s *vmode_g);
13int cbvga_set_linelength(struct vgamode_s *vmode_g, int val);
14int cbvga_get_displaystart(struct vgamode_s *vmode_g);
15int cbvga_set_displaystart(struct vgamode_s *vmode_g, int val);
16int cbvga_get_dacformat(struct vgamode_s *vmode_g);
17int cbvga_set_dacformat(struct vgamode_s *vmode_g, int val);
18int cbvga_save_restore(int cmd, u16 seg, void *data);
19int cbvga_set_mode(struct vgamode_s *vmode_g, int flags);
Patrick Rudolph4902b8a2017-05-29 19:25:12 +020020int cbvga_get_linesize(struct vgamode_s *vmode_g);
Gerd Hoffmann4d70b242018-05-30 22:50:42 +020021void cbvga_setup_modes(u64 addr, u8 bpp, u32 xlines, u32 ylines, u32 linelength);
Kevin O'Connor65bc0a72016-08-05 11:53:32 -040022int cbvga_setup(void);
23
Gerd Hoffmann77404b42017-11-15 14:43:10 +010024// bochsdisplay.c
25int bochs_display_setup(void);
26
Gerd Hoffmannd9a8b862017-11-15 14:43:10 +010027// ramfb.c
28int ramfb_setup(void);
29
Kevin O'Connor65bc0a72016-08-05 11:53:32 -040030// clext.c
31struct vgamode_s *clext_find_mode(int mode);
32void clext_list_modes(u16 seg, u16 *dest, u16 *last);
33int clext_get_window(struct vgamode_s *vmode_g, int window);
34int clext_set_window(struct vgamode_s *vmode_g, int window, int val);
35int clext_get_linelength(struct vgamode_s *vmode_g);
36int clext_set_linelength(struct vgamode_s *vmode_g, int val);
37int clext_get_displaystart(struct vgamode_s *vmode_g);
38int clext_set_displaystart(struct vgamode_s *vmode_g, int val);
39int clext_save_restore(int cmd, u16 seg, void *data);
40int clext_set_mode(struct vgamode_s *vmode_g, int flags);
41struct bregs;
42void clext_1012(struct bregs *regs);
43int clext_setup(void);
44
Gerd Hoffmann34b6ecc2019-02-25 10:51:37 +010045// atiext.c
46struct vgamode_s *ati_find_mode(int mode);
47void ati_list_modes(u16 seg, u16 *dest, u16 *last);
48int ati_set_mode(struct vgamode_s *vmode_g, int flags);
49int ati_setup(void);
50
Kevin O'Connorc682ffe2016-08-05 11:48:20 -040051// stdvgaio.c
52u8 stdvga_pelmask_read(void);
53void stdvga_pelmask_write(u8 val);
54u8 stdvga_misc_read(void);
55void stdvga_misc_write(u8 value);
56void stdvga_misc_mask(u8 off, u8 on);
57u8 stdvga_sequ_read(u8 index);
58void stdvga_sequ_write(u8 index, u8 value);
59void stdvga_sequ_mask(u8 index, u8 off, u8 on);
60u8 stdvga_grdc_read(u8 index);
61void stdvga_grdc_write(u8 index, u8 value);
62void stdvga_grdc_mask(u8 index, u8 off, u8 on);
63u8 stdvga_crtc_read(u16 crtc_addr, u8 index);
64void stdvga_crtc_write(u16 crtc_addr, u8 index, u8 value);
65void stdvga_crtc_mask(u16 crtc_addr, u8 index, u8 off, u8 on);
66u8 stdvga_attr_read(u8 index);
67void stdvga_attr_write(u8 index, u8 value);
68void stdvga_attr_mask(u8 index, u8 off, u8 on);
69u8 stdvga_attrindex_read(void);
70void stdvga_attrindex_write(u8 value);
71void stdvga_dac_read(u16 seg, u8 *data_far, u8 start, int count);
72void stdvga_dac_write(u16 seg, u8 *data_far, u8 start, int count);
73
74// stdvgamodes.c
75struct vgamode_s *stdvga_find_mode(int mode);
76void stdvga_list_modes(u16 seg, u16 *dest, u16 *last);
77void stdvga_build_video_param(void);
78void stdvga_override_crtc(int mode, u8 *crtc);
79int stdvga_set_mode(struct vgamode_s *vmode_g, int flags);
Patrick Rudolph4902b8a2017-05-29 19:25:12 +020080int stdvga_get_linesize(struct vgamode_s *vmode_g);
Kevin O'Connorc682ffe2016-08-05 11:48:20 -040081void stdvga_set_packed_palette(void);
82
Kevin O'Connor2f2ec112016-08-05 11:14:58 -040083// swcursor.c
Kevin O'Connor2f2ec112016-08-05 11:14:58 -040084void swcursor_pre_handle10(struct bregs *regs);
85void swcursor_check_event(void);
86
87// vbe.c
88extern u32 VBE_total_memory;
89extern u32 VBE_capabilities;
90extern u32 VBE_framebuffer;
91extern u16 VBE_win_granularity;
Gerd Hoffmanna307d0a2019-03-19 11:09:33 +010092extern u8 VBE_edid[256];
Kevin O'Connor2f2ec112016-08-05 11:14:58 -040093void handle_104f(struct bregs *regs);
94
95// vgafonts.c
96extern u8 vgafont8[];
97extern u8 vgafont14[];
98extern u8 vgafont16[];
99extern u8 vgafont14alt[];
100extern u8 vgafont16alt[];
101
102// vgainit.c
103extern int VgaBDF;
104extern int HaveRunInit;
Gerd Hoffmanne1a95792018-06-15 07:55:47 +0200105u32 allocate_pmm(u32 size, int highmem, int aligned);
Kevin O'Connor2f2ec112016-08-05 11:14:58 -0400106
Kevin O'Connor8cdf0c52016-08-05 13:44:12 -0400107// vgaversion.c
108extern const char VERSION[], BUILDINFO[];
109
Kevin O'Connor2f2ec112016-08-05 11:14:58 -0400110#endif // vgautil.h