1 | /*␊ |
2 | * ATIGraphicsEnabler Module ---␊ |
3 | *␉ Enables many ati "legacy ??" cards to be used out of the box in OS X.␊ |
4 | * This was converted from ( < r784) boot2 code to a boot2 module.␊ |
5 | *␊ |
6 | */␊ |
7 | ␊ |
8 | #include "saio_internal.h"␊ |
9 | #include "bootstruct.h"␊ |
10 | #include "pci.h"␊ |
11 | #include "ati.h"␊ |
12 | #include "modules.h"␊ |
13 | ␊ |
14 | ␊ |
15 | #define kGraphicsEnablerKey␉␉"GraphicsEnabler" // change?␊ |
16 | ␊ |
17 | void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4);␊ |
18 | ␊ |
19 | ␊ |
20 | void ATiGraphicsEnabler_start()␊ |
21 | {␊ |
22 | ␉register_hook_callback("PCIDevice", &GraphicsEnabler_hook);␊ |
23 | }␊ |
24 | ␊ |
25 | ␊ |
26 | void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4)␊ |
27 | {␊ |
28 | ␉pci_dt_t* current = arg1;␊ |
29 | ␉␊ |
30 | ␉if (current->class_id != PCI_CLASS_DISPLAY_VGA) return;␊ |
31 | ␉␊ |
32 | ␉char *devicepath = get_pci_dev_path(current);␊ |
33 | ␉␊ |
34 | ␉bool do_gfx_devprop = true;␊ |
35 | ␉getBoolForKey(kGraphicsEnablerKey, &do_gfx_devprop, &bootInfo->bootConfig);␊ |
36 | ␉␊ |
37 | ␉// AMD ?? i don't find any vga 1022 vendor!.. thou ATI isn't used anymore!␊ |
38 | ␉if (do_gfx_devprop && (current->vendor_id == PCI_VENDOR_ID_ATI))␊ |
39 | ␉{␊ |
40 | ␉␉verbose("ATI VGA Controller [%04x:%04x] :: %s \n", ␊ |
41 | ␉␉␉␉current->vendor_id, current->device_id, devicepath);␊ |
42 | ␉␉setup_ati_devprop(current);␊ |
43 | ␉}␊ |
44 | ␉else␊ |
45 | ␉␉verbose("[%04x:%04x] :: %s, is not a AMD/ATI VGA Controller.\n",// amd ??␊ |
46 | ␉␉␉␉current->vendor_id, current->device_id, devicepath);␊ |
47 | }␊ |
48 | |