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

Archive Download this file

Revision: 2006