Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/modules/GraphicsEnabler/GraphicsEnabler.c

Source at commit 550 created 13 years 7 months ago.
By meklort, Removed static keyword from moduels. Fixed a few issues. NOTE: ACPI module is currently required for a proper boot.
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 "modules.h"
14
15
16#define kGraphicsEnabler"GraphicsEnabler"
17
18void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4);
19
20void GraphicsEnabler_start()
21{
22register_hook_callback("PCIDevice", &GraphicsEnabler_hook);
23}
24
25
26void GraphicsEnabler_hook(pci_dt_t* current, void* arg2, void* arg3, void* arg4)
27{
28if(current->class_id != PCI_CLASS_DISPLAY_VGA) return;
29
30char *devicepath = get_pci_dev_path(current);
31
32bool do_gfx_devprop = false;
33getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig);
34
35if (do_gfx_devprop)
36{
37switch (current->vendor_id)
38{
39case PCI_VENDOR_ID_ATI:
40verbose("ATI VGA Controller [%04x:%04x] :: %s \n",
41current->vendor_id, current->device_id, devicepath);
42setup_ati_devprop(current);
43break;
44
45case PCI_VENDOR_ID_INTEL:
46//message to be removed once support for these cards is added
47verbose("Intel VGA Controller [%04x:%04x] :: %s (currently NOT SUPPORTED)\n",
48current->vendor_id, current->device_id, devicepath);
49break;
50
51case PCI_VENDOR_ID_NVIDIA:
52setup_nvidia_devprop(current);
53break;
54}
55}
56
57
58}
59

Archive Download this file

Revision: 550