3 * Vesa frame buffer driver for x86
5 * Copyright (C) 2014 Google, Inc
7 * SPDX-License-Identifier: GPL-2.0+
20 /* Devices to allow - only the last one works fully */
21 struct pci_device_id vesa_video_ids[] = {
22 { .vendor = 0x102b, .device = 0x0525 },
23 { .vendor = 0x1002, .device = 0x5159 },
24 { .vendor = 0x1002, .device = 0x4752 },
25 { .vendor = 0x1002, .device = 0x5452 },
29 void *video_hw_init(void)
31 GraphicDevice *gdev = &ctfb;
37 if (vbe_get_video_info(gdev)) {
38 /* TODO: Should we look these up by class? */
39 dev = pci_find_devices(vesa_video_ids, 0);
41 printf("no card detected\n");
44 printf("bdf %x\n", dev);
45 ret = pci_run_vga_bios(dev, NULL, true);
47 printf("failed to run video BIOS: %d\n", ret);
52 if (vbe_get_video_info(gdev)) {
53 printf("No video mode configured\n");
57 bits_per_pixel = gdev->gdfBytesPP * 8;
58 sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY,
60 printf("%s\n", gdev->modeIdent);
61 debug("Framex buffer at %x\n", gdev->pciBase);