Module Name: src
Committed By: riastradh
Date: Wed Jul 24 01:59:37 UTC 2013
Modified Files:
src/sys/external/bsd/drm2/dist/include/drm [riastradh-drm2]: drmP.h
src/sys/external/bsd/drm2/include/linux [riastradh-drm2]: pci.h
Log Message:
Kill some #ifs in drmP.h by adding Linuxoid PCI goo to <linux/pci.h>.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.14 -r1.1.1.1.2.15 \
src/sys/external/bsd/drm2/dist/include/drm/drmP.h
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
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/dist/include/drm/drmP.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.1.1.1.2.14 src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.1.1.1.2.15
--- src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.1.1.1.2.14 Wed Jul 24 01:58:36 2013
+++ src/sys/external/bsd/drm2/dist/include/drm/drmP.h Wed Jul 24 01:59:37 2013
@@ -1220,13 +1220,8 @@ struct drm_device {
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 @@ static __inline__ void drm_core_dropmap(
#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 @@ static __inline__ int drm_pci_device_is_
}
}
-#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);
Index: src/sys/external/bsd/drm2/include/linux/pci.h
diff -u src/sys/external/bsd/drm2/include/linux/pci.h:1.1.2.1 src/sys/external/bsd/drm2/include/linux/pci.h:1.1.2.2
--- src/sys/external/bsd/drm2/include/linux/pci.h:1.1.2.1 Wed Jul 24 00:33:12 2013
+++ src/sys/external/bsd/drm2/include/linux/pci.h Wed Jul 24 01:59:37 2013
@@ -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_ */