Chameleon

Chameleon Svn Source Tree

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

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

Archive Download this file

Revision: 1515