1 --- a/config/hal.c Fri Feb 20 12:38:27 2015
2 +++ b/config/hal.c Fri Feb 20 12:39:43 2015
5 * Copyright © 2007 Daniel Stone
6 * Copyright © 2007 Red Hat, Inc.
7 - * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
8 + * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All Rights Reserved.
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
14 char disppath[PATH_MAX];
16 - if ((num_session_disp_dev == num_total_disp_dev) || !disp_dev_path[0])
17 + if (((num_session_disp_dev & 0xFF) == num_total_disp_dev) || !disp_dev_path[0])
20 if (lstat(path, &statbuf) == 0 &&
24 #if ((defined(__sparc__) || defined(__sparc)) && defined(SUNSOFT))
25 - if ((num_session_disp_dev < num_total_disp_dev) &&
26 + if ((num_session_disp_dev < (num_total_disp_dev & 0x0FF)) &&
27 (!strcmp(name, "keyboard") || !strcmp(name, "mouse"))) {
30 --- a/hw/xfree86/common/xf86AutoConfig.c Fri Feb 20 12:24:38 2015
31 +++ b/hw/xfree86/common/xf86AutoConfig.c Fri Feb 20 12:36:48 2015
34 * Copyright 2003 by David H. Dawes.
35 * Copyright 2003 by X-Oz Technologies.
36 + * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All Rights Reserved.
37 * All rights reserved.
39 * Permission is hereby granted, free of charge, to any person obtaining a
44 +#if (defined(__sparc__) || defined(__sparc))
45 +static Bool MultiSessionConfig (void);
46 +extern int num_total_disp_dev;
49 /* Sections for the default built-in configuration. */
51 #define BUILTIN_DEVICE_NAME \
56 +#if ((defined(__sparc__) || defined(__sparc)) && defined (sun))
57 + /* Do not do MultiSessionConfig() when invoked with -isolateDevice option */
58 + if ((num_total_disp_dev & 0x1000)|| !MultiSessionConfig()) {
61 listPossibleVideoDrivers(deviceList, 20);
63 for (p = deviceList; *p; p++) {
68 +#if ((defined(__sparc__) || defined(__sparc)) && defined (sun))
72 xf86MsgVerb(X_DEFAULT, 0,
73 "Using default built-in configuration (%d lines)\n",
80 +#if ((defined(__sparc__) || defined(__sparc)) && defined (sun))
81 +#include <libdevinfo.h>
82 +#include <xorg/xf86Pci.h>
83 +#include "pciaccess.h"
84 +#include <sys/utsname.h>
89 + (((c) & 0x00ffff00) \
90 + == ((PCI_CLASS_DISPLAY << 16) | (PCI_SUBCLASS_DISPLAY_VGA << 8)))
93 +#define BUILTIN_MULTI_SERVERFLAGS_OPT1 \
94 + "\tOption\t\"DefaultServerLayout\"\t\"Xsession0\"\n"
96 +#define BUILTIN_MULTI_SECTION_POST \
99 +#define BUILTIN_MULTI_SERVERFLAGS_OPT2 \
100 + "\tOption\t\"AutoAddDevices\"\t\"true\"\n"
102 +#define BUILTIN_MULTI_SERVERFLAGS_SECTION \
103 + "Section \"ServerFlags\"\n" \
104 + BUILTIN_MULTI_SERVERFLAGS_OPT1 \
105 + BUILTIN_MULTI_SERVERFLAGS_OPT2 \
106 + BUILTIN_MULTI_SECTION_POST
108 +#define BUILTIN_MULTI_LAYOUT_SECTION_PRE \
109 + "Section \"ServerLayout\"\n" \
110 + "\tIdentifier\t\"Xsession%d\"\n"
112 +#define BUILTIN_MULTI_LAYOUT_SECTION_LINE \
113 + "\tScreen\t\t\"Screen%d\"\n"
115 +#define BUILTIN_MULTI_SCREEN_SECTION_PRE \
116 + "Section \"Screen\"\n" \
117 + "\tIdentifier\t\"Screen%d\"\n"
119 +#define BUILTIN_MULTI_SCREEN_SECTION_LINE \
120 + "\tDevice\t\t\"Card%d\"\n"
122 +#define BUILTIN_MULTI_DEVICE_SECTION_PRE \
123 + "Section \"Device\"\n" \
124 + "\tIdentifier\t\"Card%d\"\n"
126 +#define BUILTIN_MULTI_DEVICE_SECTION_LINE \
127 + "\tBusID\t\t\"%s\"\n\tDriver\t\t\"%s\"\n"
130 +MultiSessionConfig (void)
133 + struct pci_device_iterator * iter;
134 + struct pci_device * dev;
137 + char dev_path[PATH_MAX];
139 + disp_dev_type disp_dev[MAX_DEV];
143 + struct utsname sys;
144 + struct sol_device_private {
145 + struct pci_device base;
146 + const char * device_string;
148 +#define DEV_PATH(dev) (((struct sol_device_private *) dev)->device_string)
150 + if (uname(&sys) < 0) {
151 + xf86Msg(X_ERROR, "Error in uname call\n");
155 + if (strcmp(sys.machine, "sun4v"))
158 + iter = pci_slot_match_iterator_create( NULL );
160 + while ( (dev = pci_device_next( iter )) != NULL ) {
161 + if (IS_VGA(dev->device_class)) {
162 + if (num > MAX_DEV) {
163 + xf86Msg(X_ERROR, "Too many display devices: %d\n", num);
167 + memset(&disp_dev[num], 0, sizeof (disp_dev_type));
169 + snprintf(disp_dev[num].busid, sizeof(disp_dev[num].busid),
170 + "PCI:%d@%d:%d:%d", dev->bus, dev->domain,
171 + dev->dev, dev->func);
173 + strcpy(disp_dev[num].dev_path, "/devices");
174 + strncat(disp_dev[num].dev_path, DEV_PATH(dev),
175 + sizeof(disp_dev_type) - strlen("/devices"));
181 + pci_iterator_destroy(iter);
183 + /* Do not do multi-session configuration if dev number is 0 or 1 */
187 + snprintf(buf, sizeof(buf), BUILTIN_MULTI_SERVERFLAGS_SECTION);
188 + AppendToConfig(buf);
190 + for (i = 0; i < num; i++) {
193 + snprintf(buf, sizeof(buf), BUILTIN_MULTI_LAYOUT_SECTION_PRE, i);
194 + AppendToConfig(buf);
195 + snprintf(buf, sizeof(buf), BUILTIN_MULTI_LAYOUT_SECTION_LINE, i);
196 + AppendToConfig(buf);
197 + snprintf(buf, sizeof(buf), BUILTIN_MULTI_SECTION_POST);
198 + AppendToConfig(buf);
200 + snprintf(buf, sizeof(buf), BUILTIN_MULTI_SCREEN_SECTION_PRE, i);
201 + AppendToConfig(buf);
202 + snprintf(buf, sizeof(buf), BUILTIN_MULTI_SCREEN_SECTION_LINE, i);
203 + AppendToConfig(buf);
204 + snprintf(buf, sizeof(buf), BUILTIN_MULTI_SECTION_POST);
205 + AppendToConfig(buf);
207 + snprintf(buf, sizeof(buf), BUILTIN_MULTI_DEVICE_SECTION_PRE, i);
208 + AppendToConfig(buf);
211 + if (disp_dev[i].dev_path) {
216 + fd = open(disp_dev[i].dev_path, O_RDONLY);
218 + struct vis_identifier visid;
221 + SYSCALL(iret = ioctl(fd, VIS_GETIDENTIFIER, &visid));
225 + if (strcmp(visid.name, "SUNWtext") != 0) {
226 + for (cp = visid.name; (*cp != '\0') && isupper((uchar_t)*cp); cp++);
227 + /* find end of all uppercase vendor section */
228 + if ((cp != visid.name) && (*cp != '\0'))
229 + strncpy (drv, cp, sizeof(drv));
236 + xf86Msg(X_ERROR, "Can't find driver for session %d\n", i);
241 + snprintf(buf, sizeof(buf), BUILTIN_MULTI_DEVICE_SECTION_LINE,
242 + disp_dev[i].busid, drv);
243 + AppendToConfig(buf);
244 + snprintf(buf, sizeof(buf), BUILTIN_MULTI_SECTION_POST);
245 + AppendToConfig(buf);
252 --- a/hw/xfree86/common/xf86pciBus.c Wed May 20 08:27:14 2015
253 +++ b/hw/xfree86/common/xf86pciBus.c Wed May 20 08:28:57 2015
256 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
257 - * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
258 + * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All Rights Reserved.
260 * Permission is hereby granted, free of charge, to any person obtaining a
261 * copy of this software and associated documentation files (the "Software"),
266 +#if ((defined(__sparc__) || defined(__sparc)) && defined (sun))
268 + * num_total_disp_dev does not reflect accurate number of display
269 + * device when xf86IsolateDevice is set, redo it.
271 + if (xf86IsolateDevice.domain != PCI_MATCH_ANY) {
272 + num_total_disp_dev = 0x1000;
274 + iter = pci_slot_match_iterator_create (NULL);
275 + while ((info = pci_device_next(iter)) != NULL) {
276 + if (PCIINFOCLASSES(info->device_class)) {
277 + pci_device_probe(info);
279 + if (IS_VGA(info->device_class))
280 + num_total_disp_dev++;
287 /* If we haven't found a primary device try a different heuristic */
288 if (primaryBus.type == BUS_NONE && num) {
289 for (i = 0; i < num; i++) {
290 @@ -1219,7 +1240,11 @@
292 driverList[idx++] = "nouveau";
295 + driverList[idx++] = "nvidia";
297 driverList[idx++] = "nv";
302 --- a/hw/xfree86/common/xf86Xinput.c Fri Feb 20 12:34:32 2015
303 +++ b/hw/xfree86/common/xf86Xinput.c Fri Feb 20 12:37:40 2015
305 * authorization from the copyright holder(s) and author(s).
308 - * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
309 + * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All Rights Reserved.
312 #ifdef HAVE_XORG_CONFIG_H
313 @@ -1502,7 +1502,7 @@
316 #if ((defined(__sparc__) || defined(__sparc)) && defined(sun))
317 - if (num_session_disp_dev < num_total_disp_dev) {
318 + if (num_session_disp_dev < (num_total_disp_dev & 0x0FFF)) {
321 for (i = 0; i < MAX_DEVICES; i++) {
322 --- a/hw/xfree86/common/xf86Bus.c Fri Feb 20 12:25:35 2015
323 +++ b/hw/xfree86/common/xf86Bus.c Fri Feb 20 12:26:02 2015
326 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
327 + * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
329 * Permission is hereby granted, free of charge, to any person obtaining a
330 * copy of this software and associated documentation files (the "Software"),
332 #ifdef XSERVER_LIBPCIACCESS
335 -#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
338 #ifdef XSERVER_PLATFORM_BUS
339 xf86platformPrimary();
341 --- a/hw/xfree86/common/xf86AutoConfig.c 2017-02-01 15:25:17.530888588 -0800
342 +++ b/hw/xfree86/common/xf86AutoConfig.c 2017-02-01 15:26:39.121379814 -0800
344 #ifdef XSERVER_PLATFORM_BUS
345 i = xf86PlatformMatchDriver(matches, nmatches);
348 - /* Check for driver type based on /dev/fb type and if valid, use
349 - it instead of PCI bus probe results */
350 - if (xf86Info.consoleFd >= 0 && (i < (nmatches - 1))) {
351 - struct vis_identifier visid;
355 - SYSCALL(iret = ioctl(xf86Info.consoleFd, VIS_GETIDENTIFIER, &visid));
359 - fbfd = open(xf86SolarisFbDev, O_RDONLY);
361 - SYSCALL(iret = ioctl(fbfd, VIS_GETIDENTIFIER, &visid));
368 - "could not get frame buffer identifier from %s\n",
372 - xf86Msg(X_PROBED, "console driver: %s\n", visid.name);
374 - /* Special case from before the general case was set */
375 - if (strcmp(visid.name, "NVDAnvda") == 0) {
376 - matches[i++] = xnfstrdup("nvidia");
379 - /* General case - split into vendor name (initial all-caps
380 - prefix) & driver name (rest of the string). */
381 - if (strcmp(visid.name, "SUNWtext") != 0) {
382 - for (cp = visid.name; (*cp != '\0') && isupper(*cp); cp++) {
383 - /* find end of all uppercase vendor section */
385 - if ((cp != visid.name) && (*cp != '\0')) {
386 - char *driverName = xnfstrdup(cp);
387 - char *vendorName = xnfstrdup(visid.name);
389 - vendorName[cp - visid.name] = '\0';
391 - matches[i++] = vendorName;
392 - matches[i++] = driverName;
399 - if (i < (nmatches - 1))
401 - char *sbusDriver = sparcDriverName();
404 - matches[i++] = xnfstrdup(sbusDriver);
407 #ifdef XSERVER_LIBPCIACCESS
408 if (i < (nmatches - 1))
409 i += xf86PciMatchDriver(&matches[i], nmatches - i);