Skip to content

Commit 27a4c82

Browse files
Scot Doylegregkh
authored andcommitted
fbcon: use the cursor blink interval provided by vt
vt now provides a cursor blink interval via vc_data. Use this interval instead of the currently hardcoded 200 msecs. Store it in fbcon_ops to avoid locking the console in cursor_timer_handler(). Signed-off-by: Scot Doyle <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bd63364 commit 27a4c82

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

drivers/video/console/fbcon.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static void cursor_timer_handler(unsigned long dev_addr)
402402
struct fbcon_ops *ops = info->fbcon_par;
403403

404404
queue_work(system_power_efficient_wq, &info->queue);
405-
mod_timer(&ops->cursor_timer, jiffies + HZ/5);
405+
mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
406406
}
407407

408408
static void fbcon_add_cursor_timer(struct fb_info *info)
@@ -417,7 +417,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
417417

418418
init_timer(&ops->cursor_timer);
419419
ops->cursor_timer.function = cursor_timer_handler;
420-
ops->cursor_timer.expires = jiffies + HZ / 5;
420+
ops->cursor_timer.expires = jiffies + ops->cur_blink_jiffies;
421421
ops->cursor_timer.data = (unsigned long ) info;
422422
add_timer(&ops->cursor_timer);
423423
ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
@@ -1309,9 +1309,9 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
13091309
if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
13101310
return;
13111311

1312-
if (vc->vc_cursor_type & 0x10)
1313-
fbcon_del_cursor_timer(info);
1314-
else
1312+
ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
1313+
fbcon_del_cursor_timer(info);
1314+
if (!(vc->vc_cursor_type & 0x10))
13151315
fbcon_add_cursor_timer(info);
13161316

13171317
ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1;

drivers/video/console/fbcon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ struct fbcon_ops {
7070
struct fb_cursor cursor_state;
7171
struct display *p;
7272
int currcon; /* Current VC. */
73+
int cur_blink_jiffies;
7374
int cursor_flash;
7475
int cursor_reset;
7576
int blank_state;

0 commit comments

Comments
 (0)