Embedded linux removes the cursor on the monitor

1

When the size of the window of our application interface is the same as the size of the LCD, if the cursor is not removed, then a cursor in the upper left corner will keep flashing, which is not good. But it can show whether the kernel is down. Under normal circumstances will be removed.

2

Mainly revised files:

./drivers/video/console/fbcon.c

Just annotate the implementation of the following two functions.

Remove cursor display

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
}

Remove cursor blinking

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
}

Guess you like

Origin blog.csdn.net/amwha/article/details/78843304