aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/via_dmablit.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-02-12 03:52:31 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:30 -0500
commit40565f1962c5be9b9e285e05af01ab7771534868 (patch)
treeae84097778a8adfc5a9aad8a5428fe803d54346a /drivers/char/drm/via_dmablit.c
parentd096f3e9898d469493fc0afe88d7285c4bdc3ce2 (diff)
[PATCH] Char: timers cleanup
- Use timer macros to set function and data members and to modify expiration time. - Use DEFINE_TIMER for global timers and do not init them at run-time in these cases. - del_timer_sync is common in most cases -- we want to wait for timer function if it's still running. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Dave Airlie <airlied@linux.ie> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Paul Fulghum <paulkf@microgate.com> Cc: Kylene Jo Hall <kjhall@us.ibm.com> Cc: Wim Van Sebroeck <wim@iguana.be> Acked-by: Dmitry Torokhov <dtor@mail.ru> (Input bits) Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/drm/via_dmablit.c')
-rw-r--r--drivers/char/drm/via_dmablit.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/char/drm/via_dmablit.c b/drivers/char/drm/via_dmablit.c
index 2054d5773717..2881a06b6f55 100644
--- a/drivers/char/drm/via_dmablit.c
+++ b/drivers/char/drm/via_dmablit.c
@@ -376,10 +376,8 @@ via_dmablit_handler(drm_device_t *dev, int engine, int from_irq)
376 blitq->cur = cur; 376 blitq->cur = cur;
377 blitq->num_outstanding--; 377 blitq->num_outstanding--;
378 blitq->end = jiffies + DRM_HZ; 378 blitq->end = jiffies + DRM_HZ;
379 if (!timer_pending(&blitq->poll_timer)) { 379 if (!timer_pending(&blitq->poll_timer))
380 blitq->poll_timer.expires = jiffies+1; 380 mod_timer(&blitq->poll_timer, jiffies + 1);
381 add_timer(&blitq->poll_timer);
382 }
383 } else { 381 } else {
384 if (timer_pending(&blitq->poll_timer)) { 382 if (timer_pending(&blitq->poll_timer)) {
385 del_timer(&blitq->poll_timer); 383 del_timer(&blitq->poll_timer);
@@ -478,8 +476,7 @@ via_dmablit_timer(unsigned long data)
478 via_dmablit_handler(dev, engine, 0); 476 via_dmablit_handler(dev, engine, 0);
479 477
480 if (!timer_pending(&blitq->poll_timer)) { 478 if (!timer_pending(&blitq->poll_timer)) {
481 blitq->poll_timer.expires = jiffies+1; 479 mod_timer(&blitq->poll_timer, jiffies + 1);
482 add_timer(&blitq->poll_timer);
483 480
484 /* 481 /*
485 * Rerun handler to delete timer if engines are off, and 482 * Rerun handler to delete timer if engines are off, and
@@ -574,9 +571,8 @@ via_init_dmablit(drm_device_t *dev)
574 } 571 }
575 DRM_INIT_WAITQUEUE(&blitq->busy_queue); 572 DRM_INIT_WAITQUEUE(&blitq->busy_queue);
576 INIT_WORK(&blitq->wq, via_dmablit_workqueue); 573 INIT_WORK(&blitq->wq, via_dmablit_workqueue);
577 init_timer(&blitq->poll_timer); 574 setup_timer(&blitq->poll_timer, via_dmablit_timer,
578 blitq->poll_timer.function = &via_dmablit_timer; 575 (unsigned long)blitq);
579 blitq->poll_timer.data = (unsigned long) blitq;
580 } 576 }
581} 577}
582 578