Chameleon

Chameleon Svn Source Tree

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

Source at commit 1166 created 13 years 10 days ago.
By meklort, Fixed recent Makefile changes. Please do not use /Users/evan/SourceCode/tmp/chameleon/trunk or VPATH. the *only* time you should use /Users/evan/SourceCode/tmp/chameleon/trunk is when setting the SRCROOT variable. Also note that very soon make pkg is going to be removed. The pkg build script in trunk is very out of date. Instead please use the package maker at http://forge.voodooprojects.org/p/chameleonApplications/. Once this is ready for trunk it will be merged.
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
17#define kGraphicsEnabler"GraphicsEnabler"
18
19
20void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4);
21
22void GraphicsEnabler_start()
23{
24register_hook_callback("PCIDevice", &GraphicsEnabler_hook);
25}
26
27
28void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4)
29{
30pci_dt_t* current = arg1;
31if(current && current->class_id == PCI_CLASS_DISPLAY_VGA)
32{
33char *devicepath = get_pci_dev_path(current);
34
35bool do_gfx_devprop = true;
36getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig);
37
38
39if (do_gfx_devprop)
40{
41switch (current->vendor_id)
42{
43case PCI_VENDOR_ID_ATI:
44verbose("ATI VGA Controller [%04x:%04x] :: %s \n",
45current->vendor_id, current->device_id, devicepath);
46setup_ati_devprop(current);
47break;
48
49case PCI_VENDOR_ID_INTEL:
50setup_gma_devprop(current);
51break;
52
53case PCI_VENDOR_ID_NVIDIA:
54setup_nvidia_devprop(current);
55break;
56}
57}
58
59}
60}
61

Archive Download this file

Revision: 1166