Subject: enabling bus mastering for PCI vga device
To: None <tech-kern@netbsd.org>
From: Blair Sadewitz <blair.sadewitz@gmail.com>
List: tech-kern
Date: 12/17/2006 18:03:06
This is from OpenBSD, and it seems to be a good idea. Could there be
ill consequences of this, or should/could this be committed?

Regards,

--Blair


Index: sys/dev/pci/vga_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/vga_pci.c,v
retrieving revision 1.30
diff -u -r1.30 vga_pci.c
--- sys/dev/pci/vga_pci.c       16 Nov 2006 01:33:10 -0000      1.30
+++ sys/dev/pci/vga_pci.c       17 Dec 2006 23:01:37 -0000
@@ -170,6 +170,13 @@
        char devinfo[256];
        int bar, reg;

+       /*
+        * Enable bus master; X might need this for accelerated graphics.
+        */
+       reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
+       reg |= PCI_COMMAND_MASTER_ENABLE;
+       pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, reg);
+
        psc->sc_pc = pa->pa_pc;
        psc->sc_pcitag = pa->pa_tag;