Пример #1
0
static Bool
intel_xorg_pci_probe(DriverPtr driver,
                     int entity_num, struct pci_device *device, intptr_t match_data)
{
    ScrnInfoPtr scrn = NULL;

    scrn = xf86ConfigPciEntity(scrn, 0, entity_num, intel_xorg_pci_devices,
                               NULL, NULL, NULL, NULL, NULL);
    if (scrn != NULL) {
        scrn->driverVersion = 1;
        scrn->driverName = "i915";
        scrn->name = "modesetting";
        scrn->Probe = NULL;

        /* Use all the functions from the xorg tracker */
        xorg_tracker_set_functions(scrn);
    }
    return scrn != NULL;
}
Пример #2
0
static Bool
r600_xorg_pci_probe(DriverPtr driver,
	  int entity_num, struct pci_device *device, intptr_t match_data)
{
    ScrnInfoPtr scrn = NULL;
    EntityInfoPtr entity;

    scrn = xf86ConfigPciEntity(scrn, 0, entity_num, r600_xorg_pci_devices,
			       NULL, NULL, NULL, NULL, NULL);
    if (scrn != NULL) {
	scrn->driverVersion = 1;
	scrn->driverName = "r600";
	scrn->name = "R600G";
	scrn->Probe = NULL;

	entity = xf86GetEntityInfo(entity_num);

	/* Use all the functions from the xorg tracker */
	xorg_tracker_set_functions(scrn);
    }
    return scrn != NULL;
}
Пример #3
0
static Bool
nouveau_xorg_pci_probe(DriverPtr driver,
	  int entity_num, struct pci_device *device, intptr_t match_data)
{
    ScrnInfoPtr scrn = NULL;
    struct nouveau_device *dev = NULL;
    char *busid;
    int chipset, ret;

    busid = malloc(64);
    if (!busid)
	return FALSE;

    sprintf(busid, "pci:%04x:%02x:%02x.%d",
	    device->domain, device->bus,
	    device->dev, device->func);

    ret = drmCheckModesettingSupported(busid);
    if (ret) {
	xf86DrvMsg(-1, X_ERROR, "[drm] KMS not enabled\n");
	free(busid);
	return FALSE;
    }

    ret = nouveau_device_open(busid, &dev);
    free(busid);
    if (ret) {
	xf86DrvMsg(-1, X_ERROR, "[drm] failed to open device\n");
	return FALSE;
    }

    chipset = dev->chipset;
    nouveau_device_del(&dev);

    switch (chipset & 0xf0) {
    case 0x00:
    case 0x10:
    case 0x20:
	xf86DrvMsg(-1, X_NOTICE, "Too old chipset: NV%02x\n", chipset);
	return FALSE;
    case 0x30:
    case 0x40:
    case 0x60:
    case 0x50:
    case 0x80:
    case 0x90:
    case 0xa0:
    case 0xc0:
    case 0xd0:
    case 0xe0:
    case 0xf0:
	xf86DrvMsg(-1, X_INFO, "Detected chipset: NV%02x\n", chipset);
	break;
    default:
	xf86DrvMsg(-1, X_ERROR, "Unknown chipset: NV%02x\n", chipset);
	return FALSE;
    }

    scrn = xf86ConfigPciEntity(scrn, 0, entity_num, nouveau_xorg_pci_devices,
			       NULL, NULL, NULL, NULL, NULL);
    if (scrn != NULL) {
	scrn->driverVersion = 1;
	scrn->driverName = "nouveau";
	scrn->name = "nouveau2";
	scrn->Probe = NULL;

	/* Use all the functions from the xorg tracker */
	xorg_tracker_set_functions(scrn);
    }
    return scrn != NULL;
}