Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 60885
b: refs/heads/master
c: acba9cd
h: refs/heads/master
i:
  60883: fca34fb
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Jul 17, 2007
1 parent 6872f73 commit 549ca4e
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01b15bd4bfae794246c047b961a282e19014e240
refs/heads/master: acba9cd01974353294ecd0c750581a6707d1ebe1
74 changes: 73 additions & 1 deletion trunk/drivers/video/console/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ static int fbcon_set_origin(struct vc_data *);
#define DEFAULT_CURSOR_BLINK_RATE (20)

static int vbl_cursor_cnt;
static int fbcon_cursor_noblink;

#define divides(a, b) ((!(a) || (b)%(a)) ? 0 : 1)

Expand Down Expand Up @@ -441,7 +442,8 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
struct fbcon_ops *ops = info->fbcon_par;

if ((!info->queue.func || info->queue.func == fb_flashcursor) &&
!(ops->flags & FBCON_FLAGS_CURSOR_TIMER)) {
!(ops->flags & FBCON_FLAGS_CURSOR_TIMER) &&
!fbcon_cursor_noblink) {
if (!info->queue.func)
INIT_WORK(&info->queue, fb_flashcursor);

Expand Down Expand Up @@ -1349,6 +1351,11 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
return;

if (vc->vc_cursor_type & 0x10)
fbcon_del_cursor_timer(info);
else
fbcon_add_cursor_timer(info);

ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1;
if (mode & CM_SOFTBACK) {
mode &= ~CM_SOFTBACK;
Expand Down Expand Up @@ -3308,9 +3315,74 @@ static ssize_t show_rotate(struct class_device *class_device, char *buf)
return snprintf(buf, PAGE_SIZE, "%d\n", rotate);
}

static ssize_t show_cursor_blink(struct class_device *class_device, char *buf)
{
struct fb_info *info;
struct fbcon_ops *ops;
int idx, blink = -1;

if (fbcon_has_exited)
return 0;

acquire_console_sem();
idx = con2fb_map[fg_console];

if (idx == -1 || registered_fb[idx] == NULL)
goto err;

info = registered_fb[idx];
ops = info->fbcon_par;

if (!ops)
goto err;

blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0;
err:
release_console_sem();
return snprintf(buf, PAGE_SIZE, "%d\n", blink);
}

static ssize_t store_cursor_blink(struct class_device *clas_device,
const char *buf, size_t count)
{
struct fb_info *info;
int blink, idx;
char **last = NULL;

if (fbcon_has_exited)
return count;

acquire_console_sem();
idx = con2fb_map[fg_console];

if (idx == -1 || registered_fb[idx] == NULL)
goto err;

info = registered_fb[idx];

if (!info->fbcon_par)
goto err;

blink = simple_strtoul(buf, last, 0);

if (blink) {
fbcon_cursor_noblink = 0;
fbcon_add_cursor_timer(info);
} else {
fbcon_cursor_noblink = 1;
fbcon_del_cursor_timer(info);
}

err:
release_console_sem();
return count;
}

static struct class_device_attribute class_device_attrs[] = {
__ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate),
__ATTR(rotate_all, S_IWUSR, NULL, store_rotate_all),
__ATTR(cursor_blink, S_IRUGO|S_IWUSR, show_cursor_blink,
store_cursor_blink),
};

static int fbcon_init_class_device(void)
Expand Down

0 comments on commit 549ca4e

Please sign in to comment.