Don't add an agp child in vgapci's attach routine if the PCIY_AGP
capability is present as not all devices supported by the agp_i810 driver (such as i915) have the AGP capability. Instead, add an identify routine to the agp_i810 driver that uses the PCI ID to determine if it should create an agp child device.
This commit is contained in:
parent
41ffd5b92b
commit
16c9ed73d6
@ -194,6 +194,15 @@ agp_i810_find_bridge(device_t dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
agp_i810_identify(driver_t *driver, device_t parent)
|
||||
{
|
||||
|
||||
if (device_find_child(parent, "agp", -1) == NULL &&
|
||||
agp_i810_match(parent))
|
||||
device_add_child(parent, "agp", -1);
|
||||
}
|
||||
|
||||
static int
|
||||
agp_i810_probe(device_t dev)
|
||||
{
|
||||
@ -799,6 +808,7 @@ agp_i810_unbind_memory(device_t dev, struct agp_memory *mem)
|
||||
|
||||
static device_method_t agp_i810_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_identify, agp_i810_identify),
|
||||
DEVMETHOD(device_probe, agp_i810_probe),
|
||||
DEVMETHOD(device_attach, agp_i810_attach),
|
||||
DEVMETHOD(device_detach, agp_i810_detach),
|
||||
|
@ -70,13 +70,6 @@ vga_pci_attach(device_t dev)
|
||||
|
||||
bus_generic_probe(dev);
|
||||
|
||||
/*
|
||||
* If AGP capabilities are present on this device, then create
|
||||
* an AGP child.
|
||||
*/
|
||||
if (pci_find_extcap(dev, PCIY_AGP, NULL) == 0)
|
||||
device_add_child(dev, "agp", -1);
|
||||
|
||||
/* Always create a drm child for now to make it easier on drm. */
|
||||
device_add_child(dev, "drm", -1);
|
||||
bus_generic_attach(dev);
|
||||
|
@ -194,6 +194,15 @@ agp_i810_find_bridge(device_t dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
agp_i810_identify(driver_t *driver, device_t parent)
|
||||
{
|
||||
|
||||
if (device_find_child(parent, "agp", -1) == NULL &&
|
||||
agp_i810_match(parent))
|
||||
device_add_child(parent, "agp", -1);
|
||||
}
|
||||
|
||||
static int
|
||||
agp_i810_probe(device_t dev)
|
||||
{
|
||||
@ -799,6 +808,7 @@ agp_i810_unbind_memory(device_t dev, struct agp_memory *mem)
|
||||
|
||||
static device_method_t agp_i810_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_identify, agp_i810_identify),
|
||||
DEVMETHOD(device_probe, agp_i810_probe),
|
||||
DEVMETHOD(device_attach, agp_i810_attach),
|
||||
DEVMETHOD(device_detach, agp_i810_detach),
|
||||
|
Loading…
x
Reference in New Issue
Block a user