From owner-p4-projects@FreeBSD.ORG Wed Apr 27 05:31:29 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 27E0D16A4D0; Wed, 27 Apr 2005 05:31:29 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 017C616A4CE for ; Wed, 27 Apr 2005 05:31:29 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA23843D54 for ; Wed, 27 Apr 2005 05:31:28 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j3R5VSPs089866 for ; Wed, 27 Apr 2005 05:31:28 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j3R5VSDb089863 for perforce@freebsd.org; Wed, 27 Apr 2005 05:31:28 GMT (envelope-from marcel@freebsd.org) Date: Wed, 27 Apr 2005 05:31:28 GMT Message-Id: <200504270531.j3R5VSDb089863@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76050 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2005 05:31:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=76050 Change 76050 by marcel@marcel_nfs on 2005/04/27 05:30:27 Check if the bridge forwards VGA addresses before allowing a device to allocate VGA specific addresses. Affected files ... .. //depot/projects/tty/sys/dev/pci/pci_pci.c#9 edit Differences ... ==== //depot/projects/tty/sys/dev/pci/pci_pci.c#9 (text+ko) ==== @@ -331,9 +331,12 @@ break; ok = (start >= sc->iobase && end <= sc->iolimit); - /* Make sure we allow access to VGA ports. */ - if (!ok) - ok = is_vga_resource(type, start, end); + /* + * Make sure we allow access to VGA I/O addresses when the + * bridge has the "VGA Enable" bit set. + */ + if (!ok && is_vga_resource(type, start, end)) + ok = (sc->bridgectl & PCIB_BCR_VGA_ENABLE) ? 1 : 0; if ((sc->flags & PCIB_SUBTRACTIVE) == 0) { if (!ok) { @@ -380,9 +383,12 @@ if (pcib_is_prefetch_open(sc)) ok = ok || (start >= sc->pmembase && end <= sc->pmemlimit); - /* Make sure we allow access to VGA memory. */ - if (!ok) - ok = is_vga_resource(type, start, end); + /* + * Make sure we allow access to VGA memory addresses when the + * bridge has the "VGA Enable" bit set. + */ + if (!ok && is_vga_resource(type, start, end)) + ok = (sc->bridgectl & PCIB_BCR_VGA_ENABLE) ? 1 : 0; if ((sc->flags & PCIB_SUBTRACTIVE) == 0) { if (!ok) {