1bf215546Sopenharmony_ci#ifndef _PCI_ID_DRIVER_MAP_H_ 2bf215546Sopenharmony_ci#define _PCI_ID_DRIVER_MAP_H_ 3bf215546Sopenharmony_ci 4bf215546Sopenharmony_ci#include <stdbool.h> 5bf215546Sopenharmony_ci#include <stddef.h> 6bf215546Sopenharmony_ci 7bf215546Sopenharmony_ci#ifndef __IS_LOADER 8bf215546Sopenharmony_ci# error "Only include from loader.c" 9bf215546Sopenharmony_ci#endif 10bf215546Sopenharmony_ci 11bf215546Sopenharmony_cistatic const int i915_chip_ids[] = { 12bf215546Sopenharmony_ci#define CHIPSET(chip, desc, name) chip, 13bf215546Sopenharmony_ci#include "pci_ids/i915_pci_ids.h" 14bf215546Sopenharmony_ci#undef CHIPSET 15bf215546Sopenharmony_ci}; 16bf215546Sopenharmony_ci 17bf215546Sopenharmony_cistatic const int crocus_chip_ids[] = { 18bf215546Sopenharmony_ci#define CHIPSET(chip, family, family_str, name) chip, 19bf215546Sopenharmony_ci#include "pci_ids/crocus_pci_ids.h" 20bf215546Sopenharmony_ci#undef CHIPSET 21bf215546Sopenharmony_ci}; 22bf215546Sopenharmony_ci 23bf215546Sopenharmony_cistatic const int r300_chip_ids[] = { 24bf215546Sopenharmony_ci#define CHIPSET(chip, name, family) chip, 25bf215546Sopenharmony_ci#include "pci_ids/r300_pci_ids.h" 26bf215546Sopenharmony_ci#undef CHIPSET 27bf215546Sopenharmony_ci}; 28bf215546Sopenharmony_ci 29bf215546Sopenharmony_cistatic const int r600_chip_ids[] = { 30bf215546Sopenharmony_ci#define CHIPSET(chip, name, family) chip, 31bf215546Sopenharmony_ci#include "pci_ids/r600_pci_ids.h" 32bf215546Sopenharmony_ci#undef CHIPSET 33bf215546Sopenharmony_ci}; 34bf215546Sopenharmony_ci 35bf215546Sopenharmony_cistatic const int virtio_gpu_chip_ids[] = { 36bf215546Sopenharmony_ci#define CHIPSET(chip, name, family) chip, 37bf215546Sopenharmony_ci#include "pci_ids/virtio_gpu_pci_ids.h" 38bf215546Sopenharmony_ci#undef CHIPSET 39bf215546Sopenharmony_ci}; 40bf215546Sopenharmony_ci 41bf215546Sopenharmony_cistatic const int vmwgfx_chip_ids[] = { 42bf215546Sopenharmony_ci#define CHIPSET(chip, name, family) chip, 43bf215546Sopenharmony_ci#include "pci_ids/vmwgfx_pci_ids.h" 44bf215546Sopenharmony_ci#undef CHIPSET 45bf215546Sopenharmony_ci}; 46bf215546Sopenharmony_ci 47bf215546Sopenharmony_cibool is_kernel_i915(int fd); 48bf215546Sopenharmony_ci 49bf215546Sopenharmony_cistatic const struct { 50bf215546Sopenharmony_ci int vendor_id; 51bf215546Sopenharmony_ci const char *driver; 52bf215546Sopenharmony_ci const int *chip_ids; 53bf215546Sopenharmony_ci int num_chips_ids; 54bf215546Sopenharmony_ci bool (*predicate)(int fd); 55bf215546Sopenharmony_ci} driver_map[] = { 56bf215546Sopenharmony_ci { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, 57bf215546Sopenharmony_ci { 0x8086, "crocus", crocus_chip_ids, ARRAY_SIZE(crocus_chip_ids) }, 58bf215546Sopenharmony_ci { 0x8086, "iris", NULL, -1, is_kernel_i915 }, 59bf215546Sopenharmony_ci { 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) }, 60bf215546Sopenharmony_ci { 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) }, 61bf215546Sopenharmony_ci { 0x1002, "radeonsi", NULL, -1 }, 62bf215546Sopenharmony_ci { 0x10de, "nouveau", NULL, -1, }, 63bf215546Sopenharmony_ci { 0x1af4, "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) }, 64bf215546Sopenharmony_ci { 0x15ad, "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) }, 65bf215546Sopenharmony_ci}; 66bf215546Sopenharmony_ci 67bf215546Sopenharmony_ci#endif /* _PCI_ID_DRIVER_MAP_H_ */ 68