Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37491
b: refs/heads/master
c: 3322960
h: refs/heads/master
i:
  37489: 6457f08
  37487: 4cca5d0
v: v3
  • Loading branch information
Dave Airlie committed Sep 21, 2006
1 parent a045732 commit 9486063
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 242ef0e1e7e5bb7e80c3620c1aa55168819d6fb8
refs/heads/master: 332296016ee2e808b362de66bf6bec49c396e5bf
7 changes: 6 additions & 1 deletion trunk/drivers/char/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,6 @@ typedef struct drm_device {
drm_agp_head_t *agp; /**< AGP data */

struct pci_dev *pdev; /**< PCI device structure */
int pci_domain; /**< PCI bus domain number */
#ifdef __alpha__
struct pci_controller *hose;
#endif
Expand All @@ -721,6 +720,12 @@ static __inline__ int drm_core_check_feature(struct drm_device *dev,
return ((dev->driver->driver_features & feature) ? 1 : 0);
}

#ifdef __alpha__
#define drm_get_pci_domain(dev) dev->hose->bus->number
#else
#define drm_get_pci_domain(dev) pci_domain_nr(dev->pdev->bus)
#endif

#if __OS_HAS_AGP
static inline int drm_core_has_AGP(struct drm_device *dev)
{
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/char/drm/drm_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int drm_setunique(struct inode *inode, struct file *filp,
domain = bus >> 8;
bus &= 0xff;

if ((domain != dev->pci_domain) ||
if ((domain != drm_get_pci_domain(dev)) ||
(bus != dev->pdev->bus->number) ||
(slot != PCI_SLOT(dev->pdev->devfn)) ||
(func != PCI_FUNC(dev->pdev->devfn)))
Expand All @@ -149,7 +149,7 @@ static int drm_set_busid(drm_device_t * dev)
return ENOMEM;

len = snprintf(dev->unique, dev->unique_len, "pci:%04x:%02x:%02x.%d",
dev->pci_domain, dev->pdev->bus->number,
drm_get_pci_domain(dev), dev->pdev->bus->number,
PCI_SLOT(dev->pdev->devfn),
PCI_FUNC(dev->pdev->devfn));

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int drm_irq_by_busid(struct inode *inode, struct file *filp,
if (copy_from_user(&p, argp, sizeof(p)))
return -EFAULT;

if ((p.busnum >> 8) != dev->pci_domain ||
if ((p.busnum >> 8) != drm_get_pci_domain(dev) ||
(p.busnum & 0xff) != dev->pdev->bus->number ||
p.devnum != PCI_SLOT(dev->pdev->devfn) || p.funcnum != PCI_FUNC(dev->pdev->devfn))
return -EINVAL;
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/char/drm/drm_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev,

#ifdef __alpha__
dev->hose = pdev->sysdata;
dev->pci_domain = dev->hose->bus->number;
#else
dev->pci_domain = 0;
#endif
dev->irq = pdev->irq;

Expand Down

0 comments on commit 9486063

Please sign in to comment.