Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Apr 2005 05:31:28 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 76050 for review
Message-ID:  <200504270531.j3R5VSDb089863@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504270531.j3R5VSDb089863>