summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2004-04-21 12:13:31 +0000
committerDave Airlie <airlied@linux.ie>2004-04-21 12:13:31 +0000
commit93bd67ef62e95a32f8b7e2fd7d9dadee52664160 (patch)
tree529b54bcdcfd364d6bc25cabf38999b465dadd80 /linux
parent0f32a8852712e405f64c5917bcebefc441aa1ba3 (diff)
centralise pci ids into one place and use scripts to generate files for
kernel
Diffstat (limited to 'linux')
-rw-r--r--linux/Makefile5
-rw-r--r--linux/drmP.h12
-rw-r--r--linux/drm_drv.h17
-rw-r--r--linux/gamma.h4
-rw-r--r--linux/i810.h8
-rw-r--r--linux/i830.h7
-rw-r--r--linux/savage.h24
7 files changed, 18 insertions, 59 deletions
diff --git a/linux/Makefile b/linux/Makefile
index b1758884..dc21459a 100644
--- a/linux/Makefile
+++ b/linux/Makefile
@@ -208,7 +208,10 @@ SHAREDDIR := ../shared
HASSHARED := $(shell if [ -d $(SHAREDDIR) ]; then echo y; fi)
ifeq ($(HASSHARED),y)
-includes:: $(SHAREDSRC)
+includes:: $(SHAREDSRC) drm_pciids.h
+
+drm_pciids.h: $(SHAREDDIR)/drm_pciids.txt
+ sh ../scripts/create_linux_pci_lists.sh < $(SHAREDDIR)/drm_pciids.txt
$(SHAREDSRC):
@if [ -r $(SHAREDDIR)/$@ ]; then \
diff --git a/linux/drmP.h b/linux/drmP.h
index 09556b89..e30dd6d9 100644
--- a/linux/drmP.h
+++ b/linux/drmP.h
@@ -255,6 +255,10 @@ static inline void class_simple_destroy(struct class_simple *cs){};
static inline struct class_simple *class_simple_create(struct module *owner, char *name) { return NULL; }
+#ifndef pci_pretty_name
+#define pci_pretty_name(x) x->name
+#endif
+
#endif
#ifndef REMAP_PAGE_RANGE_5_ARGS
@@ -423,14 +427,6 @@ do { \
typedef int drm_ioctl_t( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
-typedef struct drm_pci_id_list
-{
- int vendor;
- int device;
- long driver_private;
- char *name;
-} drm_pci_id_list_t;
-
typedef struct drm_ioctl_desc {
drm_ioctl_t *func;
int auth_needed;
diff --git a/linux/drm_drv.h b/linux/drm_drv.h
index 35876dc6..cdeb9b68 100644
--- a/linux/drm_drv.h
+++ b/linux/drm_drv.h
@@ -540,8 +540,10 @@ static int DRM(takedown)( drm_device_t *dev )
return 0;
}
-static drm_pci_id_list_t DRM(pciidlist)[] = {
- DRIVER_PCI_IDS
+#include "drm_pciids.h"
+
+static struct pci_device_id DRM(pciidlist)[] = {
+ DRM(PCI_IDS)
};
static int DRM(probe)(struct pci_dev *pdev)
@@ -551,17 +553,17 @@ static int DRM(probe)(struct pci_dev *pdev)
int retcode;
#endif
int i;
- char *desc = NULL;
+ int is_compat = 0;
DRM_DEBUG( "\n" );
for (i = 0; DRM(pciidlist)[i].vendor != 0; i++) {
if ((DRM(pciidlist)[i].vendor == pdev->vendor) &&
(DRM(pciidlist)[i].device == pdev->device)) {
- desc = DRM(pciidlist)[i].name;
+ is_compat = 1;
}
}
- if (desc == NULL)
+ if (is_compat == 0)
return -ENODEV;
if (DRM(numdevs) >= MAX_DEVICES)
@@ -623,7 +625,7 @@ static int DRM(probe)(struct pci_dev *pdev)
}
#endif
DRM(numdevs)++; /* no errors, mark it reserved */
-
+
DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n",
DRIVER_NAME,
DRIVER_MAJOR,
@@ -631,7 +633,8 @@ static int DRM(probe)(struct pci_dev *pdev)
DRIVER_PATCHLEVEL,
DRIVER_DATE,
dev->minor,
- desc );
+ pci_pretty_name(pdev)
+ );
DRIVER_POSTINIT();
diff --git a/linux/gamma.h b/linux/gamma.h
index d4712ef2..dcd64904 100644
--- a/linux/gamma.h
+++ b/linux/gamma.h
@@ -53,10 +53,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_GAMMA_INIT)] = { gamma_dma_init, 1, 1 }, \
[DRM_IOCTL_NR(DRM_IOCTL_GAMMA_COPY)] = { gamma_dma_copy, 1, 1 }
-#define DRIVER_PCI_IDS \
- {0x3d3d, 0x0008, 0, "3DLabs GLINT Gamma G1"}, \
- {0, 0, 0, NULL}
-
#define IOCTL_TABLE_NAME DRM(ioctls)
#define IOCTL_FUNC_NAME DRM(ioctl)
diff --git a/linux/i810.h b/linux/i810.h
index ffa06c0e..aee2efff 100644
--- a/linux/i810.h
+++ b/linux/i810.h
@@ -78,14 +78,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_I810_RSTATUS)] = { i810_rstatus, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I810_FLIP)] = { i810_flip_bufs, 1, 0 }
-#define DRIVER_PCI_IDS \
- {0x8086, 0x7121, 0, "Intel i810 GMCH"}, \
- {0x8086, 0x7123, 0, "Intel i810-DC100 GMCH"}, \
- {0x8086, 0x7125, 0, "Intel i810E GMCH"}, \
- {0x8086, 0x1132, 0, "Intel i815 GMCH"}, \
- {0, 0, 0, NULL}
-
-
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
diff --git a/linux/i830.h b/linux/i830.h
index 93570c92..48d9cdd0 100644
--- a/linux/i830.h
+++ b/linux/i830.h
@@ -77,13 +77,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_I830_GETPARAM)] = { i830_getparam, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I830_SETPARAM)] = { i830_setparam, 1, 0 }
-#define DRIVER_PCI_IDS \
- {0x8086, 0x3577, 0, "Intel i830M GMCH"}, \
- {0x8086, 0x2562, 0, "Intel i845G GMCH"}, \
- {0x8086, 0x3582, 0, "Intel i852GM/i855GM GMCH"}, \
- {0x8086, 0x2572, 0, "Intel i865G GMCH"}, \
- {0, 0, 0, NULL}
-
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
diff --git a/linux/savage.h b/linux/savage.h
index 5ccd22d8..fb828ce6 100644
--- a/linux/savage.h
+++ b/linux/savage.h
@@ -36,28 +36,4 @@
#define __HAVE_MTRR 1
#define __HAVE_CTX_BITMAP 1
-#define DRIVER_PCI_IDS \
- {0x5333, 0x8a22, 0, "Savage4"}, \
- {0x5333, 0x8a23, 0, "Savage4"}, \
- {0x5333, 0x8c10, 0, "Savage/MX-MV"}, \
- {0x5333, 0x8c11, 0, "Savage/MX"}, \
- {0x5333, 0x8c12, 0, "Savage/IX-MV"}, \
- {0x5333, 0x8c13, 0, "Savage/IX"}, \
- {0x5333, 0x8c20, 0, "Savage 3D"}, \
- {0x5333, 0x8c21, 0, "Savage 3D/MV"}, \
- {0x5333, 0x8c22, 0, "SuperSavage MX/128"}, \
- {0x5333, 0x8c24, 0, "SuperSavage MX/64"}, \
- {0x5333, 0x8c26, 0, "SuperSavage MX/64C"}, \
- {0x5333, 0x8c2a, 0, "SuperSavage IX/128 SDR"}, \
- {0x5333, 0x8c2b, 0, "SuperSavage IX/128 DDR"}, \
- {0x5333, 0x8c2c, 0, "SuperSavage IX/64 SDR"}, \
- {0x5333, 0x8c2d, 0, "SuperSavage IX/64 DDR"}, \
- {0x5333, 0x8c2e, 0, "SuperSavage IX/C SDR"}, \
- {0x5333, 0x8c2f, 0, "SuperSavage IX/C DDR"}, \
- {0x5333, 0x8a25, 0, "ProSavage PM133"}, \
- {0x5333, 0x8a26, 0, "ProSavage KM133"}, \
- {0x5333, 0x8d01, 0, "ProSavage PN133"}, \
- {0x5333, 0x8d02, 0, "ProSavage KN133"}, \
- {0x5333, 0x8d04, 0, "ProSavage DDR"}
-
#endif