Commit 4423843c authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Dave Airlie

drm: Make irq_enabled bool

irq_enabled is only ever 0 or 1, so make it a bool.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 5380e929
...@@ -293,7 +293,7 @@ int drm_irq_install(struct drm_device *dev) ...@@ -293,7 +293,7 @@ int drm_irq_install(struct drm_device *dev)
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
return -EBUSY; return -EBUSY;
} }
dev->irq_enabled = 1; dev->irq_enabled = true;
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
DRM_DEBUG("irq=%d\n", drm_dev_to_irq(dev)); DRM_DEBUG("irq=%d\n", drm_dev_to_irq(dev));
...@@ -316,7 +316,7 @@ int drm_irq_install(struct drm_device *dev) ...@@ -316,7 +316,7 @@ int drm_irq_install(struct drm_device *dev)
if (ret < 0) { if (ret < 0) {
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
dev->irq_enabled = 0; dev->irq_enabled = false;
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
return ret; return ret;
} }
...@@ -330,7 +330,7 @@ int drm_irq_install(struct drm_device *dev) ...@@ -330,7 +330,7 @@ int drm_irq_install(struct drm_device *dev)
if (ret < 0) { if (ret < 0) {
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
dev->irq_enabled = 0; dev->irq_enabled = false;
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
if (!drm_core_check_feature(dev, DRIVER_MODESET)) if (!drm_core_check_feature(dev, DRIVER_MODESET))
vga_client_register(dev->pdev, NULL, NULL, NULL); vga_client_register(dev->pdev, NULL, NULL, NULL);
...@@ -351,14 +351,15 @@ EXPORT_SYMBOL(drm_irq_install); ...@@ -351,14 +351,15 @@ EXPORT_SYMBOL(drm_irq_install);
int drm_irq_uninstall(struct drm_device *dev) int drm_irq_uninstall(struct drm_device *dev)
{ {
unsigned long irqflags; unsigned long irqflags;
int irq_enabled, i; bool irq_enabled;
int i;
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EINVAL; return -EINVAL;
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
irq_enabled = dev->irq_enabled; irq_enabled = dev->irq_enabled;
dev->irq_enabled = 0; dev->irq_enabled = false;
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
/* /*
......
...@@ -716,13 +716,13 @@ static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev) ...@@ -716,13 +716,13 @@ static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
{ {
/* /*
* enable drm irq mode. * enable drm irq mode.
* - with irq_enabled = 1, we can use the vblank feature. * - with irq_enabled = true, we can use the vblank feature.
* *
* P.S. note that we wouldn't use drm irq handler but * P.S. note that we wouldn't use drm irq handler but
* just specific driver own one instead because * just specific driver own one instead because
* drm framework supports only one irq handler. * drm framework supports only one irq handler.
*/ */
drm_dev->irq_enabled = 1; drm_dev->irq_enabled = true;
/* /*
* with vblank_disable_allowed = true, vblank interrupt will be disabled * with vblank_disable_allowed = true, vblank interrupt will be disabled
......
...@@ -383,13 +383,13 @@ static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev) ...@@ -383,13 +383,13 @@ static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
{ {
/* /*
* enable drm irq mode. * enable drm irq mode.
* - with irq_enabled = 1, we can use the vblank feature. * - with irq_enabled = true, we can use the vblank feature.
* *
* P.S. note that we wouldn't use drm irq handler but * P.S. note that we wouldn't use drm irq handler but
* just specific driver own one instead because * just specific driver own one instead because
* drm framework supports only one irq handler. * drm framework supports only one irq handler.
*/ */
drm_dev->irq_enabled = 1; drm_dev->irq_enabled = true;
/* /*
* with vblank_disable_allowed = true, vblank interrupt will be disabled * with vblank_disable_allowed = true, vblank interrupt will be disabled
......
...@@ -169,5 +169,5 @@ void mga_driver_irq_uninstall(struct drm_device *dev) ...@@ -169,5 +169,5 @@ void mga_driver_irq_uninstall(struct drm_device *dev)
/* Disable *all* interrupts */ /* Disable *all* interrupts */
MGA_WRITE(MGA_IEN, 0); MGA_WRITE(MGA_IEN, 0);
dev->irq_enabled = 0; dev->irq_enabled = false;
} }
...@@ -261,7 +261,7 @@ int omap_drm_irq_install(struct drm_device *dev) ...@@ -261,7 +261,7 @@ int omap_drm_irq_install(struct drm_device *dev)
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
return -EBUSY; return -EBUSY;
} }
dev->irq_enabled = 1; dev->irq_enabled = true;
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
/* Before installing handler */ /* Before installing handler */
...@@ -272,7 +272,7 @@ int omap_drm_irq_install(struct drm_device *dev) ...@@ -272,7 +272,7 @@ int omap_drm_irq_install(struct drm_device *dev)
if (ret < 0) { if (ret < 0) {
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
dev->irq_enabled = 0; dev->irq_enabled = false;
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
return ret; return ret;
} }
...@@ -283,7 +283,7 @@ int omap_drm_irq_install(struct drm_device *dev) ...@@ -283,7 +283,7 @@ int omap_drm_irq_install(struct drm_device *dev)
if (ret < 0) { if (ret < 0) {
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
dev->irq_enabled = 0; dev->irq_enabled = false;
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
dispc_free_irq(dev); dispc_free_irq(dev);
} }
...@@ -294,11 +294,12 @@ int omap_drm_irq_install(struct drm_device *dev) ...@@ -294,11 +294,12 @@ int omap_drm_irq_install(struct drm_device *dev)
int omap_drm_irq_uninstall(struct drm_device *dev) int omap_drm_irq_uninstall(struct drm_device *dev)
{ {
unsigned long irqflags; unsigned long irqflags;
int irq_enabled, i; bool irq_enabled;
int i;
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
irq_enabled = dev->irq_enabled; irq_enabled = dev->irq_enabled;
dev->irq_enabled = 0; dev->irq_enabled = false;
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
/* /*
......
...@@ -264,7 +264,7 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags) ...@@ -264,7 +264,7 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags)
* core, so we need to set this manually in order to allow the * core, so we need to set this manually in order to allow the
* DRM_IOCTL_WAIT_VBLANK to operate correctly. * DRM_IOCTL_WAIT_VBLANK to operate correctly.
*/ */
drm->irq_enabled = 1; drm->irq_enabled = true;
err = drm_vblank_init(drm, drm->mode_config.num_crtc); err = drm_vblank_init(drm, drm->mode_config.num_crtc);
if (err < 0) if (err < 0)
......
...@@ -396,14 +396,14 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags) ...@@ -396,14 +396,14 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)
/* /*
* enable drm irq mode. * enable drm irq mode.
* - with irq_enabled = 1, we can use the vblank feature. * - with irq_enabled = true, we can use the vblank feature.
* *
* P.S. note that we wouldn't use drm irq handler but * P.S. note that we wouldn't use drm irq handler but
* just specific driver own one instead because * just specific driver own one instead because
* drm framework supports only one irq handler and * drm framework supports only one irq handler and
* drivers can well take care of their interrupts * drivers can well take care of their interrupts
*/ */
drm->irq_enabled = 1; drm->irq_enabled = true;
drm_mode_config_init(drm); drm_mode_config_init(drm);
imx_drm_mode_config_init(drm); imx_drm_mode_config_init(drm);
......
...@@ -1149,7 +1149,7 @@ struct drm_device { ...@@ -1149,7 +1149,7 @@ struct drm_device {
/** \name Context support */ /** \name Context support */
/*@{ */ /*@{ */
int irq_enabled; /**< True if irq handler is enabled */ bool irq_enabled; /**< True if irq handler is enabled */
__volatile__ long context_flag; /**< Context swapping flag */ __volatile__ long context_flag; /**< Context swapping flag */
int last_context; /**< Last current context */ int last_context; /**< Last current context */
/*@} */ /*@} */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment