Jiri Slaby (SUSE)
42822fabfc
tty: vt: change consw::con_set_origin() return type
...
The return value of consw::con_set_origin() is only true/false, meaining
if vc->vc_origin is set to vc->vc_screenbuf or not.
So switch the type and returned values accordingly.
And document the hook.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Helge Deller <deller@gmx.de >
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-39-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
4f59617065
tty: vt: make consw::con_font_default()'s name const
...
It's a name after all and that is not supposed to be changed. So make it
const to make this obvious.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
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-38-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
fd0f631fff
tty: vt: make font of consw::con_font_set() const
...
Provided the font parameter of consw::con_font_set() is not supposed to
be changed, make it const.
Signed-off-by: "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-37-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
77e110936a
tty: vt: make types around consw::con_blank() bool
...
Both the mode_switch parameter and the return value (a redraw needed)
are true/false. So switch them to bool, so that users won't return
-Eerrors or anything else.
And document the hook.
Signed-off-by: "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-36-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
0a58d83dfb
tty: vt: use enum constants for VESA blanking modes
...
Use the new enum for VESA constants. This improves type checking in
consw::con_blank().
Signed-off-by: "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-35-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
15d0fff7d6
tty: vt: use VESA blanking constants
...
There are VESA blanking constants defined in vesa.h. So use them in the
console code instead of constant values.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Helge Deller <deller@gmx.de >
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com >
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-34-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
ace4ebf9b7
tty: vt: define a common enum for VESA blanking constants
...
There are currently two places with VESA blanking constants definitions:
fb.h and console.h. Extract/unify the two to a separate header (vesa.h).
Given the fb's is in an uapi header, create the common header in uapi
too.
Note that instead of macros, an enum (vesa_blank_mode) is created. But
the macros are kept too (they now expand to the enum constants), just in
case someone in userspace performs some #ifdeffery.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Helge Deller <deller@gmx.de >
Cc: linux-kernel@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-33-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
735a51943f
tty: vt: stop using -1 for blank mode in consw::con_blank()
...
-1 is the same as VESA_VSYNC_SUSPEND in all con_blank() implementations.
So we can remove this special case from vgacon now too.
Despite con_blank() of fbcon looks complicated, the "if
(!fbcon_is_inactive(vc, info))" branch is not taken as we set
"ops->graphics = 1;" few lines above. So what matters there (as in all
other blank implementations except vgacon) is if 'blank' is zero or not.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Helge Deller <deller@gmx.de >
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-32-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
8d5cc8eed7
tty: vt: make consw::con_switch() return a bool
...
The non-zero (true) return value from consw::con_switch() means a redraw
is needed. So make this return type a bool explicitly instead of int.
The latter might imply that -Eerrors are expected. They are not.
And document the hook.
Signed-off-by: "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-31-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
a292e3fc94
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: "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: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
9aefbaeb30
fbdev/core: simplify cursor_state setting in fbcon_ops::cursor()
...
There is a switch decicing if cursor should be drawn or not. The whole
switch can be simplified to one line. Do this cleanup as a preparatory
work for the next patch. There, all the CM_* constants are removed.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Helge Deller <deller@gmx.de >
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-29-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
7c5337c9ea
consoles: use if instead of switch-case in consw::con_cursor()
...
This is only a preparation for the following cleanup patch to make it
easier. Provided CM_ERASE is the only different, use 'if' instead of
'switch+case' in all those.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Helge Deller <deller@gmx.de >
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-28-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
bfd7de49d7
tty: vt: sanitize consw::con_putcs() parameters
...
Similar to con_putc() in the previous patch:
* make the pointer to charattr a pointer to u16, and
* make x, y, and count unsigned as they are strictly non-negative.
And again, document that hook.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-27-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
338c28107b
tty: vt: sanitize consw::con_putc() parameters
...
Make parameters of consw::con_putc() saner:
* x and y are unsigned now, as they cannot be negative, and
* ca is made u16, as it is composed of two 8bit values (character and
attribute). See the con_putcs() hook, u16/ushort is worked on there.
And document the hook.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Helge Deller <deller@gmx.de >
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-26-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:54 -08:00
Jiri Slaby (SUSE)
8bc03a3009
tty: vt: eliminate unneeded consw::con_putc() implementations
...
All these consw::con_putc() implementations do the same as
consw::con_putcs() (only for one charattr) or even call
consw::con_putcs() on their own.
Drop them, as thanks to the new con_putc() helper in the previous patch,
the console code performs this already -- exactly if consw::con_putc()
is missing (NULL).
Signed-off-by: "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-25-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
387ccbdb63
tty: vt: add con_putc() helper
...
And let it call consw::con_putc() if it exists, otherwise
consw::con_putcs(). This is similar to tty_put_char().
It supports dropping unneeded duplication of code like sticon_putc() is
(see the next patch).
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-24-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
3ab8a65193
tty: vt: remove checks for count in consw::con_clear() implementations
...
'count' in consw::con_clear() is guaranteed to be positive. csi_X() (the
only caller) takes the minimum of the vc parameter (which is at least 1)
and count of characters till the end of the line. The latter is computed
as a subtraction of vc->vc_cols (count) and vc->state.x (offset). So for
the worst case, full line, it is 1.
Therefore, there is no point in checking zero or negative values (width
is now unsigned anyway).
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Helge Deller <deller@gmx.de >
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com >
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-23-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
559f01a0ee
tty: vt: sanitize arguments of consw::con_clear()
...
In consw::con_clear():
* Height is always 1, so drop it.
* Offsets and width are always unsigned values, so re-type them as such.
This needs a new __fbcon_clear() in the fbcon code to still handle
height which might not be 1 when called internally.
Note that tests for negative count/width are left in place -- they are
taken care of in the next patches.
And document the hook.
Signed-off-by: "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-22-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
dae3e6b618
tty: vt: make init parameter of consw::con_init() a bool
...
The 'init' parameter of consw::con_init() is true for the first call of
the hook on a particular console. So make the parameter a bool.
And document the hook.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be >
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-21-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
7995c30d8d
tty: vt: make consw::con_debug_*() return void
...
The return value of con_debug_enter() and con_debug_leave() is ignored
on many fronts. So just don't propagate errors (the current
implementations return 0 anyway) and make the return type a void.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Helge Deller <deller@gmx.de >
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-20-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
649f6fbe6a
tty: vt: remove extern from functions in selection.h
...
Remove unneeded 'extern' keyword from function prototypes in
selection.h. This makes it more readable as no more wrapping is needed
on many places.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-19-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
bf9e206b8a
tty: vt: define an enum for ascii characters
...
I didn't find definitions for ascii in the kernel yet, so define it for
non-printable characters used here.
Note we use ' ' instead of 32 on one line too.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-18-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
23672a572f
tty: vt: reflow csi_K()
...
Push cases one level left, according to coding style.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-17-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
7eb38a765e
tty: vt: define an enum for CSI+K codes
...
Decrypt the constant values by proper enum names. This time in csi_K().
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-16-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
8e6bd49a61
don't pass vc->vc_par[0] to csi_?() handlers
...
Fetch the value directly in the helpers instead.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-15-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
eb881ebab5
use clamp() for counts in csi_?() handlers
...
The count to process is supposed to be between 1 and vc->vc_cols -
vc->state.x (or rows and .y). clamp() can be used exactly for this,
instead of ifs and min().
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-14-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
fe4f6beb59
tty: vt: reflow csi_J()
...
Push cases one level left, according to coding style. And reorder local
variables.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-13-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
4b8f936185
tty: vt: define an enum for CSI+J codes
...
Decrypt the constant values by proper enum names. This time in csi_J().
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-12-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
76ec3a7a51
tty: vt: use case ranges for CSI+m fg/bg colors
...
Replacing the default case with the iffery by case ranges makes the code
more understandable at last.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-11-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
09e7f9f6c5
tty: vt: define an enum for CSI+m codes
...
It's always confusing to read all those case 0:, case 1: etc. in csi_*
handlers. Define enum entries for all those constants in CSI+m and use
them in csi_m().
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-10-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:53 -08:00
Jiri Slaby (SUSE)
d4c0c481e4
tty: vt: make vc_is_sel()'s vc const
...
It's only an aid to people reading the header and/or calling
vc_is_sel(). vc is only tested there, so having it const makes sense.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-9-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:52 -08:00
Jiri Slaby (SUSE)
beccdcfa15
tty: vt: pass vc_resize_user as a parameter
...
It is pretty unfortunate to set vc_data::vc_resize_user in two callers
of vc_do_resize(). vc_resize_user is immediately reset there (while
remembering it). So instead of this back and forth, pass 'from_user' as
a parameter.
Notes on 'int user':
* The name changes from 'user' to 'from_user' on some places to be
consistent.
* The type is bool now as 'int user' might evoke user's uid or whatever.
Provided vc_resize() is called on many places and they need not to care
about this parameter, its prototype is kept unchanged. Instead, it is
now an inline calling a new __vc_resize() which implements the above.
This patch makes the situation much more obvious.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Helge Deller <deller@gmx.de >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-8-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:52 -08:00
Jiri Slaby (SUSE)
d321cd13f6
tty: vt: push console lock from tioclinux() down to 2 functions
...
Avoid costly user copies under the console lock. So push the lock down
from tioclinux() to sel_loadlut() and set_vesa_blanking().
It is now obvious what is actually protected.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-7-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:52 -08:00
Jiri Slaby (SUSE)
a0b8a16812
tty: vt: pass proper pointers from tioclinux()
...
Pass proper types and proper pointers (the data with an offset) to the
TIOCL_* handlers. So that they need not to cast or add anything to the
passed pointer.
This makes obvious what is passed/consumed.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-6-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:52 -08:00
Jiri Slaby (SUSE)
b3dd9bef75
tty: vt: expect valid vc when in tty ops
...
At least since commits feebed6515 ("tty: shutdown method") and
bc1e99d93f ("TTY: vt, add ->install"), tty->driver_data in vc is
expected to be set since tty_operations::install() till ::cleanup().
So the checks of !tty->driver_data (aka !vc) in:
* vc_do_resize() by tty -> ioctl(TIOCSWINSZ) -> vt_resize()
* do_con_write() by tty -> tty_operations::write()/::put_char()
* con_flush_chars() by tty -> ::flush_chars()
are all superfluous. And also, holding a console lock is not needed to
fetch tty->driver_data.
Note there is even a stale comment in con_flush_chars() about a race
between that and con_close(). But con_close() does not set
tty->driver_data to NULL for years already.
Drop all these in a hope I am not terribly mistaken.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-5-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:52 -08:00
Jiri Slaby (SUSE)
0e6a92f67c
tty: vt: fix 20 vs 0x20 typo in EScsiignore
...
The if (c >= 20 && c <= 0x3f) test added in commit 7a99565f87 is
wrong. 20 is DC4 in ascii and it makes no sense to consider that as the
bottom limit. Instead, it should be 0x20 as in the other test in
the commit above. This is supposed to NOT change anything as we handle
interesting 20-0x20 asciis far before this if.
So for sakeness, change to 0x20 (which is SPACE).
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Fixes: 7a99565f87 ("vt: ignore csi sequences with intermediate characters.")
Cc: Martin Hostettler <textshell@uchuujin.de >
Link: https://lore.kernel.org/all/ZaP45QY2WEsDqoxg@neutronstar.dyndns.org/
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-4-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:52 -08:00
Jiri Slaby (SUSE)
b041c60590
fbcon: make display_desc a static array in fbcon_startup()
...
display_desc is a pointer to a RO string. Instead, switch display_desc
to a static array as we are used to. It BTW saves unnecessary 8B on the
stack.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Helge Deller <deller@gmx.de >
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-3-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:52 -08:00
Jiri Slaby (SUSE)
174657478c
vgacon: inline vc_scrolldelta_helper() into vgacon_scrolldelta()
...
Since commit 74d58cd48a ("USB: sisusbvga: remove console support"),
vgacon_scrolldelta() is the only user of vc_scrolldelta_helper().
Inline the helper into vgacon_scrolldelta() and drop it.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Helge Deller <deller@gmx.de >
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de > # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-2-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-27 18:08:52 -08:00
Linus Torvalds
6613476e22
Linux 6.8-rc1
v6.8-rc1
2024-01-21 14:11:32 -08:00
Linus Torvalds
35a4474b5c
Merge tag 'bcachefs-2024-01-21' of https://evilpiepirate.org/git/bcachefs
...
Pull more bcachefs updates from Kent Overstreet:
"Some fixes, Some refactoring, some minor features:
- Assorted prep work for disk space accounting rewrite
- BTREE_TRIGGER_ATOMIC: after combining our trigger callbacks, this
makes our trigger context more explicit
- A few fixes to avoid excessive transaction restarts on
multithreaded workloads: fstests (in addition to ktest tests) are
now checking slowpath counters, and that's shaking out a few bugs
- Assorted tracepoint improvements
- Starting to break up bcachefs_format.h and move on disk types so
they're with the code they belong to; this will make room to start
documenting the on disk format better.
- A few minor fixes"
* tag 'bcachefs-2024-01-21' of https://evilpiepirate.org/git/bcachefs: (46 commits)
bcachefs: Improve inode_to_text()
bcachefs: logged_ops_format.h
bcachefs: reflink_format.h
bcachefs; extents_format.h
bcachefs: ec_format.h
bcachefs: subvolume_format.h
bcachefs: snapshot_format.h
bcachefs: alloc_background_format.h
bcachefs: xattr_format.h
bcachefs: dirent_format.h
bcachefs: inode_format.h
bcachefs; quota_format.h
bcachefs: sb-counters_format.h
bcachefs: counters.c -> sb-counters.c
bcachefs: comment bch_subvolume
bcachefs: bch_snapshot::btime
bcachefs: add missing __GFP_NOWARN
bcachefs: opts->compression can now also be applied in the background
bcachefs: Prep work for variable size btree node buffers
bcachefs: grab s_umount only if snapshotting
...
2024-01-21 14:01:12 -08:00
Linus Torvalds
4fbbed7872
Merge tag 'timers-core-2024-01-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
...
Pull timer updates from Thomas Gleixner:
"Updates for time and clocksources:
- A fix for the idle and iowait time accounting vs CPU hotplug.
The time is reset on CPU hotplug which makes the accumulated
systemwide time jump backwards.
- Assorted fixes and improvements for clocksource/event drivers"
* tag 'timers-core-2024-01-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug
clocksource/drivers/ep93xx: Fix error handling during probe
clocksource/drivers/cadence-ttc: Fix some kernel-doc warnings
clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings
clocksource/timer-riscv: Add riscv_clock_shutdown callback
dt-bindings: timer: Add StarFive JH8100 clint
dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs
2024-01-21 11:14:40 -08:00
Linus Torvalds
7b297a5cc9
Merge tag 'powerpc-6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
...
Pull powerpc fixes from Aneesh Kumar:
- Increase default stack size to 32KB for Book3S
Thanks to Michael Ellerman.
* tag 'powerpc-6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/64s: Increase default stack size to 32KB
2024-01-21 11:04:29 -08:00
Kent Overstreet
249f441f83
bcachefs: Improve inode_to_text()
...
Add line breaks - inode_to_text() is now much easier to read.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2024-01-21 13:27:11 -05:00
Kent Overstreet
d826cc57c5
bcachefs: logged_ops_format.h
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2024-01-21 13:27:11 -05:00
Kent Overstreet
8d52ba60c4
bcachefs: reflink_format.h
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2024-01-21 13:27:11 -05:00
Kent Overstreet
b2fa1b633b
bcachefs; extents_format.h
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2024-01-21 13:27:11 -05:00
Kent Overstreet
0560eb9abf
bcachefs: ec_format.h
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2024-01-21 13:27:11 -05:00
Kent Overstreet
c6c4ff6507
bcachefs: subvolume_format.h
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2024-01-21 13:27:11 -05:00
Kent Overstreet
8fed323b14
bcachefs: snapshot_format.h
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2024-01-21 13:27:10 -05:00
Kent Overstreet
d455179fce
bcachefs: alloc_background_format.h
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev >
2024-01-21 13:27:10 -05:00