Put the PCI device/vendor id in the drm_device_t.

This helps us unbreak FreeBSD DRM from the 965 changes.
main
Eric Anholt 2006-09-06 23:25:14 -07:00
parent d572676185
commit 55057660f0
5 changed files with 14 additions and 4 deletions

View File

@ -714,6 +714,9 @@ struct drm_device {
struct drm_driver_info driver; struct drm_driver_info driver;
drm_pci_id_list_t *id_entry; /* PCI ID, name, and chipset private */ 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 */ char *unique; /* Unique identifier: e.g., busid */
int unique_len; /* Length of unique field */ int unique_len; /* Length of unique field */
#ifdef __FreeBSD__ #ifdef __FreeBSD__

View File

@ -516,6 +516,9 @@ static int drm_load(drm_device_t *dev)
dev->pci_slot = pci_get_slot(dev->device); dev->pci_slot = pci_get_slot(dev->device);
dev->pci_func = pci_get_function(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); TAILQ_INIT(&dev->maplist);
drm_mem_init(); drm_mem_init();

View File

@ -747,6 +747,8 @@ typedef struct drm_device {
drm_agp_head_t *agp; /**< AGP data */ drm_agp_head_t *agp; /**< AGP data */
struct pci_dev *pdev; /**< PCI device structure */ struct pci_dev *pdev; /**< PCI device structure */
int pci_vendor; /**< PCI vendor id */
int pci_device; /**< PCI device id */
#ifdef __alpha__ #ifdef __alpha__
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3)
struct pci_controler *hose; struct pci_controler *hose;

View File

@ -66,6 +66,8 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev,
mutex_init(&dev->ctxlist_mutex); mutex_init(&dev->ctxlist_mutex);
dev->pdev = pdev; dev->pdev = pdev;
dev->pci_device = pdev->device;
dev->pci_vendor = pdev->vendor;
#ifdef __alpha__ #ifdef __alpha__
dev->hose = pdev->sysdata; dev->hose = pdev->sysdata;

View File

@ -31,10 +31,10 @@
#include "i915_drm.h" #include "i915_drm.h"
#include "i915_drv.h" #include "i915_drv.h"
#define IS_I965G(dev) (dev->pdev->device == 0x2972 || \ #define IS_I965G(dev) (dev->pci_device == 0x2972 || \
dev->pdev->device == 0x2982 || \ dev->pci_device == 0x2982 || \
dev->pdev->device == 0x2992 || \ dev->pci_device == 0x2992 || \
dev->pdev->device == 0x29A2) dev->pci_device == 0x29A2)
/* Really want an OS-independent resettable timer. Would like to have /* Really want an OS-independent resettable timer. Would like to have