嵌入式linux下去掉显示器上的光标

1

当我们的应用界面的窗口的大小与LCD的大小一样的,如果不把光标去掉,那么会在左上角一个光标一直在闪烁,不好看。不过可以显示内核有没有宕机。一般情况下会去掉。

2

主要修改的文件:

./drivers/video/console/fbcon.c

把如下两个函数的实现注示掉就行了。

去掉光标显示

static void fb_flashcursor(struct work_struct *work)
{
#if 0
        struct fb_info *info = container_of(work, struct fb_info, queue);
        struct fbcon_ops *ops = info->fbcon_par;
        struct vc_data *vc = NULL;
        int c;
        int mode;

        console_lock();
        if (ops && ops->currcon != -1)
                vc = vc_cons[ops->currcon].d;

        if (!vc || !CON_IS_VISIBLE(vc) ||
            registered_fb[con2fb_map[vc->vc_num]] != info ||
            vc->vc_deccm != 1) {
                console_unlock();
                return;
        }

        c = scr_readw((u16 *) vc->vc_pos);
        mode = (!ops->cursor_flash || ops->cursor_state.enable) ?
                CM_ERASE : CM_DRAW;
        ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1),
                    get_color(vc, info, c, 0));
        console_unlock();
#endif
}

去掉光标闪烁

static void fbcon_cursor(struct vc_data *vc, int mode)
{
#if 0
        struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
        struct fbcon_ops *ops = info->fbcon_par;
        int y;
        int c = scr_readw((u16 *) vc->vc_pos);

        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;
                y = softback_lines;
        } else {
                if (softback_lines)
                        fbcon_set_origin(vc);
                y = 0;
        }

        ops->cursor(vc, info, mode, y, get_color(vc, info, c, 1),
                    get_color(vc, info, c, 0));
        vbl_cursor_cnt = CURSOR_DRAW_DELAY;
#endif
}

你可能感兴趣的:(Linux)