aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2008-09-15 18:00:33 -0400
committerDave Airlie <airlied@linux.ie>2008-10-17 17:10:53 -0400
commit9bfbd5cb72c9edb8504a4a7a0aa89cdb2fcb4845 (patch)
treeb59f08475d3366e60e3c93538ad398905c4a74ec
parente0f0754ff6128570dcf38032f5bfb1f195e5bbee (diff)
drm: kill drm_device->irq
Like the last patch but adds a macro to get at the irq value instead of dereferencing pdev directly. Should make things easier for the BSD guys and if we ever support non-PCI devices. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_irq.c7
-rw-r--r--drivers/gpu/drm/drm_stub.c1
-rw-r--r--drivers/gpu/drm/mga/mga_state.c2
-rw-r--r--drivers/gpu/drm/r128/r128_state.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_state.c2
-rw-r--r--drivers/gpu/drm/via/via_irq.c3
-rw-r--r--drivers/gpu/drm/via/via_mm.c3
-rw-r--r--include/drm/drmP.h6
8 files changed, 11 insertions, 15 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index d0c13d954f52..4091b9e291f9 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -228,12 +228,9 @@ int drm_irq_install(struct drm_device *dev)
228 if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED)) 228 if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
229 sh_flags = IRQF_SHARED; 229 sh_flags = IRQF_SHARED;
230 230
231 ret = request_irq(dev->pdev->irq, dev->driver->irq_handler, 231 ret = request_irq(drm_dev_to_irq(dev), dev->driver->irq_handler,
232 sh_flags, dev->devname, dev); 232 sh_flags, dev->devname, dev);
233 /* Expose the device irq number to drivers that want to export it for 233
234 * whatever reason.
235 */
236 dev->irq = dev->pdev->irq;
237 if (ret < 0) { 234 if (ret < 0) {
238 mutex_lock(&dev->struct_mutex); 235 mutex_lock(&dev->struct_mutex);
239 dev->irq_enabled = 0; 236 dev->irq_enabled = 0;
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 82f4657b8879..141e33004a76 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -107,7 +107,6 @@ static int drm_fill_in_dev(struct drm_device * dev, struct pci_dev *pdev,
107#ifdef __alpha__ 107#ifdef __alpha__
108 dev->hose = pdev->sysdata; 108 dev->hose = pdev->sysdata;
109#endif 109#endif
110 dev->irq = pdev->irq;
111 110
112 if (drm_ht_create(&dev->map_hash, 12)) { 111 if (drm_ht_create(&dev->map_hash, 12)) {
113 return -ENOMEM; 112 return -ENOMEM;
diff --git a/drivers/gpu/drm/mga/mga_state.c b/drivers/gpu/drm/mga/mga_state.c
index d3f8aade07b3..b710fab21cb3 100644
--- a/drivers/gpu/drm/mga/mga_state.c
+++ b/drivers/gpu/drm/mga/mga_state.c
@@ -1022,7 +1022,7 @@ static int mga_getparam(struct drm_device *dev, void *data, struct drm_file *fil
1022 1022
1023 switch (param->param) { 1023 switch (param->param) {
1024 case MGA_PARAM_IRQ_NR: 1024 case MGA_PARAM_IRQ_NR:
1025 value = dev->irq; 1025 value = drm_dev_to_irq(dev);
1026 break; 1026 break;
1027 case MGA_PARAM_CARD_TYPE: 1027 case MGA_PARAM_CARD_TYPE:
1028 value = dev_priv->chipset; 1028 value = dev_priv->chipset;
diff --git a/drivers/gpu/drm/r128/r128_state.c b/drivers/gpu/drm/r128/r128_state.c
index 51a9afce7b9b..f7a5b5740764 100644
--- a/drivers/gpu/drm/r128/r128_state.c
+++ b/drivers/gpu/drm/r128/r128_state.c
@@ -1629,7 +1629,7 @@ static int r128_getparam(struct drm_device *dev, void *data, struct drm_file *fi
1629 1629
1630 switch (param->param) { 1630 switch (param->param) {
1631 case R128_PARAM_IRQ_NR: 1631 case R128_PARAM_IRQ_NR:
1632 value = dev->irq; 1632 value = drm_dev_to_irq(dev);
1633 break; 1633 break;
1634 default: 1634 default:
1635 return -EINVAL; 1635 return -EINVAL;
diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c
index 11c146b49211..5d7153fcc7b0 100644
--- a/drivers/gpu/drm/radeon/radeon_state.c
+++ b/drivers/gpu/drm/radeon/radeon_state.c
@@ -2997,7 +2997,7 @@ static int radeon_cp_getparam(struct drm_device *dev, void *data, struct drm_fil
2997 value = GET_SCRATCH(2); 2997 value = GET_SCRATCH(2);
2998 break; 2998 break;
2999 case RADEON_PARAM_IRQ_NR: 2999 case RADEON_PARAM_IRQ_NR:
3000 value = dev->irq; 3000 value = drm_dev_to_irq(dev);
3001 break; 3001 break;
3002 case RADEON_PARAM_GART_BASE: 3002 case RADEON_PARAM_GART_BASE:
3003 value = dev_priv->gart_vm_start; 3003 value = dev_priv->gart_vm_start;
diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
index 1b966fbdb49f..665d319b927b 100644
--- a/drivers/gpu/drm/via/via_irq.c
+++ b/drivers/gpu/drm/via/via_irq.c
@@ -354,9 +354,6 @@ int via_wait_irq(struct drm_device *dev, void *data, struct drm_file *file_priv)
354 drm_via_irq_t *cur_irq = dev_priv->via_irqs; 354 drm_via_irq_t *cur_irq = dev_priv->via_irqs;
355 int force_sequence; 355 int force_sequence;
356 356
357 if (!dev->irq)
358 return -EINVAL;
359
360 if (irqwait->request.irq >= dev_priv->num_irqs) { 357 if (irqwait->request.irq >= dev_priv->num_irqs) {
361 DRM_ERROR("Trying to wait on unknown irq %d\n", 358 DRM_ERROR("Trying to wait on unknown irq %d\n",
362 irqwait->request.irq); 359 irqwait->request.irq);
diff --git a/drivers/gpu/drm/via/via_mm.c b/drivers/gpu/drm/via/via_mm.c
index e64094916e4f..f694cb5ededc 100644
--- a/drivers/gpu/drm/via/via_mm.c
+++ b/drivers/gpu/drm/via/via_mm.c
@@ -93,8 +93,7 @@ int via_final_context(struct drm_device *dev, int context)
93 /* Last context, perform cleanup */ 93 /* Last context, perform cleanup */
94 if (dev->ctx_count == 1 && dev->dev_private) { 94 if (dev->ctx_count == 1 && dev->dev_private) {
95 DRM_DEBUG("Last Context\n"); 95 DRM_DEBUG("Last Context\n");
96 if (dev->irq) 96 drm_irq_uninstall(dev);
97 drm_irq_uninstall(dev);
98 via_cleanup_futex(dev_priv); 97 via_cleanup_futex(dev_priv);
99 via_do_cleanup_map(dev); 98 via_do_cleanup_map(dev);
100 } 99 }
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 51ee72c962b1..90a9e0247d58 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -824,7 +824,6 @@ struct drm_device {
824 824
825 /** \name Context support */ 825 /** \name Context support */
826 /*@{ */ 826 /*@{ */
827 int irq; /**< Interrupt used by board */
828 int irq_enabled; /**< True if irq handler is enabled */ 827 int irq_enabled; /**< True if irq handler is enabled */
829 __volatile__ long context_flag; /**< Context swapping flag */ 828 __volatile__ long context_flag; /**< Context swapping flag */
830 __volatile__ long interrupt_flag; /**< Interruption handler flag */ 829 __volatile__ long interrupt_flag; /**< Interruption handler flag */
@@ -915,6 +914,11 @@ struct drm_device {
915 914
916}; 915};
917 916
917static inline int drm_dev_to_irq(struct drm_device *dev)
918{
919 return dev->pdev->irq;
920}
921
918static __inline__ int drm_core_check_feature(struct drm_device *dev, 922static __inline__ int drm_core_check_feature(struct drm_device *dev,
919 int feature) 923 int feature)
920{ 924{