pulseaudio: fix dependencies for openssl-3
[oi-userland.git] / components / x11 / xorg-server / patches / 26-sparc-config-improv.patch
blobcd9bdab04e5a90799e37b60b04e48a9a5f6176b9
1 --- a/hw/xfree86/os-support/solaris/sun_init.c Fri Jun 5 12:41:14 2015
2 +++ b/hw/xfree86/os-support/solaris/sun_init.c Fri Jun 5 12:48:06 2015
3 @@ -2,6 +2,7 @@
4 * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
5 * Copyright 1993 by David Wexelblat <dwex@goblin.org>
6 * Copyright 1999 by David Holland <davidh@iquest.net>
7 + * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
9 * Permission to use, copy, modify, distribute, and sell this software and its
10 * documentation for any purpose is hereby granted without fee, provided that
11 @@ -64,6 +65,11 @@
12 Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */
13 _X_HIDDEN char xf86SolarisFbDev[PATH_MAX] = "/dev/fb";
15 +#if (defined(__sparc__) || defined(__sparc))
16 +static void GetFbDevFromProbe(void);
17 +static Bool xf86SolarisFbDevIsSet = FALSE;
18 +#endif
20 static void
21 switch_to(int vt, const char *from)
23 @@ -97,6 +103,16 @@
24 if (geteuid() != 0)
25 FatalError("xf86OpenConsole: Server must be suid root\n");
27 +#if (defined(__sparc__) || defined(__sparc))
28 + {
29 + struct stat buf;
31 + if (!xf86SolarisFbDevIsSet && (stat("/dev/fb", &buf) != 0) &&
32 + (xf86NumDrivers == 1))
33 + GetFbDevFromProbe();
34 + }
35 +#endif
37 #ifdef HAS_USL_VTS
40 @@ -376,6 +392,9 @@
41 if ((i + 1) < argc) {
42 if (!strcmp(argv[i], "-dev")) {
43 strlcpy(xf86SolarisFbDev, argv[i + 1], sizeof(xf86SolarisFbDev));
44 +#if (defined(__sparc__) || defined(__sparc))
45 + xf86SolarisFbDevIsSet = TRUE;
46 +#endif
47 return 2;
50 @@ -383,6 +402,87 @@
51 return 0;
54 +#if (defined(__sparc__) || defined(__sparc))
55 +static void
56 +GetFbDevFromProbe(void) {
57 + unsigned numDevs;
58 + GDevPtr *devList;
60 + numDevs = xf86MatchDevice(xf86DriverList[0]->driverName, &devList);
62 + if (numDevs != 1)
63 + return;
64 + else {
65 + struct pci_device_iterator *iter;
66 + unsigned device_id;
67 + const struct pci_id_match *const devices =
68 + xf86DriverList[0]->supported_devices;
69 + int i;
70 + Bool found = FALSE;
71 + struct pci_device *pPci;
72 + struct sol_device_private {
73 + struct pci_device base;
74 + const char * device_string;
75 + };
76 +#define DEV_PATH(dev) (((struct sol_device_private *) dev)->device_string)
77 +#define END_OF_MATCHES(m) \
78 + (((m).vendor_id == 0) && ((m).device_id == 0) && ((m).subvendor_id == 0))
80 + /* Find the pciVideoRec associated with this device section.
81 + */
82 + iter = pci_id_match_iterator_create(NULL);
83 + while ((pPci = pci_device_next(iter)) != NULL) {
84 + if (devList[0]->busID && *devList[0]->busID) {
85 + if (xf86ComparePciBusString(devList[0]->busID,
86 + ((pPci->domain << 8)
87 + | pPci->bus),
88 + pPci->dev, pPci->func)) {
89 + break;
90 + }
91 + }
92 + else if (xf86IsPrimaryPci(pPci)) {
93 + break;
94 + }
95 + }
97 + pci_iterator_destroy(iter);
99 + if (pPci == NULL)
100 + return;
102 + /* If driver provides supported_devices, then check if this
103 + device is on the list. Otherwise skip check.
104 + */
105 + if (!devices)
106 + found = TRUE;
107 + else {
108 + device_id = (devList[0]->chipID > 0)
109 + ? devList[0]->chipID : pPci->device_id;
111 + /* Once the pciVideoRec is found, determine if the device is supported
112 + * by the driver.
113 + */
114 + for (i = 0; !END_OF_MATCHES(devices[i]); i++) {
115 + if (PCI_ID_COMPARE(devices[i].vendor_id, pPci->vendor_id)
116 + && PCI_ID_COMPARE(devices[i].device_id, device_id)
117 + && ((devices[i].device_class_mask & pPci->device_class)
118 + == devices[i].device_class)) {
120 + found = TRUE;
121 + break;
125 + if (found) {
126 + strcpy(xf86SolarisFbDev, "/devices");
127 + strcat(xf86SolarisFbDev, DEV_PATH(pPci));
128 + xf86Msg(X_INFO, "Got xf86SolarisFbDev From Probe: %s\n", xf86SolarisFbDev);
133 +#endif
135 void
136 xf86UseMsg(void)