Source-Changes-HG archive

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

[src/riastradh-drm2]: src/sys/external/bsd/drm2 Kill some #ifs in drmP.h by a...



details:   https://anonhg.NetBSD.org/src/rev/6363f62db498
branches:  riastradh-drm2
changeset: 788047:6363f62db498
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 24 01:59:37 2013 +0000

description:
Kill some #ifs in drmP.h by adding Linuxoid PCI goo to <linux/pci.h>.

diffstat:

 sys/external/bsd/drm2/dist/include/drm/drmP.h |  15 ---------------
 sys/external/bsd/drm2/include/linux/pci.h     |  19 ++++++++++++++++++-
 2 files changed, 18 insertions(+), 16 deletions(-)

diffs (73 lines):

diff -r d7ba7f5e9882 -r 6363f62db498 sys/external/bsd/drm2/dist/include/drm/drmP.h
--- a/sys/external/bsd/drm2/dist/include/drm/drmP.h     Wed Jul 24 01:59:19 2013 +0000
+++ b/sys/external/bsd/drm2/dist/include/drm/drmP.h     Wed Jul 24 01:59:37 2013 +0000
@@ -1220,13 +1220,8 @@
 
        struct drm_agp_head *agp;       /**< AGP data */
 
-#ifdef __NetBSD__
-       device_t dev;
-       struct pci_attach_args pa;
-#else
        struct device *dev;             /**< Device structure */
        struct pci_dev *pdev;           /**< PCI device structure */
-#endif
        int pci_vendor;                 /**< PCI vendor id */
        int pci_device;                 /**< PCI device id */
 #ifdef __alpha__
@@ -1804,11 +1799,6 @@
 
 #include <drm/drm_mem_util.h>
 
-#ifdef __NetBSD__              /* XXX temporary measure 20130212 */
-struct pci_device_id;
-struct pci_dev;
-#endif
-
 extern int drm_fill_in_dev(struct drm_device *dev,
                           const struct pci_device_id *ent,
                           struct drm_driver *driver);
@@ -1826,12 +1816,7 @@
                }
        }
 
-#ifdef __NetBSD__
-       return pci_get_capability(dev->pa.pa_pc, dev->pa.pa_tag, PCI_CAP_AGP,
-           NULL, NULL);
-#else
        return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP);
-#endif
 }
 
 extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
diff -r d7ba7f5e9882 -r 6363f62db498 sys/external/bsd/drm2/include/linux/pci.h
--- a/sys/external/bsd/drm2/include/linux/pci.h Wed Jul 24 01:59:19 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/pci.h Wed Jul 24 01:59:37 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci.h,v 1.1.2.1 2013/07/24 00:33:12 riastradh Exp $    */
+/*     $NetBSD: pci.h,v 1.1.2.2 2013/07/24 01:59:37 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -32,4 +32,21 @@
 #ifndef _LINUX_PCI_H_
 #define _LINUX_PCI_H_
 
+#include <dev/pci/pcivar.h>
+
+struct pci_device_id;
+
+struct pci_dev {
+       struct pci_attach_args pd_pa;
+};
+
+#define        PCI_CAP_ID_AGP  PCI_CAP_AGP
+
+static inline int
+pci_find_capability(struct pci_dev *pdev, int cap)
+{
+       return pci_get_capability(pdev->pd_pa.pa_pc, pdev->pd_pa.pa_tag, cap,
+           NULL, NULL);
+}
+
 #endif  /* _LINUX_PCI_H_ */



Home | Main Index | Thread Index | Old Index