6 #define VBE_ATTR_LFB (1 << 7)
7 #define VBE_MODE_LFB (1 << 14)
13 uint8_t caps[4]; /* capabilities */
14 uint32_t vid_mode_ptr; /* vbefarptr to video mode list */
15 uint16_t total_mem; /* num of 64k mem blocks */
16 uint16_t oem_sw_rev; /* VBE implementation software revision */
17 uint32_t oem_vendor_name_ptr;
18 uint32_t oem_product_name_ptr;
19 uint32_t oem_product_rev_ptr;
20 uint8_t reserved[222];
21 uint8_t oem_data[256];
22 } __attribute__((packed));
24 struct vbe_mode_info {
26 uint8_t wina_attr, winb_attr;
27 uint16_t win_gran, win_size;
28 uint16_t wina_seg, winb_seg;
30 uint16_t scanline_bytes;
32 /* VBE 1.2 and above */
34 uint8_t xcharsz, ycharsz;
39 uint8_t bank_size; /* bank size in KB */
40 uint8_t num_img_pages;
43 /* direct color fields */
44 uint8_t rmask_size, rpos;
45 uint8_t gmask_size, gpos;
46 uint8_t bmask_size, bpos;
47 uint8_t xmask_size, xpos;
48 uint8_t cmode_info; /* direct color mode attributes */
50 /* VBE 2.0 and above */
51 uint32_t fb_addr; /* physical address of the linear framebuffer */
55 uint8_t reserved4[206];
56 } __attribute__((packed));
58 struct vbe_edid_chroma {
59 unsigned char redgreen_xy_lsb;
60 unsigned char bluewhite_xy_lsb;
61 unsigned char redx_msb, redy_msb;
62 unsigned char greenx_msb, greeny_msb;
63 unsigned char bluex_msb, bluey_msb;
64 unsigned char whitex_msb, whitey_msb;
65 } __attribute__((packed));
67 struct vbe_edid_timing {
69 unsigned char hactive_lsb, hblank_lsb, hact_hblank_msb;
70 unsigned char vactive_lsb, vblank_lsb, vact_vblank_msb;
71 unsigned char hporch_lsb, hsync_lsb;
72 unsigned char vporch_vsync_lsb;
73 unsigned char hvporch_hvsync_msb;
74 unsigned char hsize_lsb, vsize_lsb; /* mm */
75 unsigned char hsize_vsize_msb;
76 unsigned char hborder, vborder;
77 unsigned char features;
78 } __attribute__((packed));
81 #define VBE_EDID_MAGIC "\0\xff\xff\xff\xff\xff\xff\0"
88 unsigned char week, year;
89 unsigned char ver_major, ver_minor;
92 unsigned char hsize, vsize;
94 unsigned char features;
96 struct vbe_edid_chroma chroma;
99 unsigned char modes_ext;
102 struct vbe_edid_timing timing[4];
103 unsigned char num_ext, csum;
105 } __attribute__((packed));
107 struct vbe_info *vbe_get_info(void);
108 struct vbe_mode_info *vbe_get_mode_info(int mode);
110 int vbe_set_mode(int mode);
112 void print_mode_info(struct vbe_mode_info *modei);
114 int vbe_get_edid(struct vbe_edid *edid);
115 int edid_preferred_resolution(struct vbe_edid *edid, int *xres, int *yres);
116 void print_edid(struct vbe_edid *edid);