Put the PCI device/vendor id in the drm_device_t.
authorEric Anholt <eric@anholt.net>
Thu, 7 Sep 2006 06:25:14 +0000 (23:25 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 7 Sep 2006 06:25:14 +0000 (23:25 -0700)
This helps us unbreak FreeBSD DRM from the 965 changes.

bsd-core/drmP.h
bsd-core/drm_drv.c
linux-core/drmP.h
linux-core/drm_stub.c
shared-core/i915_dma.c

index e6c1d06..6fa3973 100644 (file)
@@ -714,6 +714,9 @@ struct drm_device {
        struct drm_driver_info driver;
        drm_pci_id_list_t *id_entry;    /* PCI ID, name, and chipset private */
 
+       u_int16_t pci_device;           /* PCI device id */
+       u_int16_t pci_vendor;           /* PCI vendor id */
+
        char              *unique;      /* Unique identifier: e.g., busid  */
        int               unique_len;   /* Length of unique field          */
 #ifdef __FreeBSD__
index 3f53a72..9fb10c5 100644 (file)
@@ -516,6 +516,9 @@ static int drm_load(drm_device_t *dev)
        dev->pci_slot = pci_get_slot(dev->device);
        dev->pci_func = pci_get_function(dev->device);
 
+       dev->pci_vendor = pci_get_vendor(dev->device);
+       dev->pci_device = pci_get_device(dev->device);
+
        TAILQ_INIT(&dev->maplist);
 
        drm_mem_init();
index 6046dde..70bf349 100644 (file)
@@ -747,6 +747,8 @@ typedef struct drm_device {
        drm_agp_head_t *agp;            /**< AGP data */
 
        struct pci_dev *pdev;           /**< PCI device structure */
+       int pci_vendor;                 /**< PCI vendor id */
+       int pci_device;                 /**< PCI device id */
 #ifdef __alpha__
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3)
        struct pci_controler *hose;
index bdc3655..4708222 100644 (file)
@@ -66,6 +66,8 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev,
        mutex_init(&dev->ctxlist_mutex);
 
        dev->pdev = pdev;
+       dev->pci_device = pdev->device;
+       dev->pci_vendor = pdev->vendor;
 
 #ifdef __alpha__
        dev->hose = pdev->sysdata;
index ba8c56e..3863490 100644 (file)
 #include "i915_drm.h"
 #include "i915_drv.h"
 
-#define IS_I965G(dev)  (dev->pdev->device == 0x2972 || \
-                       dev->pdev->device == 0x2982 || \
-                       dev->pdev->device == 0x2992 || \
-                       dev->pdev->device == 0x29A2)
+#define IS_I965G(dev)  (dev->pci_device == 0x2972 || \
+                       dev->pci_device == 0x2982 || \
+                       dev->pci_device == 0x2992 || \
+                       dev->pci_device == 0x29A2)
 
 
 /* Really want an OS-independent resettable timer.  Would like to have