Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / seabios / src / std / vbe.h
1 #ifndef __VBE_H
2 #define __VBE_H
3
4 #include "types.h" // u8
5
6 #define VESA_SIGNATURE 0x41534556 // VESA
7 #define VBE2_SIGNATURE 0x32454256 // VBE2
8
9 struct vbe_info {
10     u32 signature;
11     u16 version;
12     struct segoff_s oem_string;
13     u32 capabilities;
14     struct segoff_s video_mode;
15     u16 total_memory;
16     u16 oem_revision;
17     struct segoff_s oem_vendor_string;
18     struct segoff_s oem_product_string;
19     struct segoff_s oem_revision_string;
20     u8 reserved[222];
21 } PACKED;
22
23 struct vbe_mode_info {
24     /* VBE */
25     u16 mode_attributes;
26     u8 winA_attributes;
27     u8 winB_attributes;
28     u16 win_granularity;
29     u16 win_size;
30     u16 winA_seg;
31     u16 winB_seg;
32     struct segoff_s win_func_ptr;
33     u16 bytes_per_scanline;
34     /* VBE 1.2 */
35     u16 xres;
36     u16 yres;
37     u8 xcharsize;
38     u8 ycharsize;
39     u8 planes;
40     u8 bits_per_pixel;
41     u8 banks;
42     u8 mem_model;
43     u8 bank_size;
44     u8 pages;
45     u8 reserved0;
46     /* Direct Color */
47     u8 red_size;
48     u8 red_pos;
49     u8 green_size;
50     u8 green_pos;
51     u8 blue_size;
52     u8 blue_pos;
53     u8 alpha_size;
54     u8 alpha_pos;
55     u8 directcolor_info;
56     /* VBE 2.0 */
57     u32 phys_base;
58     u32 reserved1;
59     u16 reserved2;
60     /* VBE 3.0 */
61     u16 linear_bytes_per_scanline;
62     u8 bank_pages;
63     u8 linear_pages;
64     u8 linear_red_size;
65     u8 linear_red_pos;
66     u8 linear_green_size;
67     u8 linear_green_pos;
68     u8 linear_blue_size;
69     u8 linear_blue_pos;
70     u8 linear_alpha_size;
71     u8 linear_alpha_pos;
72     u32 pixclock_max;
73     u8 reserved[190];
74 } PACKED;
75
76 struct vbe_crtc_info {
77     u16 horiz_total;
78     u16 horiz_sync_start;
79     u16 horiz_sync_end;
80     u16 vert_total;
81     u16 vert_sync_start;
82     u16 vert_sync_end;
83     u8 flags;
84     u32 pixclock;
85     u16 refresh_rate;
86     u8 reserved[40];
87 } PACKED;
88
89 /* VBE Return Status Info */
90 /* AL */
91 #define VBE_RETURN_STATUS_SUPPORTED                      0x4F
92 #define VBE_RETURN_STATUS_UNSUPPORTED                    0x00
93 /* AH */
94 #define VBE_RETURN_STATUS_SUCCESSFULL                    0x00
95 #define VBE_RETURN_STATUS_FAILED                         0x01
96 #define VBE_RETURN_STATUS_NOT_SUPPORTED                  0x02
97 #define VBE_RETURN_STATUS_INVALID                        0x03
98
99 /* VBE Mode Numbers */
100
101 #define VBE_MODE_VESA_DEFINED                            0x0100
102 #define VBE_MODE_REFRESH_RATE_USE_CRTC                   0x0800
103 #define VBE_MODE_LINEAR_FRAME_BUFFER                     0x4000
104 #define VBE_MODE_PRESERVE_DISPLAY_MEMORY                 0x8000
105
106 #define VBE_VESA_MODE_END_OF_LIST                        0xFFFF
107
108 /* Capabilities */
109
110 #define VBE_CAPABILITY_8BIT_DAC                          0x0001
111 #define VBE_CAPABILITY_NOT_VGA_COMPATIBLE                0x0002
112 #define VBE_CAPABILITY_RAMDAC_USE_BLANK_BIT              0x0004
113 #define VBE_CAPABILITY_STEREOSCOPIC_SUPPORT              0x0008
114 #define VBE_CAPABILITY_STEREO_VIA_VESA_EVC               0x0010
115
116 /* Mode Attributes */
117
118 #define VBE_MODE_ATTRIBUTE_SUPPORTED                     0x0001
119 #define VBE_MODE_ATTRIBUTE_EXTENDED_INFORMATION_AVAILABLE  0x0002
120 #define VBE_MODE_ATTRIBUTE_TTY_BIOS_SUPPORT              0x0004
121 #define VBE_MODE_ATTRIBUTE_COLOR_MODE                    0x0008
122 #define VBE_MODE_ATTRIBUTE_GRAPHICS_MODE                 0x0010
123 #define VBE_MODE_ATTRIBUTE_NOT_VGA_COMPATIBLE            0x0020
124 #define VBE_MODE_ATTRIBUTE_NO_VGA_COMPATIBLE_WINDOW      0x0040
125 #define VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE      0x0080
126 #define VBE_MODE_ATTRIBUTE_DOUBLE_SCAN_MODE              0x0100
127 #define VBE_MODE_ATTRIBUTE_INTERLACE_MODE                0x0200
128 #define VBE_MODE_ATTRIBUTE_HARDWARE_TRIPLE_BUFFER        0x0400
129 #define VBE_MODE_ATTRIBUTE_HARDWARE_STEREOSCOPIC_DISPLAY 0x0800
130 #define VBE_MODE_ATTRIBUTE_DUAL_DISPLAY_START_ADDRESS    0x1000
131
132 #define VBE_MODE_ATTTRIBUTE_LFB_ONLY                     ( VBE_MODE_ATTRIBUTE_NO_VGA_COMPATIBLE_WINDOW | VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE )
133
134 /* Window attributes */
135
136 #define VBE_WINDOW_ATTRIBUTE_RELOCATABLE                 0x01
137 #define VBE_WINDOW_ATTRIBUTE_READABLE                    0x02
138 #define VBE_WINDOW_ATTRIBUTE_WRITEABLE                   0x04
139
140 /* Memory model */
141
142 #define VBE_MEMORYMODEL_TEXT_MODE                        0x00
143 #define VBE_MEMORYMODEL_CGA_GRAPHICS                     0x01
144 #define VBE_MEMORYMODEL_HERCULES_GRAPHICS                0x02
145 #define VBE_MEMORYMODEL_PLANAR                           0x03
146 #define VBE_MEMORYMODEL_PACKED_PIXEL                     0x04
147 #define VBE_MEMORYMODEL_NON_CHAIN_4_256                  0x05
148 #define VBE_MEMORYMODEL_DIRECT_COLOR                     0x06
149 #define VBE_MEMORYMODEL_YUV                              0x07
150
151 /* DirectColorModeInfo */
152
153 #define VBE_DIRECTCOLOR_COLOR_RAMP_PROGRAMMABLE          0x01
154 #define VBE_DIRECTCOLOR_RESERVED_BITS_AVAILABLE          0x02
155
156 #endif