blob: 66afb011ada034d53b518f8de068567f6c96ffd9 [file] [log] [blame]
Kevin O'Connor40401952011-12-31 03:43:12 -05001// Video Bios Extensions handlers
2//
Kevin O'Connord9211ee2012-01-31 22:54:49 -05003// Copyright (C) 2012 Kevin O'Connor <kevin@koconnor.net>
4// Copyright (C) 2011 Julian Pidancet <julian.pidancet@citrix.com>
Kevin O'Connor40401952011-12-31 03:43:12 -05005// Copyright (C) 2001-2008 the LGPL VGABios developers Team
6//
7// This file may be distributed under the terms of the GNU LGPLv3 license.
8
Kevin O'Connor81541132012-02-12 11:49:25 -05009#include "biosvar.h" // GET_GLOBAL
Kevin O'Connor2d2fa312013-09-14 21:55:26 -040010#include "bregs.h" // struct bregs
11#include "config.h" // CONFIG_*
12#include "output.h" // dprintf
Kevin O'Connor2e57c812013-09-14 22:29:32 -040013#include "std/vbe.h" // struct vbe_info
Kevin O'Connorfa9c66a2013-09-14 19:10:40 -040014#include "string.h" // memset_far
Kevin O'Connor2f2ec112016-08-05 11:14:58 -040015#include "vgabios.h" // get_current_mode
Kevin O'Connor2d2fa312013-09-14 21:55:26 -040016#include "vgahw.h" // vgahw_set_mode
Kevin O'Connor2f2ec112016-08-05 11:14:58 -040017#include "vgautil.h" // handle_104f
18
19#define VBE_OEM_STRING "SeaBIOS VBE(C) 2011"
20#define VBE_VENDOR_STRING "SeaBIOS Developers"
21#define VBE_PRODUCT_STRING "SeaBIOS VBE Adapter"
22#define VBE_REVISION_STRING "Rev. 1"
Kevin O'Connor40401952011-12-31 03:43:12 -050023
Kevin O'Connor3339c052012-01-13 20:00:35 -050024u32 VBE_total_memory VAR16 = 256 * 1024;
25u32 VBE_capabilities VAR16;
26u32 VBE_framebuffer VAR16;
Kevin O'Connor49ddd9e2012-09-04 13:16:36 -040027u16 VBE_win_granularity VAR16;
Gerd Hoffmanna307d0a2019-03-19 11:09:33 +010028u8 VBE_edid[256] VAR16;
Kevin O'Connor3339c052012-01-13 20:00:35 -050029
Kevin O'Connor40401952011-12-31 03:43:12 -050030static void
31vbe_104f00(struct bregs *regs)
32{
33 u16 seg = regs->es;
34 struct vbe_info *info = (void*)(regs->di+0);
35
36 if (GET_FARVAR(seg, info->signature) == VBE2_SIGNATURE) {
37 dprintf(4, "Get VBE Controller: VBE2 Signature found\n");
38 } else if (GET_FARVAR(seg, info->signature) == VESA_SIGNATURE) {
39 dprintf(4, "Get VBE Controller: VESA Signature found\n");
40 } else {
41 dprintf(4, "Get VBE Controller: Invalid Signature\n");
42 }
43
44 memset_far(seg, info, 0, sizeof(*info));
45
46 SET_FARVAR(seg, info->signature, VESA_SIGNATURE);
47
Kevin O'Connor81541132012-02-12 11:49:25 -050048 SET_FARVAR(seg, info->version, 0x0300);
Kevin O'Connor40401952011-12-31 03:43:12 -050049
50 SET_FARVAR(seg, info->oem_string,
51 SEGOFF(get_global_seg(), (u32)VBE_OEM_STRING));
Kevin O'Connor3339c052012-01-13 20:00:35 -050052 SET_FARVAR(seg, info->capabilities, GET_GLOBAL(VBE_capabilities));
Kevin O'Connor40401952011-12-31 03:43:12 -050053
54 /* We generate our mode list in the reserved field of the info block */
Kevin O'Connor34203cd2012-01-09 20:55:31 -050055 u16 *destmode = (void*)info->reserved;
56 SET_FARVAR(seg, info->video_mode, SEGOFF(seg, (u32)destmode));
Kevin O'Connor40401952011-12-31 03:43:12 -050057
Kevin O'Connor81541132012-02-12 11:49:25 -050058 /* Total memory (in 64k blocks) */
Kevin O'Connor3339c052012-01-13 20:00:35 -050059 SET_FARVAR(seg, info->total_memory
60 , GET_GLOBAL(VBE_total_memory) / (64*1024));
Kevin O'Connor40401952011-12-31 03:43:12 -050061
62 SET_FARVAR(seg, info->oem_vendor_string,
63 SEGOFF(get_global_seg(), (u32)VBE_VENDOR_STRING));
64 SET_FARVAR(seg, info->oem_product_string,
65 SEGOFF(get_global_seg(), (u32)VBE_PRODUCT_STRING));
66 SET_FARVAR(seg, info->oem_revision_string,
67 SEGOFF(get_global_seg(), (u32)VBE_REVISION_STRING));
68
69 /* Fill list of modes */
Kevin O'Connor34203cd2012-01-09 20:55:31 -050070 u16 *last = (void*)&info->reserved[sizeof(info->reserved)];
71 vgahw_list_modes(seg, destmode, last - 1);
Kevin O'Connor40401952011-12-31 03:43:12 -050072
Kevin O'Connor3339c052012-01-13 20:00:35 -050073 regs->ax = 0x004f;
Kevin O'Connor40401952011-12-31 03:43:12 -050074}
75
76static void
77vbe_104f01(struct bregs *regs)
78{
79 u16 seg = regs->es;
80 struct vbe_mode_info *info = (void*)(regs->di+0);
81 u16 mode = regs->cx;
Kevin O'Connor40401952011-12-31 03:43:12 -050082
83 dprintf(1, "VBE mode info request: %x\n", mode);
84
Kevin O'Connoref4f9e12012-09-03 13:54:28 -040085 struct vgamode_s *vmode_g = vgahw_find_mode(mode & ~MF_VBEFLAGS);
Kevin O'Connor3339c052012-01-13 20:00:35 -050086 if (! vmode_g) {
Kevin O'Connor40401952011-12-31 03:43:12 -050087 dprintf(1, "VBE mode %x not found\n", mode);
Kevin O'Connor81541132012-02-12 11:49:25 -050088 regs->ax = 0x014f;
Kevin O'Connor40401952011-12-31 03:43:12 -050089 return;
90 }
91
Kevin O'Connor643290f2012-01-13 22:08:52 -050092 memset_far(seg, info, 0, sizeof(*info));
Kevin O'Connor58dd0512012-09-04 18:39:51 -040093
94 // Basic information about video controller.
Kevin O'Connor49ddd9e2012-09-04 13:16:36 -040095 u32 win_granularity = GET_GLOBAL(VBE_win_granularity);
Kevin O'Connor40401952011-12-31 03:43:12 -050096 SET_FARVAR(seg, info->winA_attributes,
Kevin O'Connor49ddd9e2012-09-04 13:16:36 -040097 (win_granularity ? VBE_WINDOW_ATTRIBUTE_RELOCATABLE : 0) |
Kevin O'Connor40401952011-12-31 03:43:12 -050098 VBE_WINDOW_ATTRIBUTE_READABLE |
99 VBE_WINDOW_ATTRIBUTE_WRITEABLE);
100 SET_FARVAR(seg, info->winB_attributes, 0);
Kevin O'Connor49ddd9e2012-09-04 13:16:36 -0400101 SET_FARVAR(seg, info->win_granularity, win_granularity);
Kevin O'Connor40401952011-12-31 03:43:12 -0500102 SET_FARVAR(seg, info->win_size, 64); /* Bank size 64K */
Kevin O'Connor03776022012-01-21 11:00:11 -0500103 SET_FARVAR(seg, info->winA_seg, GET_GLOBAL(vmode_g->sstart));
Kevin O'Connor40401952011-12-31 03:43:12 -0500104 SET_FARVAR(seg, info->winB_seg, 0x0);
Kevin O'Connor9961f992012-01-21 11:53:44 -0500105 extern void entry_104f05(void);
106 SET_FARVAR(seg, info->win_func_ptr
107 , SEGOFF(get_global_seg(), (u32)entry_104f05));
Kevin O'Connor58dd0512012-09-04 18:39:51 -0400108 // Basic information about mode.
Kevin O'Connor3339c052012-01-13 20:00:35 -0500109 int width = GET_GLOBAL(vmode_g->width);
110 int height = GET_GLOBAL(vmode_g->height);
Patrick Rudolph4902b8a2017-05-29 19:25:12 +0200111 int linesize = vgahw_get_linesize(vmode_g);
Kevin O'Connor3339c052012-01-13 20:00:35 -0500112 SET_FARVAR(seg, info->bytes_per_scanline, linesize);
113 SET_FARVAR(seg, info->xres, width);
114 SET_FARVAR(seg, info->yres, height);
Kevin O'Connor03776022012-01-21 11:00:11 -0500115 SET_FARVAR(seg, info->xcharsize, GET_GLOBAL(vmode_g->cwidth));
116 SET_FARVAR(seg, info->ycharsize, GET_GLOBAL(vmode_g->cheight));
Kevin O'Connor81541132012-02-12 11:49:25 -0500117 int depth = GET_GLOBAL(vmode_g->depth);
Kevin O'Connor3339c052012-01-13 20:00:35 -0500118 SET_FARVAR(seg, info->bits_per_pixel, depth);
Kevin O'Connor58dd0512012-09-04 18:39:51 -0400119 u8 memmodel = GET_GLOBAL(vmode_g->memmodel);
120 SET_FARVAR(seg, info->mem_model, memmodel);
Kevin O'Connor40401952011-12-31 03:43:12 -0500121 SET_FARVAR(seg, info->reserved0, 1);
122
Kevin O'Connor58dd0512012-09-04 18:39:51 -0400123 // Mode specific info.
124 u16 mode_attr = VBE_MODE_ATTRIBUTE_SUPPORTED |
125 VBE_MODE_ATTRIBUTE_EXTENDED_INFORMATION_AVAILABLE |
126 VBE_MODE_ATTRIBUTE_COLOR_MODE |
127 VBE_MODE_ATTRIBUTE_GRAPHICS_MODE |
128 VBE_MODE_ATTRIBUTE_NOT_VGA_COMPATIBLE;
129 u32 framebuffer = 0;
130 int planes = 1, banks = 1;
131 u32 pages = GET_GLOBAL(VBE_total_memory) / ALIGN(height * linesize, 64*1024);
132 switch (memmodel) {
133 case MM_TEXT:
134 mode_attr &= ~VBE_MODE_ATTRIBUTE_GRAPHICS_MODE;
135 mode_attr |= VBE_MODE_ATTRIBUTE_TTY_BIOS_SUPPORT;
136 if (GET_GLOBAL(vmode_g->sstart) == SEG_MTEXT)
137 mode_attr &= ~VBE_MODE_ATTRIBUTE_COLOR_MODE;
138 pages = 1;
139 break;
140 case MM_CGA:
141 pages = 1;
142 banks = 2;
143 SET_FARVAR(seg, info->bank_size, 8);
144 break;
145 case MM_PLANAR:
146 planes = 4;
147 pages /= 4;
148 break;
149 default:
150 framebuffer = GET_GLOBAL(VBE_framebuffer);
151 if (framebuffer)
152 mode_attr |= VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE;
153 break;
154 }
Kevin O'Connor0db69882013-09-13 16:21:10 -0400155 if (pages > 128)
156 pages = 128;
157 if (pages < 2)
158 pages++;
Kevin O'Connor58dd0512012-09-04 18:39:51 -0400159 SET_FARVAR(seg, info->mode_attributes, mode_attr);
160 SET_FARVAR(seg, info->planes, planes);
161 SET_FARVAR(seg, info->pages, pages - 1);
162 SET_FARVAR(seg, info->banks, banks);
Kevin O'Connor40401952011-12-31 03:43:12 -0500163
Kevin O'Connor58dd0512012-09-04 18:39:51 -0400164 // Pixel color breakdown
165 u8 r_size, r_pos, g_size, g_pos, b_size, b_pos, a_size, a_pos;
Kevin O'Connor3339c052012-01-13 20:00:35 -0500166 switch (depth) {
Kevin O'Connor40401952011-12-31 03:43:12 -0500167 case 15: r_size = 5; r_pos = 10; g_size = 5; g_pos = 5;
168 b_size = 5; b_pos = 0; a_size = 1; a_pos = 15; break;
169 case 16: r_size = 5; r_pos = 11; g_size = 6; g_pos = 5;
170 b_size = 5; b_pos = 0; a_size = 0; a_pos = 0; break;
171 case 24: r_size = 8; r_pos = 16; g_size = 8; g_pos = 8;
172 b_size = 8; b_pos = 0; a_size = 0; a_pos = 0; break;
173 case 32: r_size = 8; r_pos = 16; g_size = 8; g_pos = 8;
Kevin O'Connor58dd0512012-09-04 18:39:51 -0400174 b_size = 8; b_pos = 0; a_size = 8; a_pos = 24;
175 SET_FARVAR(seg, info->directcolor_info,
176 VBE_DIRECTCOLOR_RESERVED_BITS_AVAILABLE);
177 break;
Kevin O'Connor40401952011-12-31 03:43:12 -0500178 default: r_size = 0; r_pos = 0; g_size = 0; g_pos = 0;
179 b_size = 0; b_pos = 0; a_size = 0; a_pos = 0; break;
180 }
Kevin O'Connor40401952011-12-31 03:43:12 -0500181 SET_FARVAR(seg, info->red_size, r_size);
182 SET_FARVAR(seg, info->red_pos, r_pos);
183 SET_FARVAR(seg, info->green_size, g_size);
184 SET_FARVAR(seg, info->green_pos, g_pos);
185 SET_FARVAR(seg, info->blue_size, b_size);
186 SET_FARVAR(seg, info->blue_pos, b_pos);
187 SET_FARVAR(seg, info->alpha_size, a_size);
188 SET_FARVAR(seg, info->alpha_pos, a_pos);
189
Kevin O'Connor58dd0512012-09-04 18:39:51 -0400190 // Linear framebuffer info.
191 if (framebuffer) {
192 SET_FARVAR(seg, info->phys_base, framebuffer);
Kevin O'Connor40401952011-12-31 03:43:12 -0500193
Kevin O'Connor58dd0512012-09-04 18:39:51 -0400194 SET_FARVAR(seg, info->reserved1, 0);
195 SET_FARVAR(seg, info->reserved2, 0);
196 SET_FARVAR(seg, info->linear_bytes_per_scanline, linesize);
197 SET_FARVAR(seg, info->linear_pages, 0);
198 SET_FARVAR(seg, info->linear_red_size, r_size);
199 SET_FARVAR(seg, info->linear_red_pos, r_pos);
200 SET_FARVAR(seg, info->linear_green_size, g_size);
201 SET_FARVAR(seg, info->linear_green_pos, g_pos);
202 SET_FARVAR(seg, info->linear_blue_size, b_size);
203 SET_FARVAR(seg, info->linear_blue_pos, b_pos);
204 SET_FARVAR(seg, info->linear_alpha_size, a_size);
205 SET_FARVAR(seg, info->linear_alpha_pos, a_pos);
206 }
Kevin O'Connor40401952011-12-31 03:43:12 -0500207
Kevin O'Connor3339c052012-01-13 20:00:35 -0500208 regs->ax = 0x004f;
Kevin O'Connor40401952011-12-31 03:43:12 -0500209}
210
211static void
212vbe_104f02(struct bregs *regs)
213{
Kevin O'Connor5108c692011-12-31 19:13:45 -0500214 dprintf(1, "VBE mode set: %x\n", regs->bx);
Kevin O'Connor40401952011-12-31 03:43:12 -0500215
Kevin O'Connore6bc4c12012-01-21 11:26:37 -0500216 int mode = regs->bx & ~MF_VBEFLAGS;
217 int flags = regs->bx & MF_VBEFLAGS;
218 int ret = vga_set_mode(mode, flags);
Kevin O'Connor40401952011-12-31 03:43:12 -0500219
Kevin O'Connor5108c692011-12-31 19:13:45 -0500220 regs->ah = ret;
221 regs->al = 0x4f;
Kevin O'Connor40401952011-12-31 03:43:12 -0500222}
223
224static void
225vbe_104f03(struct bregs *regs)
226{
Kevin O'Connor9978d492014-10-17 21:17:48 -0400227 regs->bx = GET_BDA_EXT(vbe_mode);
Kevin O'Connor40401952011-12-31 03:43:12 -0500228 dprintf(1, "VBE current mode=%x\n", regs->bx);
Kevin O'Connor3339c052012-01-13 20:00:35 -0500229 regs->ax = 0x004f;
Kevin O'Connor40401952011-12-31 03:43:12 -0500230}
231
232static void
233vbe_104f04(struct bregs *regs)
234{
Kevin O'Connor2469f892012-02-04 12:40:02 -0500235 u16 seg = regs->es;
236 void *data = (void*)(regs->bx+0);
237 u16 states = regs->cx;
Kevin O'Connor20dc4192014-02-05 20:52:25 -0500238 u8 cmd = regs->dl;
239 if (states & ~0x0f || cmd > 2)
Kevin O'Connor2469f892012-02-04 12:40:02 -0500240 goto fail;
Kevin O'Connor20dc4192014-02-05 20:52:25 -0500241 int ret = vgahw_save_restore(states | (cmd<<8), seg, data);
242 if (ret < 0)
243 goto fail;
244 if (cmd == 0)
Kevin O'Connor2469f892012-02-04 12:40:02 -0500245 regs->bx = ret / 64;
Kevin O'Connor2469f892012-02-04 12:40:02 -0500246 regs->ax = 0x004f;
247 return;
248fail:
249 regs->ax = 0x014f;
Kevin O'Connor40401952011-12-31 03:43:12 -0500250}
251
Kevin O'Connor9961f992012-01-21 11:53:44 -0500252void VISIBLE16
Kevin O'Connor40401952011-12-31 03:43:12 -0500253vbe_104f05(struct bregs *regs)
254{
Kevin O'Connor9961f992012-01-21 11:53:44 -0500255 if (regs->bh > 1 || regs->bl > 1)
256 goto fail;
Kevin O'Connor9978d492014-10-17 21:17:48 -0400257 if (GET_BDA_EXT(vbe_mode) & MF_LINEARFB) {
Kevin O'Connor9961f992012-01-21 11:53:44 -0500258 regs->ah = VBE_RETURN_STATUS_INVALID;
259 return;
260 }
261 struct vgamode_s *vmode_g = get_current_mode();
262 if (! vmode_g)
263 goto fail;
264 if (regs->bh) {
265 int ret = vgahw_get_window(vmode_g, regs->bl);
266 if (ret < 0)
267 goto fail;
268 regs->dx = ret;
269 regs->ax = 0x004f;
270 return;
271 }
272 int ret = vgahw_set_window(vmode_g, regs->bl, regs->dx);
273 if (ret)
274 goto fail;
275 regs->ax = 0x004f;
276 return;
277fail:
Kevin O'Connor81541132012-02-12 11:49:25 -0500278 regs->ax = 0x014f;
Kevin O'Connor40401952011-12-31 03:43:12 -0500279}
280
281static void
282vbe_104f06(struct bregs *regs)
283{
Kevin O'Connor3876b532012-01-24 00:07:44 -0500284 if (regs->bl > 0x02)
285 goto fail;
286 struct vgamode_s *vmode_g = get_current_mode();
287 if (! vmode_g)
288 goto fail;
289 int bpp = vga_bpp(vmode_g);
290
291 if (regs->bl == 0x00) {
292 int ret = vgahw_set_linelength(vmode_g, DIV_ROUND_UP(regs->cx * bpp, 8));
293 if (ret)
294 goto fail;
295 } else if (regs->bl == 0x02) {
296 int ret = vgahw_set_linelength(vmode_g, regs->cx);
297 if (ret)
298 goto fail;
299 }
300 int linelength = vgahw_get_linelength(vmode_g);
301 if (linelength < 0)
302 goto fail;
303
304 regs->bx = linelength;
305 regs->cx = (linelength * 8) / bpp;
306 regs->dx = GET_GLOBAL(VBE_total_memory) / linelength;
307 regs->ax = 0x004f;
308 return;
309fail:
310 regs->ax = 0x014f;
Kevin O'Connor40401952011-12-31 03:43:12 -0500311}
312
313static void
314vbe_104f07(struct bregs *regs)
315{
Kevin O'Connord61fc532012-01-27 20:37:45 -0500316 struct vgamode_s *vmode_g = get_current_mode();
317 if (! vmode_g)
318 goto fail;
319 int bpp = vga_bpp(vmode_g);
320 int linelength = vgahw_get_linelength(vmode_g);
321 if (linelength < 0)
322 goto fail;
323
324 int ret;
325 switch (regs->bl) {
326 case 0x80:
327 case 0x00:
328 ret = vgahw_set_displaystart(
329 vmode_g, DIV_ROUND_UP(regs->cx * bpp, 8) + linelength * regs->dx);
330 if (ret)
331 goto fail;
332 break;
333 case 0x01:
334 ret = vgahw_get_displaystart(vmode_g);
335 if (ret < 0)
336 goto fail;
337 regs->dx = ret / linelength;
338 regs->cx = (ret % linelength) * 8 / bpp;
339 break;
340 default:
341 goto fail;
342 }
343 regs->ax = 0x004f;
344 return;
345fail:
346 regs->ax = 0x014f;
Kevin O'Connor40401952011-12-31 03:43:12 -0500347}
348
349static void
350vbe_104f08(struct bregs *regs)
351{
Kevin O'Connore737b172012-02-04 11:08:39 -0500352 struct vgamode_s *vmode_g = get_current_mode();
353 if (! vmode_g)
354 goto fail;
355 u8 memmodel = GET_GLOBAL(vmode_g->memmodel);
356 if (memmodel == MM_DIRECT || memmodel == MM_YUV) {
357 regs->ax = 0x034f;
358 return;
359 }
360 if (regs->bl > 1)
361 goto fail;
362 if (regs->bl == 0) {
363 int ret = vgahw_set_dacformat(vmode_g, regs->bh);
364 if (ret < 0)
365 goto fail;
366 }
367 int ret = vgahw_get_dacformat(vmode_g);
368 if (ret < 0)
369 goto fail;
370 regs->bh = ret;
371 regs->ax = 0x004f;
372 return;
373fail:
374 regs->ax = 0x014f;
Kevin O'Connor40401952011-12-31 03:43:12 -0500375}
376
377static void
378vbe_104f0a(struct bregs *regs)
379{
380 debug_stub(regs);
381 regs->ax = 0x0100;
382}
383
384static void
Kevin O'Connor59f75d42012-01-27 20:52:29 -0500385vbe_104f10(struct bregs *regs)
386{
387 switch (regs->bl) {
388 case 0x00:
389 regs->bx = 0x0f30;
390 break;
Kevin O'Connor6fed3072014-10-30 12:09:19 -0400391 case 0x01:
392 MASK_BDA_EXT(flags, BF_PM_MASK, regs->bh & BF_PM_MASK);
Kevin O'Connor59f75d42012-01-27 20:52:29 -0500393 break;
394 case 0x02:
Kevin O'Connorf4b1dbc2014-10-21 15:15:44 -0400395 regs->bh = GET_BDA_EXT(flags) & BF_PM_MASK;
Kevin O'Connor59f75d42012-01-27 20:52:29 -0500396 break;
397 default:
398 regs->ax = 0x014f;
399 return;
400 }
401 regs->ax = 0x004f;
402}
403
404static void
Gerd Hoffmanna307d0a2019-03-19 11:09:33 +0100405vbe_104f15(struct bregs *regs)
406{
407 int offset;
408
409 switch (regs->bl) {
410 case 0x00:
411 if (GET_GLOBAL(VBE_edid[0]) != 0x00 ||
412 GET_GLOBAL(VBE_edid[1]) != 0xff)
413 goto err;
414 regs->bx = 0x0103;
415 break;
416 case 0x01:
417 offset = regs->dx * 128;
418 if (offset >= sizeof(VBE_edid))
419 goto err;
420 memcpy_far(regs->es, (void*)(regs->di+0),
421 get_global_seg(), VBE_edid + offset,
422 128);
423 break;
424 err:
425 default:
426 regs->ax = 0x014f;
427 return;
428 }
429 regs->ax = 0x004f;
430}
431
432static void
Kevin O'Connor40401952011-12-31 03:43:12 -0500433vbe_104fXX(struct bregs *regs)
434{
435 debug_stub(regs);
436 regs->ax = 0x0100;
437}
438
Kevin O'Connor6ee837b2012-02-13 20:09:02 -0500439void noinline
Kevin O'Connor40401952011-12-31 03:43:12 -0500440handle_104f(struct bregs *regs)
441{
Kevin O'Connorb3df8572012-01-15 02:43:19 -0500442 if (!CONFIG_VGA_VBE) {
Kevin O'Connor40401952011-12-31 03:43:12 -0500443 vbe_104fXX(regs);
444 return;
445 }
446
447 switch (regs->al) {
448 case 0x00: vbe_104f00(regs); break;
449 case 0x01: vbe_104f01(regs); break;
450 case 0x02: vbe_104f02(regs); break;
451 case 0x03: vbe_104f03(regs); break;
452 case 0x04: vbe_104f04(regs); break;
453 case 0x05: vbe_104f05(regs); break;
454 case 0x06: vbe_104f06(regs); break;
455 case 0x07: vbe_104f07(regs); break;
456 case 0x08: vbe_104f08(regs); break;
457 case 0x0a: vbe_104f0a(regs); break;
Kevin O'Connor59f75d42012-01-27 20:52:29 -0500458 case 0x10: vbe_104f10(regs); break;
Gerd Hoffmanna307d0a2019-03-19 11:09:33 +0100459 case 0x15: vbe_104f15(regs); break;
Kevin O'Connor40401952011-12-31 03:43:12 -0500460 default: vbe_104fXX(regs); break;
461 }
462}