aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-10-04 07:53:37 -0400
committerDave Airlie <airlied@redhat.com>2013-10-09 01:55:32 -0400
commit4423843cde65232c1d553df220e1d133f4a0fa2b (patch)
tree29c570a6ab044f42f5c21989c6eea4532d8b0847
parent5380e9293b865d88de04de6e5324726d8c5b53c9 (diff)
drm: Make irq_enabled bool
irq_enabled is only ever 0 or 1, so make it a bool. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_irq.c11
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c4
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_vidi.c4
-rw-r--r--drivers/gpu/drm/mga/mga_irq.c2
-rw-r--r--drivers/gpu/drm/omapdrm/omap_irq.c11
-rw-r--r--drivers/gpu/host1x/drm/drm.c2
-rw-r--r--drivers/staging/imx-drm/imx-drm-core.c4
-rw-r--r--include/drm/drmP.h2
8 files changed, 21 insertions, 19 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index dea859f20035..f9af048828ea 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -293,7 +293,7 @@ int drm_irq_install(struct drm_device *dev)
293 mutex_unlock(&dev->struct_mutex); 293 mutex_unlock(&dev->struct_mutex);
294 return -EBUSY; 294 return -EBUSY;
295 } 295 }
296 dev->irq_enabled = 1; 296 dev->irq_enabled = true;
297 mutex_unlock(&dev->struct_mutex); 297 mutex_unlock(&dev->struct_mutex);
298 298
299 DRM_DEBUG("irq=%d\n", drm_dev_to_irq(dev)); 299 DRM_DEBUG("irq=%d\n", drm_dev_to_irq(dev));
@@ -316,7 +316,7 @@ int drm_irq_install(struct drm_device *dev)
316 316
317 if (ret < 0) { 317 if (ret < 0) {
318 mutex_lock(&dev->struct_mutex); 318 mutex_lock(&dev->struct_mutex);
319 dev->irq_enabled = 0; 319 dev->irq_enabled = false;
320 mutex_unlock(&dev->struct_mutex); 320 mutex_unlock(&dev->struct_mutex);
321 return ret; 321 return ret;
322 } 322 }
@@ -330,7 +330,7 @@ int drm_irq_install(struct drm_device *dev)
330 330
331 if (ret < 0) { 331 if (ret < 0) {
332 mutex_lock(&dev->struct_mutex); 332 mutex_lock(&dev->struct_mutex);
333 dev->irq_enabled = 0; 333 dev->irq_enabled = false;
334 mutex_unlock(&dev->struct_mutex); 334 mutex_unlock(&dev->struct_mutex);
335 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 335 if (!drm_core_check_feature(dev, DRIVER_MODESET))
336 vga_client_register(dev->pdev, NULL, NULL, NULL); 336 vga_client_register(dev->pdev, NULL, NULL, NULL);
@@ -351,14 +351,15 @@ EXPORT_SYMBOL(drm_irq_install);
351int drm_irq_uninstall(struct drm_device *dev) 351int drm_irq_uninstall(struct drm_device *dev)
352{ 352{
353 unsigned long irqflags; 353 unsigned long irqflags;
354 int irq_enabled, i; 354 bool irq_enabled;
355 int i;
355 356
356 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) 357 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
357 return -EINVAL; 358 return -EINVAL;
358 359
359 mutex_lock(&dev->struct_mutex); 360 mutex_lock(&dev->struct_mutex);
360 irq_enabled = dev->irq_enabled; 361 irq_enabled = dev->irq_enabled;
361 dev->irq_enabled = 0; 362 dev->irq_enabled = false;
362 mutex_unlock(&dev->struct_mutex); 363 mutex_unlock(&dev->struct_mutex);
363 364
364 /* 365 /*
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 1648b40700e8..23da72b5eae9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -716,13 +716,13 @@ static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
716{ 716{
717 /* 717 /*
718 * enable drm irq mode. 718 * enable drm irq mode.
719 * - with irq_enabled = 1, we can use the vblank feature. 719 * - with irq_enabled = true, we can use the vblank feature.
720 * 720 *
721 * P.S. note that we wouldn't use drm irq handler but 721 * P.S. note that we wouldn't use drm irq handler but
722 * just specific driver own one instead because 722 * just specific driver own one instead because
723 * drm framework supports only one irq handler. 723 * drm framework supports only one irq handler.
724 */ 724 */
725 drm_dev->irq_enabled = 1; 725 drm_dev->irq_enabled = true;
726 726
727 /* 727 /*
728 * with vblank_disable_allowed = true, vblank interrupt will be disabled 728 * with vblank_disable_allowed = true, vblank interrupt will be disabled
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 347aa40a94f5..ddaaedde173d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -383,13 +383,13 @@ static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
383{ 383{
384 /* 384 /*
385 * enable drm irq mode. 385 * enable drm irq mode.
386 * - with irq_enabled = 1, we can use the vblank feature. 386 * - with irq_enabled = true, we can use the vblank feature.
387 * 387 *
388 * P.S. note that we wouldn't use drm irq handler but 388 * P.S. note that we wouldn't use drm irq handler but
389 * just specific driver own one instead because 389 * just specific driver own one instead because
390 * drm framework supports only one irq handler. 390 * drm framework supports only one irq handler.
391 */ 391 */
392 drm_dev->irq_enabled = 1; 392 drm_dev->irq_enabled = true;
393 393
394 /* 394 /*
395 * with vblank_disable_allowed = true, vblank interrupt will be disabled 395 * with vblank_disable_allowed = true, vblank interrupt will be disabled
diff --git a/drivers/gpu/drm/mga/mga_irq.c b/drivers/gpu/drm/mga/mga_irq.c
index 598c281def0a..2b0ceb8dc11b 100644
--- a/drivers/gpu/drm/mga/mga_irq.c
+++ b/drivers/gpu/drm/mga/mga_irq.c
@@ -169,5 +169,5 @@ void mga_driver_irq_uninstall(struct drm_device *dev)
169 /* Disable *all* interrupts */ 169 /* Disable *all* interrupts */
170 MGA_WRITE(MGA_IEN, 0); 170 MGA_WRITE(MGA_IEN, 0);
171 171
172 dev->irq_enabled = 0; 172 dev->irq_enabled = false;
173} 173}
diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c b/drivers/gpu/drm/omapdrm/omap_irq.c
index 261b227e4692..cb858600185f 100644
--- a/drivers/gpu/drm/omapdrm/omap_irq.c
+++ b/drivers/gpu/drm/omapdrm/omap_irq.c
@@ -261,7 +261,7 @@ int omap_drm_irq_install(struct drm_device *dev)
261 mutex_unlock(&dev->struct_mutex); 261 mutex_unlock(&dev->struct_mutex);
262 return -EBUSY; 262 return -EBUSY;
263 } 263 }
264 dev->irq_enabled = 1; 264 dev->irq_enabled = true;
265 mutex_unlock(&dev->struct_mutex); 265 mutex_unlock(&dev->struct_mutex);
266 266
267 /* Before installing handler */ 267 /* Before installing handler */
@@ -272,7 +272,7 @@ int omap_drm_irq_install(struct drm_device *dev)
272 272
273 if (ret < 0) { 273 if (ret < 0) {
274 mutex_lock(&dev->struct_mutex); 274 mutex_lock(&dev->struct_mutex);
275 dev->irq_enabled = 0; 275 dev->irq_enabled = false;
276 mutex_unlock(&dev->struct_mutex); 276 mutex_unlock(&dev->struct_mutex);
277 return ret; 277 return ret;
278 } 278 }
@@ -283,7 +283,7 @@ int omap_drm_irq_install(struct drm_device *dev)
283 283
284 if (ret < 0) { 284 if (ret < 0) {
285 mutex_lock(&dev->struct_mutex); 285 mutex_lock(&dev->struct_mutex);
286 dev->irq_enabled = 0; 286 dev->irq_enabled = false;
287 mutex_unlock(&dev->struct_mutex); 287 mutex_unlock(&dev->struct_mutex);
288 dispc_free_irq(dev); 288 dispc_free_irq(dev);
289 } 289 }
@@ -294,11 +294,12 @@ int omap_drm_irq_install(struct drm_device *dev)
294int omap_drm_irq_uninstall(struct drm_device *dev) 294int omap_drm_irq_uninstall(struct drm_device *dev)
295{ 295{
296 unsigned long irqflags; 296 unsigned long irqflags;
297 int irq_enabled, i; 297 bool irq_enabled;
298 int i;
298 299
299 mutex_lock(&dev->struct_mutex); 300 mutex_lock(&dev->struct_mutex);
300 irq_enabled = dev->irq_enabled; 301 irq_enabled = dev->irq_enabled;
301 dev->irq_enabled = 0; 302 dev->irq_enabled = false;
302 mutex_unlock(&dev->struct_mutex); 303 mutex_unlock(&dev->struct_mutex);
303 304
304 /* 305 /*
diff --git a/drivers/gpu/host1x/drm/drm.c b/drivers/gpu/host1x/drm/drm.c
index 8c61ceeaa12d..df7d90a3a4fa 100644
--- a/drivers/gpu/host1x/drm/drm.c
+++ b/drivers/gpu/host1x/drm/drm.c
@@ -264,7 +264,7 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags)
264 * core, so we need to set this manually in order to allow the 264 * core, so we need to set this manually in order to allow the
265 * DRM_IOCTL_WAIT_VBLANK to operate correctly. 265 * DRM_IOCTL_WAIT_VBLANK to operate correctly.
266 */ 266 */
267 drm->irq_enabled = 1; 267 drm->irq_enabled = true;
268 268
269 err = drm_vblank_init(drm, drm->mode_config.num_crtc); 269 err = drm_vblank_init(drm, drm->mode_config.num_crtc);
270 if (err < 0) 270 if (err < 0)
diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c
index 52c29b3afa28..c1014eb2907d 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -396,14 +396,14 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)
396 396
397 /* 397 /*
398 * enable drm irq mode. 398 * enable drm irq mode.
399 * - with irq_enabled = 1, we can use the vblank feature. 399 * - with irq_enabled = true, we can use the vblank feature.
400 * 400 *
401 * P.S. note that we wouldn't use drm irq handler but 401 * P.S. note that we wouldn't use drm irq handler but
402 * just specific driver own one instead because 402 * just specific driver own one instead because
403 * drm framework supports only one irq handler and 403 * drm framework supports only one irq handler and
404 * drivers can well take care of their interrupts 404 * drivers can well take care of their interrupts
405 */ 405 */
406 drm->irq_enabled = 1; 406 drm->irq_enabled = true;
407 407
408 drm_mode_config_init(drm); 408 drm_mode_config_init(drm);
409 imx_drm_mode_config_init(drm); 409 imx_drm_mode_config_init(drm);
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 7198febd9d8e..713d7c699bcd 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1149,7 +1149,7 @@ struct drm_device {
1149 1149
1150 /** \name Context support */ 1150 /** \name Context support */
1151 /*@{ */ 1151 /*@{ */
1152 int irq_enabled; /**< True if irq handler is enabled */ 1152 bool irq_enabled; /**< True if irq handler is enabled */
1153 __volatile__ long context_flag; /**< Context swapping flag */ 1153 __volatile__ long context_flag; /**< Context swapping flag */
1154 int last_context; /**< Last current context */ 1154 int last_context; /**< Last current context */
1155 /*@} */ 1155 /*@} */