From 55057660f035a03078910d678e5fd9b0cb0b795a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 6 Sep 2006 23:25:14 -0700 Subject: Put the PCI device/vendor id in the drm_device_t. This helps us unbreak FreeBSD DRM from the 965 changes. --- bsd-core/drmP.h | 3 +++ bsd-core/drm_drv.c | 3 +++ linux-core/drmP.h | 2 ++ linux-core/drm_stub.c | 2 ++ shared-core/i915_dma.c | 8 ++++---- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index e6c1d060..6fa39734 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -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__ diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 3f53a72f..9fb10c53 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -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(); diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 6046dde6..70bf3495 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -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; diff --git a/linux-core/drm_stub.c b/linux-core/drm_stub.c index bdc36552..4708222f 100644 --- a/linux-core/drm_stub.c +++ b/linux-core/drm_stub.c @@ -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; diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index ba8c56ee..3863490c 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -31,10 +31,10 @@ #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 -- cgit v1.2.3