1347N/A * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
1347N/A * Copyright 1993 by David Wexelblat <dwex@goblin.org>
1347N/A * Copyright 1999 by David Holland <davidh@iquest.net>
1347N/A+ * Copyright (c) 2013 Oracle
and/or its affiliates. All Rights Reserved.
1347N/A * Permission to use, copy, modify, distribute, and sell this software and its
1347N/A * documentation for any purpose is hereby granted without fee, provided that
1347N/A /* Set by -dev argument on CLI
1347N/A+#if (defined(__sparc__) || defined(__sparc))
1347N/A+static void GetFbDevFromProbe(void);
1347N/A+static Bool xf86SolarisFbDevIsSet = FALSE;
1347N/A switch_to(int vt, const char *from)
1347N/A+#if (defined(__sparc__) || defined(__sparc))
1347N/A+ if (!xf86SolarisFbDevIsSet && (stat("
/dev/fb", &buf) != 0) &&
1347N/A if (!strcmp(argv[i], "-dev")) {
1347N/A strlcpy(xf86SolarisFbDev, argv[i + 1], sizeof(xf86SolarisFbDev));
1347N/A+#if (defined(__sparc__) || defined(__sparc))
1347N/A+ xf86SolarisFbDevIsSet = TRUE;
1347N/A+#if (defined(__sparc__) || defined(__sparc))
1347N/A+ numDevs = xf86MatchDevice(xf86DriverList[0]->driverName, &devList);
1347N/A+ struct pci_device_iterator *iter;
1347N/A+ const struct pci_id_match *const devices =
1347N/A+ xf86DriverList[0]->supported_devices;
1347N/A+ struct sol_device_private {
1347N/A+ const char * device_string;
1347N/A+#define DEV_PATH(dev) (((struct sol_device_private *) dev)->device_string)
1347N/A+#define END_OF_MATCHES(m) \
1347N/A+ (((m).vendor_id == 0) && ((m).device_id == 0) && ((m).subvendor_id == 0))
1347N/A+ /* Find the pciVideoRec associated with this device section.
1347N/A+ iter = pci_id_match_iterator_create(NULL);
1347N/A+ while ((pPci = pci_device_next(iter)) != NULL) {
1347N/A+ if (devList[0]->busID && *devList[0]->busID) {
1347N/A+ if (xf86ComparePciBusString(devList[0]->busID,
1347N/A+ else if (xf86IsPrimaryPci(pPci)) {
1347N/A+ pci_iterator_destroy(iter);
1347N/A+ /* If driver provides supported_devices, then check if this
1347N/A+ device is on the list. Otherwise skip check.
1347N/A+ device_id = (devList[0]->chipID > 0)
1347N/A+ ? devList[0]->chipID : pPci->device_id;
1347N/A+ /* Once the pciVideoRec is found, determine if the device is supported
1347N/A+ for (i = 0; !END_OF_MATCHES(devices[i]); i++) {
1347N/A+ if (PCI_ID_COMPARE(devices[i].vendor_id, pPci->vendor_id)
1347N/A+ && PCI_ID_COMPARE(devices[i].device_id, device_id)
1347N/A+ && ((devices[i].device_class_mask & pPci->device_class)
1347N/A+ == devices[i].device_class)) {
1347N/A+ strcpy(xf86SolarisFbDev, "/devices");
1347N/A+ strcat(xf86SolarisFbDev, DEV_PATH(pPci));
1347N/A+ xf86Msg(X_INFO, "Got xf86SolarisFbDev From Probe: %s\n", xf86SolarisFbDev);