Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Cleancut/i386/modules/ATIEnablerLegacy/ATIEnablerLegacy.c

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 "saio_internal.h"
9#include "bootstruct.h"
10#include "../modules/ATIEnablerLegacy/pci_old.h"
11#include "ati.h"
12#include "modules.h"
13
14
15#define kGraphicsEnablerKey"GraphicsEnabler" // change?
16
17void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4);
18
19
20void ATIEnablerLegacy_start()
21{
22register_hook_callback("PCIDevice", &GraphicsEnabler_hook);
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
36//Azi: ati.c doesn't seem to have "fail" code... check better!***
37if (do_gfx_devprop && (current->vendor_id == PCI_VENDOR_ID_ATI))
38{
39verbose("ATI VGA Controller [%04x:%04x] :: %s \n",
40current->vendor_id, current->device_id, devicepath);
41setup_ati_devprop(current);
42}
43else
44verbose("Not an ATI card...??\n");
45}
46

Archive Download this file

Revision: 862