Module Name:    src
Committed By:   riastradh
Date:           Wed Aug  6 13:52:06 UTC 2014

Modified Files:
        src/sys/external/bsd/drm2/include/linux: pci.h

Log Message:
Add Linux PCI DMA stuff and NVIDIA vendor.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/linux/pci.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/pci.h
diff -u src/sys/external/bsd/drm2/include/linux/pci.h:1.6 src/sys/external/bsd/drm2/include/linux/pci.h:1.7
--- src/sys/external/bsd/drm2/include/linux/pci.h:1.6	Wed Jul 16 23:24:23 2014
+++ src/sys/external/bsd/drm2/include/linux/pci.h	Wed Aug  6 13:52:06 2014
@@ -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 @@ CTASSERT(PCI_CLASS_BRIDGE_ISA == 0x0601)
 #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 @@ pci_is_pcie(struct pci_dev *pdev)
 	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_ */

Reply via email to