Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Chazi/i386/modules/IntelGraphicsEnabler/IntelGraphicsEnabler.c

1/*
2 * IntelGraphicsEnabler Module ---
3 * Enables "some" Intel cards to be used out of the box ?? in OS X.
4 * This was converted from ... // AutoResolution reminder ---
5 *
6 */
7
8#include "saio_internal.h"
9#include "bootstruct.h"
10#include "pci.h"
11#include "gma.h"
12#include "modules.h"
13
14
15#define kGraphicsEnablerKey"GraphicsEnabler"
16
17void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4);
18
19
20void IntelGraphicsEnabler_start()
21{
22register_hook_callback("PCIDevice", &GraphicsEnabler_hook);
23}
24
25
26void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4)
27{
28pci_dt_t* current = arg1;
29
30if (current->class_id != PCI_CLASS_DISPLAY_VGA) return;
31
32char *devicepath = get_pci_dev_path(current);
33
34bool do_gfx_devprop = true;
35getBoolForKey(kGraphicsEnablerKey, &do_gfx_devprop, &bootInfo->bootConfig);
36
37if (do_gfx_devprop && (current->vendor_id == PCI_VENDOR_ID_INTEL))
38{
39verbose("Intel VGA Controller [%04x:%04x] :: %s \n",
40current->vendor_id, current->device_id, devicepath);
41setup_gma_devprop(current);
42}
43else
44verbose("[%04x:%04x] :: %s, is not a Intel VGA Controller.\n",
45current->vendor_id, current->device_id, devicepath);
46}
47

Archive Download this file

Revision: 875