2 * VESA frame buffer driver
4 * Copyright (C) 2014 Google, Inc
6 * SPDX-License-Identifier: GPL-2.0+
19 void *video_hw_init(void)
21 GraphicDevice *gdev = &ctfb;
27 if (vbe_get_video_info(gdev)) {
28 dev = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, 0);
30 printf("no card detected\n");
33 bootstage_start(BOOTSTAGE_ID_ACCUM_LCD, "vesa display");
34 ret = pci_run_vga_bios(dev, NULL, PCI_ROM_USE_NATIVE |
35 PCI_ROM_ALLOW_FALLBACK);
36 bootstage_accum(BOOTSTAGE_ID_ACCUM_LCD);
38 printf("failed to run video BIOS: %d\n", ret);
43 if (vbe_get_video_info(gdev)) {
44 printf("No video mode configured\n");
48 bits_per_pixel = gdev->gdfBytesPP * 8;
49 sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY,
51 printf("%s\n", gdev->modeIdent);
52 debug("Frame buffer at %x\n", gdev->pciBase);