From owner-svn-ports-head@FreeBSD.ORG Tue Jul 29 23:00:11 2014 Return-Path: Delivered-To: svn-ports-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 5312C4DC; Tue, 29 Jul 2014 23:00:11 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3452121FE; Tue, 29 Jul 2014 23:00:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s6TN0BiF016637; Tue, 29 Jul 2014 23:00:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TN0Bbg016636; Tue, 29 Jul 2014 23:00:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201407292300.s6TN0Bbg016636@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Jul 2014 23:00:11 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r363409 - head/x11-servers/xorg-server/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 23:00:11 -0000 Author: nwhitehorn (src committer) Date: Tue Jul 29 23:00:10 2014 New Revision: 363409 URL: http://svnweb.freebsd.org/changeset/ports/363409 QAT: https://qat.redports.org/buildarchive/r363409/ Log: mmap() /dev/mem instead of /dev/console on PowerPC. Mostly this was already being done in libpciaccess, so this is functionally a no-op in most cases and unifies behavior. Besides aesthetic appeal, the ability to directly mmap() all of physical memory through /dev/console on PowerPC is about to go away on -CURRENT, which means everything should converge on /dev/mem. Approved by: kwm Modified: head/x11-servers/xorg-server/files/extra-new-arch-powerpc Modified: head/x11-servers/xorg-server/files/extra-new-arch-powerpc ============================================================================== --- head/x11-servers/xorg-server/files/extra-new-arch-powerpc Tue Jul 29 22:58:34 2014 (r363408) +++ head/x11-servers/xorg-server/files/extra-new-arch-powerpc Tue Jul 29 23:00:10 2014 (r363409) @@ -1,35 +1,70 @@ ---- ./hw/xfree86/os-support/bsd/ppc_video.c.orig 2012-05-17 12:09:03.000000000 -0500 -+++ ./hw/xfree86/os-support/bsd/ppc_video.c 2014-01-18 14:36:42.000000000 -0600 -@@ -115,17 +115,19 @@ - Bool - xf86EnableIO() +--- hw/xfree86/os-support/bsd/ppc_video.c.orig 2014-07-22 07:52:58.000000000 -0700 ++++ hw/xfree86/os-support/bsd/ppc_video.c 2014-07-22 08:00:21.000000000 -0700 +@@ -44,6 +44,8 @@ + #define DEV_MEM "/dev/xf86" + #endif + ++static int kmem = -1; ++ + static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags); + static void ppcUnmapVidMem(int, pointer, unsigned long); + +@@ -68,6 +70,17 @@ + int fd = xf86Info.consoleFd; + pointer base; + ++#ifdef __FreeBSD__ ++ if (kmem == -1) { ++ kmem = open(DEV_MEM, 2); ++ if (kmem == -1) { ++ FatalError("mapVidMem: open %s", DEV_MEM); ++ } ++ } ++ ++ fd = kmem; ++#endif ++ + #ifdef DEBUG + xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", Base, Size, fd); + #endif +@@ -93,7 +106,6 @@ + int Len) { -- int fd = xf86Info.consoleFd; -+ int fd = open(DEV_MEM, O_RDWR); + int rv; +- static int kmem = -1; + + if (kmem == -1) { + kmem = open(DEV_MEM, 2); +@@ -118,6 +130,8 @@ + int fd = xf86Info.consoleFd; xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd); ++ ++#ifndef __FreeBSD__ if (ioBase == MAP_FAILED) { ioBase = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xf2000000); - xf86MsgVerb(X_INFO, 3, "xf86EnableIO: %08x\n", ioBase); -+#if 0 /* Non-fatal */ - if (ioBase == MAP_FAILED) { - xf86MsgVerb(X_WARNING, 3, "Can't map IO space!\n"); +@@ -127,6 +141,12 @@ return FALSE; } -+#endif } ++#endif ++ /* ++ * Note that outl() etc. check for ioBase == MAP_FAILED, so leaving it that ++ * way (e.g. on FreeBSD) is non-fatal. ++ */ ++ return TRUE; } -@@ -135,7 +137,11 @@ + +@@ -134,8 +154,10 @@ + xf86DisableIO() { ++#ifndef __FreeBSD__ if (ioBase != MAP_FAILED) { -+#if defined(__FreeBSD__) -+ munmap(__DEVOLATILE(unsigned char *, ioBase), 0x10000); -+#else munmap(__UNVOLATILE(ioBase), 0x10000); -+#endif ioBase = MAP_FAILED; } ++#endif }