Commit a292e3fc authored by Jiri Slaby (SUSE)'s avatar Jiri Slaby (SUSE) Committed by Greg Kroah-Hartman
Browse files

tty: vt: remove CM_* constants



There is no difference between CM_MOVE and CM_DRAW. Either of them
enables the cursor. CM_ERASE then disables cursor.

So get rid of all of them and use simple "bool enable".

Note that this propagates down to the fbcon code.

And document the hook.

Signed-off-by: default avatar"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-parisc@vger.kernel.org
Tested-by: Helge Deller <deller@gmx.de> # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-30-jirislaby@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9aefbaeb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -860,7 +860,7 @@ static void hide_cursor(struct vc_data *vc)
	if (vc_is_sel(vc))
		clear_selection();

	vc->vc_sw->con_cursor(vc, CM_ERASE);
	vc->vc_sw->con_cursor(vc, false);
	hide_softcursor(vc);
}

@@ -873,7 +873,7 @@ static void set_cursor(struct vc_data *vc)
			clear_selection();
		add_softcursor(vc);
		if (CUR_SIZE(vc->vc_cursor_type) != CUR_NONE)
			vc->vc_sw->con_cursor(vc, CM_DRAW);
			vc->vc_sw->con_cursor(vc, true);
	} else
		hide_cursor(vc);
}
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ static void dummycon_init(struct vc_data *vc, bool init)
static void dummycon_deinit(struct vc_data *vc) { }
static void dummycon_clear(struct vc_data *vc, unsigned int sy, unsigned int sx,
			   unsigned int width) { }
static void dummycon_cursor(struct vc_data *vc, int mode) { }
static void dummycon_cursor(struct vc_data *vc, bool enable) { }

static bool dummycon_scroll(struct vc_data *vc, unsigned int top,
			    unsigned int bottom, enum con_scroll dir,
+2 −2
Original line number Diff line number Diff line
@@ -470,9 +470,9 @@ static int mdacon_blank(struct vc_data *c, int blank, int mode_switch)
	}
}

static void mdacon_cursor(struct vc_data *c, int mode)
static void mdacon_cursor(struct vc_data *c, bool enable)
{
	if (mode == CM_ERASE) {
	if (!enable) {
		mda_set_cursor(mda_vram_len - 1);
		return;
	}
+2 −2
Original line number Diff line number Diff line
@@ -438,14 +438,14 @@ static void newport_putcs(struct vc_data *vc, const u16 *s,
	}
}

static void newport_cursor(struct vc_data *vc, int mode)
static void newport_cursor(struct vc_data *vc, bool enable)
{
	unsigned short treg;
	int xcurs, ycurs;

	treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);

	if (mode == CM_ERASE) {
	if (!enable) {
		newport_vc2_set(npregs, VC2_IREG_CONTROL,
				(treg & ~(VC2_CTRL_ECDISP)));
		return;
+3 −3
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ static void sticon_putcs(struct vc_data *conp, const u16 *s, unsigned int count,
    }
}

static void sticon_cursor(struct vc_data *conp, int mode)
static void sticon_cursor(struct vc_data *conp, bool enable)
{
    unsigned short car1;

@@ -95,7 +95,7 @@ static void sticon_cursor(struct vc_data *conp, int mode)
	return;

    car1 = conp->vc_screenbuf[conp->state.x + conp->state.y * conp->vc_cols];
    if (mode == CM_ERASE) {
    if (!enable) {
	sti_putc(sticon_sti, car1, conp->state.y, conp->state.x,
		 font_data[conp->vc_num]);
	return;
@@ -121,7 +121,7 @@ static bool sticon_scroll(struct vc_data *conp, unsigned int t,
    if (vga_is_gfx)
        return false;

    sticon_cursor(conp, CM_ERASE);
    sticon_cursor(conp, false);

    switch (dir) {
    case SM_UP:
Loading