| * VESA frame buffer driver |
| * Copyright (C) 2014 Google, Inc |
| * SPDX-License-Identifier: GPL-2.0+ |
| void *video_hw_init(void) |
| GraphicDevice *gdev = &ctfb; |
| * If we are running from EFI or coreboot, this driver can't |
| printf("Not available (previous bootloader prevents it)\n"); |
| if (vbe_get_video_info(gdev)) { |
| ret = dm_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, 0, &dev); |
| printf("no card detected\n"); |
| bootstage_start(BOOTSTAGE_ID_ACCUM_LCD, "vesa display"); |
| ret = dm_pci_run_vga_bios(dev, NULL, PCI_ROM_USE_NATIVE | |
| bootstage_accum(BOOTSTAGE_ID_ACCUM_LCD); |
| printf("failed to run video BIOS: %d\n", ret); |
| if (vbe_get_video_info(gdev)) { |
| printf("No video mode configured\n"); |
| bits_per_pixel = gdev->gdfBytesPP * 8; |
| sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY, |
| printf("%s\n", gdev->modeIdent); |
| debug("Frame buffer at %x\n", gdev->pciBase); |