Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/linux Add Linux PCI DMA stuff ...



details:   https://anonhg.NetBSD.org/src/rev/e32c2ad7cf77
branches:  trunk
changeset: 331247:e32c2ad7cf77
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Aug 06 13:52:06 2014 +0000

description:
Add Linux PCI DMA stuff and NVIDIA vendor.

diffstat:

 sys/external/bsd/drm2/include/linux/pci.h |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (41 lines):

diff -r 1ae669559eee -r e32c2ad7cf77 sys/external/bsd/drm2/include/linux/pci.h
--- a/sys/external/bsd/drm2/include/linux/pci.h Wed Aug 06 13:51:49 2014 +0000
+++ b/sys/external/bsd/drm2/include/linux/pci.h Wed Aug 06 13:52:06 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci.h,v 1.6 2014/07/16 23:24:23 riastradh Exp $        */
+/*     $NetBSD: pci.h,v 1.7 2014/08/06 13:52:06 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -46,6 +46,7 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/agpvar.h>
 
+#include <linux/dma-mapping.h>
 #include <linux/ioport.h>
 
 struct pci_bus;
@@ -75,6 +76,7 @@
 #define        PCI_VENDOR_ID_IBM       PCI_VENDOR_IBM
 #define        PCI_VENDOR_ID_HP        PCI_VENDOR_HP
 #define        PCI_VENDOR_ID_INTEL     PCI_VENDOR_INTEL
+#define        PCI_VENDOR_ID_NVIDIA    PCI_VENDOR_NVIDIA
 #define        PCI_VENDOR_ID_SONY      PCI_VENDOR_SONY
 #define        PCI_VENDOR_ID_VIA       PCI_VENDOR_VIATECH
 
@@ -561,4 +563,15 @@
        return (pci_find_capability(pdev, PCI_CAP_PCIEXPRESS) != 0);
 }
 
+static inline bool
+pci_dma_supported(struct pci_dev *pdev, uintmax_t mask)
+{
+
+       /* XXX Cop-out.  */
+       if (mask > DMA_BIT_MASK(32))
+               return pci_dma64_available(&pdev->pd_pa);
+       else
+               return true;
+}
+
 #endif  /* _LINUX_PCI_H_ */



Home | Main Index | Thread Index | Old Index