summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1998-05-11 01:06:08 +0000
committerdyson <dyson@FreeBSD.org>1998-05-11 01:06:08 +0000
commitfac78afe5c7685395182993c3c9bfd8bb3963570 (patch)
tree3c9cef7272836e4f544fe0bb5ceef142ae617db6 /sys/pci
parent7a79ac1a000499bda404bdc7e7f9c57112d46a53 (diff)
downloadFreeBSD-src-fac78afe5c7685395182993c3c9bfd8bb3963570.zip
FreeBSD-src-fac78afe5c7685395182993c3c9bfd8bb3963570.tar.gz
Attempt to set write combining mode for graphics devices.
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/pcisupport.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/sys/pci/pcisupport.c b/sys/pci/pcisupport.c
index 60c4a7e..79a678d 100644
--- a/sys/pci/pcisupport.c
+++ b/sys/pci/pcisupport.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pcisupport.c,v 1.66 1998/05/04 08:16:03 kato Exp $
+** $Id: pcisupport.c,v 1.67 1998/05/08 07:56:48 bde Exp $
**
** Device driver for DEC/INTEL PCI chipsets.
**
@@ -49,6 +49,10 @@
#include <pci/pcivar.h>
#include <pci/pcireg.h>
+#include <vm/vm.h>
+#include <vm/vm_object.h>
+#include <vm/pmap.h>
+
/*---------------------------------------------------------
**
** Intel chipsets for 486 / Pentium processor
@@ -851,7 +855,7 @@ static struct pci_device vga_device = {
DATA_SET (pcidevice_set, vga_device);
-static char* vga_probe (pcici_t tag, pcidi_t unused)
+static char* vga_probe (pcici_t tag, pcidi_t typea)
{
int data = pci_conf_read(tag, PCI_CLASS_REG);
u_int id = pci_conf_read(tag, PCI_ID_REG);
@@ -1077,9 +1081,33 @@ static char* vga_probe (pcici_t tag, pcidi_t unused)
if (vendor && chip) {
char *buf;
int len;
+ int i;
+ int reqmapmem;
- if (type == 0)
+ if (type == 0) {
type = "SVGA controller";
+ }
+
+ reqmapmem = PCI_MAPMEM;
+ for (i = 0; i < tag->nummaps; i++) {
+ pcimap *m = &tag->map[i];
+ if (m->type & PCI_MAPMEMP)
+ reqmapmem |= PCI_MAPMEMP;
+ }
+
+ for (i = 0; i < tag->nummaps; i++) {
+ unsigned mapaddr;
+ pcimap *m = &tag->map[i];
+ mapaddr = (m->base >> 12);
+ if (m->type == reqmapmem) {
+ pmap_setdevram(m->base, (1 << m->ln2size));
+ }
+ }
+
+#if defined(i386)
+ pmap_setvidram();
+#endif
+
len = strlen(vendor) + strlen(chip) + strlen(type) + 4;
MALLOC(buf, char *, len, M_TEMP, M_NOWAIT);
sprintf(buf, "%s %s %s", vendor, chip, type);
OpenPOWER on IntegriCloud