Skip to content

Commit

Permalink
drm: kill drm_device->irq
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jesse Barnes authored and Dave Airlie committed Oct 17, 2008
1 parent e0f0754 commit 9bfbd5c
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 15 deletions.
7 changes: 2 additions & 5 deletions drivers/gpu/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,9 @@ int drm_irq_install(struct drm_device *dev)
if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
sh_flags = IRQF_SHARED;

ret = request_irq(dev->pdev->irq, dev->driver->irq_handler,
ret = request_irq(drm_dev_to_irq(dev), dev->driver->irq_handler,
sh_flags, dev->devname, dev);
/* Expose the device irq number to drivers that want to export it for
* whatever reason.
*/
dev->irq = dev->pdev->irq;

if (ret < 0) {
mutex_lock(&dev->struct_mutex);
dev->irq_enabled = 0;
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/drm_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ static int drm_fill_in_dev(struct drm_device * dev, struct pci_dev *pdev,
#ifdef __alpha__
dev->hose = pdev->sysdata;
#endif
dev->irq = pdev->irq;

if (drm_ht_create(&dev->map_hash, 12)) {
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/mga/mga_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ static int mga_getparam(struct drm_device *dev, void *data, struct drm_file *fil

switch (param->param) {
case MGA_PARAM_IRQ_NR:
value = dev->irq;
value = drm_dev_to_irq(dev);
break;
case MGA_PARAM_CARD_TYPE:
value = dev_priv->chipset;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/r128/r128_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ static int r128_getparam(struct drm_device *dev, void *data, struct drm_file *fi

switch (param->param) {
case R128_PARAM_IRQ_NR:
value = dev->irq;
value = drm_dev_to_irq(dev);
break;
default:
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/radeon_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -2997,7 +2997,7 @@ static int radeon_cp_getparam(struct drm_device *dev, void *data, struct drm_fil
value = GET_SCRATCH(2);
break;
case RADEON_PARAM_IRQ_NR:
value = dev->irq;
value = drm_dev_to_irq(dev);
break;
case RADEON_PARAM_GART_BASE:
value = dev_priv->gart_vm_start;
Expand Down
3 changes: 0 additions & 3 deletions drivers/gpu/drm/via/via_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@ int via_wait_irq(struct drm_device *dev, void *data, struct drm_file *file_priv)
drm_via_irq_t *cur_irq = dev_priv->via_irqs;
int force_sequence;

if (!dev->irq)
return -EINVAL;

if (irqwait->request.irq >= dev_priv->num_irqs) {
DRM_ERROR("Trying to wait on unknown irq %d\n",
irqwait->request.irq);
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/via/via_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ int via_final_context(struct drm_device *dev, int context)
/* Last context, perform cleanup */
if (dev->ctx_count == 1 && dev->dev_private) {
DRM_DEBUG("Last Context\n");
if (dev->irq)
drm_irq_uninstall(dev);
drm_irq_uninstall(dev);
via_cleanup_futex(dev_priv);
via_do_cleanup_map(dev);
}
Expand Down
6 changes: 5 additions & 1 deletion include/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,6 @@ struct drm_device {

/** \name Context support */
/*@{ */
int irq; /**< Interrupt used by board */
int irq_enabled; /**< True if irq handler is enabled */
__volatile__ long context_flag; /**< Context swapping flag */
__volatile__ long interrupt_flag; /**< Interruption handler flag */
Expand Down Expand Up @@ -915,6 +914,11 @@ struct drm_device {

};

static inline int drm_dev_to_irq(struct drm_device *dev)
{
return dev->pdev->irq;
}

static __inline__ int drm_core_check_feature(struct drm_device *dev,
int feature)
{
Expand Down

0 comments on commit 9bfbd5c

Please sign in to comment.