Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Chazi/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 "bootstruct.h"
10#include "boot.h"
11#include "pci.h"
12#include "nvidia.h"
13#include "ati.h"
14#include "gma.h" //Azi:autoresolution
15#include "modules.h"
16
17
18//#define kGraphicsEnabler"GraphicsEnabler"
19
20void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4);
21
22void GraphicsEnabler_start()
23{
24register_hook_callback(kGraphicsEnablerKey, &GraphicsEnabler_hook);
25}
26
27
28void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4)
29{
30pci_dt_t* current = arg1;
31char *devicepath = get_pci_dev_path(current);
32
33bool do_gfx_devprop = false;
34getBoolForKey(kGraphicsEnablerKey, &do_gfx_devprop, &bootInfo->bootConfig);
35
36if (do_gfx_devprop)
37{
38switch (current->vendor_id)
39{
40case PCI_VENDOR_ID_ATI:
41verbose("ATI VGA Controller [%04x:%04x] :: %s \n",
42current->vendor_id, current->device_id, devicepath);
43setup_ati_devprop(current);
44break;
45
46case PCI_VENDOR_ID_INTEL: // AutoResolution
47verbose("Intel Graphics Controller [%04x:%04x] :: %s \n",
48current->vendor_id, current->device_id, devicepath);
49setup_gma_devprop(current);
50break;
51//message to be removed once support for these cards is added
52//verbose("Intel VGA Controller [%04x:%04x] :: %s (currently NOT SUPPORTED)\n",
53//current->vendor_id, current->device_id, devicepath);
54//break;
55
56case PCI_VENDOR_ID_NVIDIA:
57setup_nvidia_devprop(current);
58break;
59}
60}
61}
62

Archive Download this file

Revision: 524