From owner-svn-src-head@FreeBSD.ORG Sun Nov 17 20:29:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1600453B; Sun, 17 Nov 2013 20:29:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DFBA1215F; Sun, 17 Nov 2013 20:29:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHKTX1M051270; Sun, 17 Nov 2013 20:29:33 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHKTXRu051269; Sun, 17 Nov 2013 20:29:33 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201311172029.rAHKTXRu051269@svn.freebsd.org> From: Justin Hibbits Date: Sun, 17 Nov 2013 20:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258275 - head/sys/powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Nov 2013 20:29:34 -0000 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 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); + } } }