Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Cleancut/i386/modules/GraphicsEnablerLegacy/GraphicsEnablerLegacy.c

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 "saio_internal.h"
9#include "bootstruct.h"
10#include "../modules/GraphicsEnablerLegacy/pci_old.h"
11#include "nvidia.h"
12#include "ati.h"
13#include "gma.h"
14#include "modules.h"
15
16#define kGraphicsEnabler"GraphicsEnabler"
17
18void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4);
19
20void GraphicsEnablerLegacy_start()
21{
22register_hook_callback("PCIDevice", &GraphicsEnabler_hook);
23}
24
25
26void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4)
27{
28pci_dt_t* current = arg1;
29
30if(current->class_id != PCI_CLASS_DISPLAY_VGA) return;
31
32char *devicepath = get_pci_dev_path(current);
33
34bool do_gfx_devprop = true;
35getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig);
36
37if (do_gfx_devprop)
38{
39switch (current->vendor_id)
40{
41case PCI_VENDOR_ID_ATI:
42verbose("ATI VGA Controller [%04x:%04x] :: %s \n",
43current->vendor_id, current->device_id, devicepath);
44setup_ati_devprop(current);
45break;
46
47case PCI_VENDOR_ID_INTEL:
48verbose("Intel Graphics Controller [%04x:%04x] :: %s \n",
49current->vendor_id, current->device_id, devicepath);
50setup_gma_devprop(current);
51break;
52
53case PCI_VENDOR_ID_NVIDIA:
54setup_nvidia_devprop(current);
55break;
56}
57}
58}
59

Archive Download this file

Revision: 845