Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Cleancut/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#define kGraphicsEnablerKey "GraphicsEnabler"
15
16void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4);
17
18
19void IntelGraphicsEnabler_start()
20{
21register_hook_callback("PCIDevice", &GraphicsEnabler_hook);
22}
23
24
25void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4)
26{
27pci_dt_t* current = arg1;
28
29if (current->class_id != PCI_CLASS_DISPLAY_VGA) return;
30
31char *devicepath = get_pci_dev_path(current);
32
33bool do_gfx_devprop = true;
34getBoolForKey(kGraphicsEnablerKey, &do_gfx_devprop, &bootInfo->bootConfig);
35
36if (do_gfx_devprop && (current->vendor_id == PCI_VENDOR_ID_INTEL))
37{
38verbose("Intel VGA Controller [%04x:%04x] :: %s \n",
39current->vendor_id, current->device_id, devicepath);
40setup_gma_devprop(current);
41}
42else
43verbose("[%04x:%04x] :: %s, is not a Intel VGA Controller.\n",
44current->vendor_id, current->device_id, devicepath);
45}
46

Archive Download this file

Revision: 950