1 #ifndef _PCI_ID_DRIVER_MAP_H_
2 #define _PCI_ID_DRIVER_MAP_H_
3 
4 #include <stddef.h>
5 
6 #ifndef ARRAY_SIZE
7 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
8 #endif
9 
10 #if !defined(DRIVER_MAP_DRI2_ONLY) && !defined(DRIVER_MAP_GALLIUM_ONLY)
11 static const int i810_chip_ids[] = {
12 #define CHIPSET(chip, desc, misc) chip,
13 #include "pci_ids/i810_pci_ids.h"
14 #undef CHIPSET
15 };
16 #endif
17 
18 static const int i915_chip_ids[] = {
19 #define CHIPSET(chip, desc, misc) chip,
20 #include "pci_ids/i915_pci_ids.h"
21 #undef CHIPSET
22 };
23 
24 static const int i965_chip_ids[] = {
25 #define CHIPSET(chip, desc, misc) chip,
26 #include "pci_ids/i965_pci_ids.h"
27 #undef CHIPSET
28 };
29 
30 #ifndef DRIVER_MAP_GALLIUM_ONLY
31 static const int r100_chip_ids[] = {
32 #define CHIPSET(chip, name, family) chip,
33 #include "pci_ids/radeon_pci_ids.h"
34 #undef CHIPSET
35 };
36 
37 static const int r200_chip_ids[] = {
38 #define CHIPSET(chip, name, family) chip,
39 #include "pci_ids/r200_pci_ids.h"
40 #undef CHIPSET
41 };
42 #endif
43 
44 static const int r300_chip_ids[] = {
45 #define CHIPSET(chip, name, family) chip,
46 #include "pci_ids/r300_pci_ids.h"
47 #undef CHIPSET
48 };
49 
50 static const int r600_chip_ids[] = {
51 #define CHIPSET(chip, name, family) chip,
52 #include "pci_ids/r600_pci_ids.h"
53 #undef CHIPSET
54 };
55 
56 static const int vmwgfx_chip_ids[] = {
57 #define CHIPSET(chip, name, family) chip,
58 #include "pci_ids/vmwgfx_pci_ids.h"
59 #undef CHIPSET
60 };
61 
62 static const struct {
63    int vendor_id;
64    const char *driver;
65    const int *chip_ids;
66    int num_chips_ids;
67 } driver_map[] = {
68 #if !defined(DRIVER_MAP_DRI2_ONLY) && !defined(DRIVER_MAP_GALLIUM_ONLY)
69    { 0x8086, "i810", i810_chip_ids, ARRAY_SIZE(i810_chip_ids) },
70 #endif
71    { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
72    { 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
73 #ifndef DRIVER_MAP_GALLIUM_ONLY
74    { 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) },
75    { 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) },
76 #endif
77    { 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
78    { 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
79    { 0x10de, "nouveau", NULL, -1 },
80    { 0x15ad, "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) },
81    { 0x0000, NULL, NULL, 0 },
82 };
83 
84 #endif /* _PCI_ID_DRIVER_MAP_H_ */
85