Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/i386/modules/GraphicsEnabler/GraphicsEnabler.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 "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#include "device_inject.h"
16
17
18void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6);
19void GraphicsEnabler_start(void);
20
21void GraphicsEnabler_start(void)
22{
23register_device_inject();
24register_hook_callback("PCIDevice", &GraphicsEnabler_hook);
25}
26
27void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6)
28{
29pci_dt_t* current = arg1;
30
31if(current && current->class_id == PCI_CLASS_DISPLAY_VGA)
32{
33
34switch (current->vendor_id)
35{
36case PCI_VENDOR_ID_ATI:
37
38setup_ati_devprop(current);
39break;
40
41case PCI_VENDOR_ID_INTEL:
42setup_gma_devprop(current);
43break;
44
45case PCI_VENDOR_ID_NVIDIA:
46setup_nvidia_devprop(current);
47break;
48default:
49break;
50}
51
52}
53}

Archive Download this file

Revision: 2118