svn commit: r258275 - head/sys/powerpc/ofw

Justin Hibbits jhibbits at FreeBSD.org
Sun Nov 17 20:29:34 UTC 2013


Author: jhibbits
Date: Sun Nov 17 20:29:33 2013
New Revision: 258275
URL: http://svnweb.freebsd.org/changeset/base/258275

Log:
  Add a sysctl to allow disabling resetting the OF syscons.
  
  On some machines (G5 with lots of RAM), entering OF sometimes causes the
  machine to hang.  Once the machine is booted, currently the only entry point
  into OF is through resetting the framebuffer on mode switch on these machines.
  Disabling this allows the machine to stay up at the expense of less usable
  consoles after X is started.
  
  MFC after:	Never, this is only a hack

Modified:
  head/sys/powerpc/ofw/ofw_syscons.c

Modified: head/sys/powerpc/ofw/ofw_syscons.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_syscons.c	Sun Nov 17 19:50:50 2013	(r258274)
+++ head/sys/powerpc/ofw/ofw_syscons.c	Sun Nov 17 20:29:33 2013	(r258275)
@@ -57,9 +57,12 @@ __FBSDID("$FreeBSD$");
 #include <powerpc/ofw/ofw_syscons.h>
 
 static int ofwfb_ignore_mmap_checks = 1;
+static int ofwfb_reset_on_switch = 1;
 static SYSCTL_NODE(_hw, OID_AUTO, ofwfb, CTLFLAG_RD, 0, "ofwfb");
 SYSCTL_INT(_hw_ofwfb, OID_AUTO, relax_mmap, CTLFLAG_RW,
     &ofwfb_ignore_mmap_checks, 0, "relaxed mmap bounds checking");
+SYSCTL_INT(_hw_ofwfb, OID_AUTO, reset_on_mode_switch, CTLFLAG_RW,
+    &ofwfb_reset_on_switch, 0, "reset the framebuffer driver on mode switch");
 
 extern u_char dflt_font_16[];
 extern u_char dflt_font_14[];
@@ -447,26 +450,28 @@ ofwfb_set_mode(video_adapter_t *adp, int
 
 	sc = (struct ofwfb_softc *)adp;
 
-	/*
-	 * Open the display device, which will initialize it.
-	 */
-
-	memset(name, 0, sizeof(name));
-	OF_package_to_path(sc->sc_node, name, sizeof(name));
-	ih = OF_open(name);
-
-	if (sc->sc_depth == 8) {
+	if (ofwfb_reset_on_switch) {
 		/*
-		 * Install the ISO6429 colormap - older OFW systems
-		 * don't do this by default
+		 * Open the display device, which will initialize it.
 		 */
-		for (i = 0; i < 16; i++) {
-			OF_call_method("color!", ih, 4, 1,
-				       ofwfb_cmap[i].red,
-				       ofwfb_cmap[i].green,
-				       ofwfb_cmap[i].blue,
-				       i,
-				       &retval);
+
+		memset(name, 0, sizeof(name));
+		OF_package_to_path(sc->sc_node, name, sizeof(name));
+		ih = OF_open(name);
+
+		if (sc->sc_depth == 8) {
+			/*
+			 * Install the ISO6429 colormap - older OFW systems
+			 * don't do this by default
+			 */
+			for (i = 0; i < 16; i++) {
+				OF_call_method("color!", ih, 4, 1,
+						   ofwfb_cmap[i].red,
+						   ofwfb_cmap[i].green,
+						   ofwfb_cmap[i].blue,
+						   i,
+						   &retval);
+			}
 		}
 	}
 


More information about the svn-src-all mailing list