From owner-svn-src-all@freebsd.org Fri Jul 20 16:18:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93193104AE75; Fri, 20 Jul 2018 16:18:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A99F83027; Fri, 20 Jul 2018 16:18:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BC1512807; Fri, 20 Jul 2018 16:18:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6KGIOLM059744; Fri, 20 Jul 2018 16:18:24 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6KGIO8q059743; Fri, 20 Jul 2018 16:18:24 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201807201618.w6KGIO8q059743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 20 Jul 2018 16:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336555 - head/sys/dev/vt/hw/ofwfb X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/vt/hw/ofwfb X-SVN-Commit-Revision: 336555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2018 16:18:25 -0000 Author: jhibbits Date: Fri Jul 20 16:18:24 2018 New Revision: 336555 URL: https://svnweb.freebsd.org/changeset/base/336555 Log: vt/ofwfb: Fix brain-o from r336514, use the correct form of /chosen/stdout-path /chosen/stdout-path is a string, not ihandle. Treat it as such. With this, ofwfb now starts correctly on a POWER9 system when launched from the local console (not serial). Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Fri Jul 20 16:08:14 2018 (r336554) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Fri Jul 20 16:18:24 2018 (r336555) @@ -92,7 +92,7 @@ ofwfb_probe(struct vt_device *vd) { phandle_t chosen, node; ihandle_t stdout; - char type[64]; + char buf[64]; chosen = OF_finddevice("/chosen"); if (chosen == -1) @@ -103,9 +103,8 @@ ofwfb_probe(struct vt_device *vd) sizeof(stdout)) node = OF_instance_to_package(stdout); if (node == -1) - if (OF_getprop(chosen, "stdout-path", &stdout, sizeof(stdout)) == - sizeof(stdout)) - node = OF_instance_to_package(stdout); + if (OF_getprop(chosen, "stdout-path", buf, sizeof(buf)) > 0) + node = OF_finddevice(buf); if (node == -1) { /* * The "/chosen/stdout" does not exist try @@ -113,8 +112,8 @@ ofwfb_probe(struct vt_device *vd) */ node = OF_finddevice("screen"); } - OF_getprop(node, "device_type", type, sizeof(type)); - if (strcmp(type, "display") != 0) + OF_getprop(node, "device_type", buf, sizeof(buf)); + if (strcmp(buf, "display") != 0) return (CN_DEAD); /* Looks OK... */ @@ -355,7 +354,7 @@ static int ofwfb_init(struct vt_device *vd) { struct ofwfb_softc *sc; - char type[64]; + char buf[64]; phandle_t chosen; phandle_t node; uint32_t depth, height, width, stride; @@ -375,6 +374,13 @@ ofwfb_init(struct vt_device *vd) if (OF_getprop(chosen, "stdout", &sc->sc_handle, sizeof(ihandle_t)) == sizeof(ihandle_t)) node = OF_instance_to_package(sc->sc_handle); + if (node == -1) + /* Try "/chosen/stdout-path" now */ + if (OF_getprop(chosen, "stdout-path", buf, sizeof(buf)) > 0) { + node = OF_finddevice(buf); + if (node != -1) + sc->sc_handle = OF_open(buf); + } if (node == -1) { /* * The "/chosen/stdout" does not exist try @@ -383,8 +389,8 @@ ofwfb_init(struct vt_device *vd) node = OF_finddevice("screen"); sc->sc_handle = OF_open("screen"); } - OF_getprop(node, "device_type", type, sizeof(type)); - if (strcmp(type, "display") != 0) + OF_getprop(node, "device_type", buf, sizeof(buf)); + if (strcmp(buf, "display") != 0) return (CN_DEAD); /* Keep track of the OF node */