open-src/xserver/xorg/sparc-probe.patch
author Alan Coopersmith <Alan.Coopersmith@Sun.COM>
Wed, 24 Jun 2009 17:46:23 -0700
changeset 733 15c28bfd12ed
parent 705 24ca414edbff
child 851 d428083dbbdd
permissions -rw-r--r--
6854717 Add man pages to document replacements for EOF programs

# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, provided that the above
# copyright notice(s) and this permission notice appear in all copies of
# the Software and that both the above copyright notice(s) and this
# permission notice appear in supporting documentation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Except as contained in this notice, the name of a copyright holder
# shall not be used in advertising or otherwise to promote the sale, use
# or other dealings in this Software without prior written authorization
# of the copyright holder.
# 

Allow probing for /dev/fb cards other than the traditional sbus devices.

diff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86sbusBus.c hw/xfree86/common/xf86sbusBus.c
--- hw/xfree86/common/xf86sbusBus.c	2009-01-09 09:47:04.000000000 -0800
+++ hw/xfree86/common/xf86sbusBus.c	2009-01-22 20:34:49.343790000 -0800
@@ -41,6 +41,10 @@
 #include "xf86sbusBus.h"
 #include "xf86Sbus.h"
 
+#ifdef sun
+# include <sys/visual_io.h>
+#endif
+
 Bool sbusSlotClaimed = FALSE;
 
 static int xf86nSbusInfo;
@@ -213,8 +217,25 @@ xf86SbusProbe(void)
 		xf86ErrorF(" at %s", promPath);
 		xfree(promPath);
 	    }
-	} else
+	} else {
+#ifdef sun
+	    if (psdp->devId == SBUS_DEVICE_UNK) {
+		int fbfd;
+
+		fbfd = open(psdp->device, O_RDONLY, 0);
+		if (fbfd >= 0) {
+		    struct vis_identifier   visid;
+		    if (ioctl(fbfd, VIS_GETIDENTIFIER, &visid) >= 0) {
+			psdp->descr = strdup(visid.name);
+		    }
+		    close(fbfd);
+		}
+	    }
+	    xf86Msg(X_PROBED, "%s: %s", psdp->device, psdp->descr);
+#else
 	    xf86Msg(X_PROBED, "SBUS: %s", psdp->descr);
+#endif
+	}
 	xf86ErrorF("\n");
     }
     if (useProm)
diff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86sbusBus.h hw/xfree86/common/xf86sbusBus.h
--- hw/xfree86/common/xf86sbusBus.h	2009-01-09 09:47:04.000000000 -0800
+++ hw/xfree86/common/xf86sbusBus.h	2009-01-22 20:34:49.344526000 -0800
@@ -39,6 +39,7 @@
 #define SBUS_DEVICE_FFB		0x000b
 #define SBUS_DEVICE_GT		0x000c
 #define SBUS_DEVICE_MGX		0x000d
+#define SBUS_DEVICE_UNK		0x000e
 
 typedef struct sbus_prom_node {
     int			node;
diff -urp -x '*~' -x '*.orig' hw/xfree86/os-support/bus/Sbus.c hw/xfree86/os-support/bus/Sbus.c
--- hw/xfree86/os-support/bus/Sbus.c	2009-01-09 09:47:04.000000000 -0800
+++ hw/xfree86/os-support/bus/Sbus.c	2009-01-22 20:34:49.345181000 -0800
@@ -68,6 +68,7 @@ struct sbus_devtable sbusDeviceTable[] =
     { SBUS_DEVICE_TCX, FBTYPE_TCXCOLOR, "tcx", "suntcx", "Sun TCX" },
     { SBUS_DEVICE_FFB, FBTYPE_CREATOR, "ffb", "sunffb", "Sun FFB" },
     { SBUS_DEVICE_FFB, FBTYPE_CREATOR, "afb", "sunffb", "Sun Elite3D" },
+    { SBUS_DEVICE_UNK, FBTYPE_LASTPLUSONE + 1, "unknown", "unknown", "Unknown FB" },
     { 0, 0, NULL }
 };