Ejemplo n.º 1
0
static Bool
intel_platform_probe(DriverPtr driver,
		     int entity_num, int flags,
		     struct xf86_platform_device *dev,
		     intptr_t match_data)
{
	ScrnInfoPtr scrn = NULL;
	char *path = xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_PATH);
	unsigned scrn_flags = 0;

	if (!dev->pdev)
		return FALSE;

	if (!has_kernel_mode_setting(dev->pdev))
		return FALSE;

	/* Allow ourselves to act as a slaved output if not primary */
	if (flags & PLATFORM_PROBE_GPU_SCREEN) {
		flags &= ~PLATFORM_PROBE_GPU_SCREEN;
		scrn_flags |= XF86_ALLOCATE_GPU_SCREEN;
	}

	/* if we get any flags we don't understand fail to probe for now */
	if (flags)
		return FALSE;

	scrn = xf86AllocateScreen(driver, scrn_flags);
	if (scrn == NULL)
		return FALSE;

	scrn->driverVersion = INTEL_VERSION;
	scrn->driverName = INTEL_DRIVER_NAME;
	scrn->name = INTEL_NAME;
	scrn->driverPrivate = (void *)(match_data | 1);
	scrn->Probe = NULL;

	if (xf86IsEntitySharable(entity_num))
		xf86SetEntityShared(entity_num);
	xf86AddEntityToScreen(scrn, entity_num);

	xf86DrvMsg(scrn->scrnIndex, X_INFO,
		   "using device path '%s'\n", path ? path : "Default device");

#if !UMS_ONLY
	switch (get_accel_method()) {
#if USE_SNA
        case SNA: return sna_init_scrn(scrn, entity_num);
#endif
#if USE_UXA
        case UXA: return intel_init_scrn(scrn);
#endif

	default: break;
	}
#endif

	return FALSE;
}
Ejemplo n.º 2
0
/*
 * intel_pci_probe --
 *
 * Look through the PCI bus to find cards that are intel boards.
 * Setup the dispatch table for the rest of the driver functions.
 *
 */
static Bool intel_pci_probe(DriverPtr		driver,
			    int			entity_num,
			    struct pci_device	*device,
			    intptr_t		match_data)
{
	ScrnInfoPtr scrn;
	PciChipsets intel_pci_chipsets[ARRAY_SIZE(intel_chipsets)];
	int i;

	chipset_info = (void *)match_data;


	for (i = 0; i < ARRAY_SIZE(intel_chipsets); i++) {
		intel_pci_chipsets[i].numChipset = intel_chipsets[i].token;
		intel_pci_chipsets[i].PCIid = intel_chipsets[i].token;
		intel_pci_chipsets[i].dummy = NULL;
	}

	scrn = xf86ConfigPciEntity(NULL, 0, entity_num, intel_pci_chipsets,
				   NULL, NULL, NULL, NULL, NULL);
	if (scrn != NULL) {
		scrn->driverVersion = INTEL_VERSION;
		scrn->driverName = INTEL_DRIVER_NAME;
		scrn->name = INTEL_NAME;
		scrn->Probe = NULL;

#if KMS_ONLY
		intel_init_scrn(scrn);
#else
		switch (DEVICE_ID(device)) {
		case PCI_CHIP_I810:
		case PCI_CHIP_I810_DC100:
		case PCI_CHIP_I810_E:
		case PCI_CHIP_I815:
			lg_i810_init(scrn);
			break;

		default:
			intel_init_scrn(scrn);
			break;
		}
#endif
	}
	return scrn != NULL;
}
static Bool
intel_scrn_create(DriverPtr		driver,
		  int			entity_num,
		  intptr_t		match_data,
		  unsigned		flags)
{
	ScrnInfoPtr scrn;

	scrn = xf86AllocateScreen(driver, flags);
	if (scrn == NULL)
		return FALSE;

	scrn->driverVersion = INTEL_VERSION;
	scrn->driverName = INTEL_DRIVER_NAME;
	scrn->name = INTEL_NAME;
	scrn->driverPrivate = (void *)(match_data | 1);
	scrn->Probe = NULL;

	if (xf86IsEntitySharable(entity_num))
		xf86SetEntityShared(entity_num);
	xf86AddEntityToScreen(scrn, entity_num);

#if !KMS_ONLY
	if ((unsigned)((struct intel_device_info *)match_data)->gen < 020)
		return lg_i810_init(scrn);
#endif

#if !UMS_ONLY
	switch (get_accel_method()) {
#if USE_SNA
	case SNA: return sna_init_scrn(scrn, entity_num);
#endif
#if USE_UXA
	case UXA: return intel_init_scrn(scrn);
#endif

	default: break;
	}
#endif

	return FALSE;
}
Ejemplo n.º 4
0
/*
 * intel_pci_probe --
 *
 * Look through the PCI bus to find cards that are intel boards.
 * Setup the dispatch table for the rest of the driver functions.
 *
 */
static Bool intel_pci_probe(DriverPtr		driver,
			    int			entity_num,
			    struct pci_device	*device,
			    intptr_t		match_data)
{
	ScrnInfoPtr scrn;
	PciChipsets intel_pci_chipsets[NUM_CHIPSETS];
	unsigned i;

	if (!has_kernel_mode_setting(device)) {
#if KMS_ONLY
		return FALSE;
#else
		switch (DEVICE_ID(device)) {
		case PCI_CHIP_I810:
		case PCI_CHIP_I810_DC100:
		case PCI_CHIP_I810_E:
		case PCI_CHIP_I815:
			break;
		default:
			return FALSE;
		}
#endif
	}

	for (i = 0; i < NUM_CHIPSETS; i++) {
		intel_pci_chipsets[i].numChipset = intel_chipsets[i].token;
		intel_pci_chipsets[i].PCIid = intel_chipsets[i].token;
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,6,99,0,0)
		intel_pci_chipsets[i].resList = RES_SHARED_VGA;
#else
		intel_pci_chipsets[i].dummy = NULL;
#endif
	}

	scrn = xf86ConfigPciEntity(NULL, 0, entity_num, intel_pci_chipsets,
				   NULL, NULL, NULL, NULL, NULL);
	if (scrn == NULL)
		return FALSE;

	scrn->driverVersion = INTEL_VERSION;
	scrn->driverName = INTEL_DRIVER_NAME;
	scrn->name = INTEL_NAME;
	scrn->driverPrivate = (void *)(match_data | 1);
	scrn->Probe = NULL;

#if !KMS_ONLY
	switch (DEVICE_ID(device)) {
	case PCI_CHIP_I810:
	case PCI_CHIP_I810_DC100:
	case PCI_CHIP_I810_E:
	case PCI_CHIP_I815:
		return lg_i810_init(scrn);
	}
#endif

#if !UMS_ONLY
	switch (get_accel_method()) {
#if USE_SNA
	case SNA: return sna_init_scrn(scrn, entity_num);
#endif

#if USE_UXA
	case UXA: return intel_init_scrn(scrn);
#endif

	default: break;
	}
#endif

	return FALSE;
}