Chameleon

Chameleon Svn Source Tree

Root/branches/slice/old749m/i386/modules/ATI5000Enabler/ATIEnabler.c

1/*
2 * ATIEnabler 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 "ati5.h"
13//#include "gma.h"
14#include "modules.h"
15
16
17#define kATIEnabler"ATIEnabler"
18
19
20void ATIEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4);
21
22void ATIEnabler_start()
23{
24register_hook_callback("PCIDevice", &ATIEnabler_hook);
25}
26
27
28void ATIEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4)
29{
30pci_dt_t* current = arg1;
31if(current && current->class_id == PCI_CLASS_DISPLAY_VGA)
32{
33char *devicepath = get_pci_dev_path(current);
34
35bool do_gfx_devprop = true;
36getBoolForKey(kATIEnabler, &do_gfx_devprop, &bootInfo->bootConfig);
37
38if (do_gfx_devprop)
39{
40switch (current->vendor_id)
41{
42case PCI_VENDOR_ID_ATI:
43verbose("ATI VGA Controller [%04x:%04x] :: %s \n",
44current->vendor_id, current->device_id, devicepath);
45setup_ati_devprop(current);
46break;
47
48}
49}
50
51}
52}
53

Archive Download this file

Revision: 1174