From: Dave Airlie <airlied@linux.ie>
To: linux-kernel@vger.kernel.org
Cc: Dave Airlie <airlied@linux.ie>
Subject: [PATCH] drm: remove local copies of pci bus/slot/func (01/07)
Date: Sun, 23 Jul 2006 01:38:27 +1000 [thread overview]
Message-ID: <11535827133352-git-send-email-airlied@linux.ie> (raw)
In-Reply-To: <11535827134076-git-send-email-airlied@linux.ie>
The drm keeps a local copy of these for little use.
Signed-off-by: Dave Airlie <airlied@linux.ie>
(cherry picked from ed13f8ab3c841ebe5395dc6e10cb5f9aeb6fd627 commit)
---
drivers/char/drm/drmP.h | 3 ---
drivers/char/drm/drm_ioctl.c | 9 ++++++---
drivers/char/drm/drm_irq.c | 4 ++--
drivers/char/drm/drm_stub.c | 3 ---
4 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index d2a5618..5c8f245 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -712,9 +712,6 @@ typedef struct drm_device {
struct pci_dev *pdev; /**< PCI device structure */
int pci_domain; /**< PCI bus domain number */
- int pci_bus; /**< PCI bus number */
- int pci_slot; /**< PCI slot number */
- int pci_func; /**< PCI function number */
#ifdef __alpha__
struct pci_controller *hose;
#endif
diff --git a/drivers/char/drm/drm_ioctl.c b/drivers/char/drm/drm_ioctl.c
index 555f323..5c020b8 100644
--- a/drivers/char/drm/drm_ioctl.c
+++ b/drivers/char/drm/drm_ioctl.c
@@ -128,8 +128,9 @@ int drm_setunique(struct inode *inode, s
bus &= 0xff;
if ((domain != dev->pci_domain) ||
- (bus != dev->pci_bus) ||
- (slot != dev->pci_slot) || (func != dev->pci_func))
+ (bus != dev->pdev->bus->number) ||
+ (slot != PCI_SLOT(dev->pdev->devfn)) ||
+ (func != PCI_FUNC(dev->pdev->devfn)))
return -EINVAL;
return 0;
@@ -148,7 +149,9 @@ static int drm_set_busid(drm_device_t *
return ENOMEM;
len = snprintf(dev->unique, dev->unique_len, "pci:%04x:%02x:%02x.%d",
- dev->pci_domain, dev->pci_bus, dev->pci_slot, dev->pci_func);
+ dev->pci_domain, dev->pdev->bus->number,
+ PCI_SLOT(dev->pdev->devfn),
+ PCI_FUNC(dev->pdev->devfn));
if (len > dev->unique_len)
DRM_ERROR("Unique buffer overflowed\n");
diff --git a/drivers/char/drm/drm_irq.c b/drivers/char/drm/drm_irq.c
index ebdb718..ee4b183 100644
--- a/drivers/char/drm/drm_irq.c
+++ b/drivers/char/drm/drm_irq.c
@@ -65,8 +65,8 @@ int drm_irq_by_busid(struct inode *inode
return -EFAULT;
if ((p.busnum >> 8) != dev->pci_domain ||
- (p.busnum & 0xff) != dev->pci_bus ||
- p.devnum != dev->pci_slot || p.funcnum != dev->pci_func)
+ (p.busnum & 0xff) != dev->pdev->bus->number ||
+ p.devnum != PCI_SLOT(dev->pdev->devfn) || p.funcnum != PCI_FUNC(dev->pdev->devfn))
return -EINVAL;
p.irq = dev->irq;
diff --git a/drivers/char/drm/drm_stub.c b/drivers/char/drm/drm_stub.c
index 9a842a3..96449d5 100644
--- a/drivers/char/drm/drm_stub.c
+++ b/drivers/char/drm/drm_stub.c
@@ -72,9 +72,6 @@ #ifdef __alpha__
#else
dev->pci_domain = 0;
#endif
- dev->pci_bus = pdev->bus->number;
- dev->pci_slot = PCI_SLOT(pdev->devfn);
- dev->pci_func = PCI_FUNC(pdev->devfn);
dev->irq = pdev->irq;
dev->maplist = drm_calloc(1, sizeof(*dev->maplist), DRM_MEM_MAPS);
--
1.4.1.ga3e6
next prev parent reply other threads:[~2006-07-22 15:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-22 15:38 [RFC] GPU device layer patchset (00/07) Dave Airlie
2006-07-22 15:38 ` Dave Airlie [this message]
2006-07-22 15:38 ` [PATCH] drm: remove pci domain local copy (02/07) Dave Airlie
2006-07-22 15:38 ` [PATCH] gpu: Initial GPU layer addition. (03/07) Dave Airlie
2006-07-22 15:38 ` [PATCH] gpu/radeon: add a radeon lowlevel GPU driver (04/07) Dave Airlie
2006-07-22 15:38 ` [PATCH] gpu/radeonfb: add GPU support to radeonfb (05/07) Dave Airlie
2006-07-22 15:38 ` [PATCH] gpu/drm: Add GPU layer support to generic DRM (06/07) Dave Airlie
2006-07-22 15:38 ` [PATCH] drm/gpu/radeon: Add radeon DRM support to use GPU layer (07/07) Dave Airlie
2006-07-22 19:54 ` [PATCH] gpu: Initial GPU layer addition. (03/07) Jesse Barnes
2006-07-22 21:04 ` Nix
2006-07-23 20:04 ` Luca
2006-07-22 16:34 ` [PATCH] drm: remove pci domain local copy (02/07) Jeff Garzik
2006-07-22 16:53 ` Dave Airlie
2006-07-22 16:35 ` [RFC] GPU device layer patchset (00/07) Jeff Garzik
2006-07-22 17:00 ` Dave Airlie
2006-07-31 12:42 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11535827133352-git-send-email-airlied@linux.ie \
--to=airlied@linux.ie \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox