1 | /*␊ |
2 | * GraphicsEnabler Module␊ |
3 | *␉Enabled many nvidia and ati cards to be used out of the box in ␊ |
4 | *␉OS X. This was converted from boot2 code to a boot2 module.␊ |
5 | *␊ |
6 | */␊ |
7 | ␊ |
8 | #include "libsaio.h"␊ |
9 | #include "pci.h"␊ |
10 | #include "bootstruct.h"␊ |
11 | #include "nvidia.h"␊ |
12 | #include "ati.h"␊ |
13 | #include "gma.h"␊ |
14 | #include "modules.h"␊ |
15 | ␊ |
16 | ␊ |
17 | void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6);␊ |
18 | void GraphicsEnabler_start(void);␊ |
19 | ␊ |
20 | void GraphicsEnabler_start(void)␊ |
21 | {␊ |
22 | ␉register_hook_callback("PCIDevice", &GraphicsEnabler_hook);␊ |
23 | }␊ |
24 | ␊ |
25 | void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6)␊ |
26 | {␉␊ |
27 | ␉pci_dt_t* current = arg1;␊ |
28 | ␉␊ |
29 | ␉if(current && current->class_id == PCI_CLASS_DISPLAY_VGA)␊ |
30 | ␉{␊ |
31 | ␊ |
32 | ␉␉switch (current->vendor_id)␊ |
33 | ␉␉{␊ |
34 | ␉␉␉case PCI_VENDOR_ID_ATI:␊ |
35 | ␉␉␉␉␊ |
36 | ␉␉␉␉setup_ati_devprop(current);␊ |
37 | ␉␉␉␉break;␊ |
38 | ␉␉␉␉␊ |
39 | ␉␉␉case PCI_VENDOR_ID_INTEL: ␊ |
40 | ␉␉␉␉setup_gma_devprop(current);␊ |
41 | ␉␉␉␉break;␊ |
42 | ␊ |
43 | ␉␉␉case PCI_VENDOR_ID_NVIDIA: ␊ |
44 | ␉␉␉␉setup_nvidia_devprop(current);␊ |
45 | ␉␉␉␉break;␊ |
46 | ␉␉␉default:␊ |
47 | ␉␉␉␉break;␊ |
48 | ␉␉}␉␉␊ |
49 | ␊ |
50 | ␉}␊ |
51 | } |