Re: [PATCH v2 00/57] irqdomain: Cleanups and Documentation

2025-05-12 Thread Jiri Slaby
On 06. 05. 25, 15:41, Thomas Gleixner wrote: On Wed, Mar 19 2025 at 10:28, Jiri Slaby wrote: Hi, tl;dr if patches are agreed upon, I ask subsys maintainers to take the respective ones via their trees (as they are split per subsys), so that the IRQ tree can take only the rest. That would

Re: [PATCH v2 18/57] irqdomain: gpu: Switch to irq_domain_create_linear()

2025-03-19 Thread Jiri Slaby
On 19. 03. 25, 14:31, Alex Deucher wrote: On Wed, Mar 19, 2025 at 5:44 AM Jiri Slaby (SUSE) wrote: irq_domain_add_linear() is going away as being obsolete now. Switch to the preferred irq_domain_create_linear(). That differs in the first parameter: It takes more generic struct fwnode_handle

Re: [PATCH v2 00/57] irqdomain: Cleanups and Documentation

2025-03-19 Thread Jiri Slaby
On 19. 03. 25, 11:21, Andy Shevchenko wrote: I am all to support the idea, but in some cases I would think of a bit more work to be done to get rid of the of_fwnode_handle(np) in favour of dev_fwnode(dev). Note, this is based on a brief look, I haven't any example at hand right now. Aah, that's

[PATCH v2 18/57] irqdomain: gpu: Switch to irq_domain_create_linear()

2025-03-19 Thread Jiri Slaby (SUSE)
the users can likely use dev->fwnode directly instead of indirect of_fwnode_handle(dev->of_node). But dev->fwnode is not guaranteed to be set for all, so this has to be investigated on case to case basis (by people who can actually test with the HW). Signed-off-by: Jiri Slaby (SUSE)

[PATCH v2 44/57] irqdomain: gpu: Switch to irq_find_mapping()

2025-03-19 Thread Jiri Slaby (SUSE)
irq_linear_revmap() is deprecated, so remove all its uses and supersede them by an identical call to irq_find_mapping(). Signed-off-by: Jiri Slaby (SUSE) Cc: Philipp Zabel Cc: David Airlie Cc: Simona Vetter Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/ipu-v3/ipu-common.c | 4 ++-- 1

Re: [PATCH v3 00/16] Introduce and use generic parity16/32/64 helper

2025-03-09 Thread Jiri Slaby
On 09. 03. 25, 16:48, Kuan-Wei Chiu wrote: Would this work for everyone? +1 for /me. -- js suse labs

Re: [PATCH v3 01/16] bitops: Change parity8() return type to bool

2025-03-07 Thread Jiri Slaby
On 07. 03. 25, 12:38, Ingo Molnar wrote: * Jiri Slaby wrote: On 06. 03. 25, 17:25, Kuan-Wei Chiu wrote: Change return type to bool for better clarity. Update the kernel doc comment accordingly, including fixing "@value" to "@val" and adjusting examples. Also ma

Re: [PATCH v3 00/16] Introduce and use generic parity16/32/64 helper

2025-03-07 Thread Jiri Slaby
On 07. 03. 25, 10:19, Kuan-Wei Chiu wrote: I used to believe that casting a boolean variable to int would always result in 0 or 1 until a few months ago when Waiman Long explicitly pointed out during a review that C does not guarantee this. So I revisited the C11 standard, which states that cast

Re: [PATCH v3 00/16] Introduce and use generic parity16/32/64 helper

2025-03-06 Thread Jiri Slaby
On 06. 03. 25, 17:25, Kuan-Wei Chiu wrote: Several parts of the kernel contain redundant implementations of parity calculations for 16/32/64-bit values. Introduces generic parity16/32/64() helpers in bitops.h, providing a standardized and optimized implementation. Subsequent patches refactor var

Re: [PATCH v3 01/16] bitops: Change parity8() return type to bool

2025-03-06 Thread Jiri Slaby
On 06. 03. 25, 17:25, Kuan-Wei Chiu wrote: Change return type to bool for better clarity. Update the kernel doc comment accordingly, including fixing "@value" to "@val" and adjusting examples. Also mark the function with __attribute_const__ to allow potential compiler optimizations. Co-developed

Re: [PATCH 02/17] bitops: Add generic parity calculation for u64

2025-02-26 Thread Jiri Slaby
On 26. 02. 25, 19:33, Yury Norov wrote: Not in cases where macros are inevitable. I mean, do we need parityXX() for XX in (8, 16, 32, 64) at all? Isn't the parity() above enough for everybody? The existing codebase has something like: int ret; ret = i3c_master_get_free_addr(

Re: [PATCH 02/17] bitops: Add generic parity calculation for u64

2025-02-25 Thread Jiri Slaby
On 25. 02. 25, 14:29, Kuan-Wei Chiu wrote: +#define parity(val)\ +({ \ + u64 __v = (val);\ + int __ret; \ + switch (BITS_P

Re: [PATCH 07/17] serial: max3100: Replace open-coded parity calculation with parity8()

2025-02-24 Thread Jiri Slaby
On 23. 02. 25, 17:42, Kuan-Wei Chiu wrote: --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -16,6 +16,7 @@ /* 4 MAX3100s should be enough for everyone */ #define MAX_MAX3100 4 +#include #include #include #include @@ -133,7 +134,7 @@ static int max3100_do_

Re: [PATCH 02/17] bitops: Add generic parity calculation for u64

2025-02-24 Thread Jiri Slaby
On 23. 02. 25, 17:42, Kuan-Wei Chiu wrote: Several parts of the kernel open-code parity calculations using different methods. Add a generic parity64() helper implemented with the same efficient approach as parity8(). Co-developed-by: Yu-Chun Lin Signed-off-by: Yu-Chun Lin Signed-off-by: Kuan-W

Re: [PATCH 6/7] drivers: Repace get_task_comm() with %pTN

2024-12-12 Thread Jiri Slaby
Cc: Jani Nikula Cc: Rodrigo Vivi Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Cc: David Airlie Cc: Simona Vetter Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: Greg Kroah-Hartman Cc: Jiri Slaby --- drivers/accel/habanalabs/common/context.c | 5 ++--- .../accel/habanal

[PATCH] char/agp: remove agp_bridge_data::type

2024-02-13 Thread Jiri Slaby (SUSE)
agp_bridge_data::type is unused (and I cannot find when was used last). Therefore, remove it. Found by https://github.com/jirislaby/clang-struct. Signed-off-by: Jiri Slaby (SUSE) Cc: David Airlie Cc: dri-devel@lists.freedesktop.org --- drivers/char/agp/agp.h | 1 - 1 file changed, 1 deletion

[PATCH] fbcon: always restore the old font data in fbcon_do_set_font()

2024-02-08 Thread Jiri Slaby (SUSE)
t only for user fonts. Note the later 'if' is now protected by 'old_userfont' and not 'old_data' as the latter is always set now. (And it is supposed to be non-NULL. Otherwise we would see the bug above again.) Signed-off-by: Jiri Slaby (SUSE) Fixes: a5a923038d70

[PATCH v2 42/47] fbcon: remove fbcon_getxy()

2024-01-22 Thread Jiri Slaby (SUSE)
Again, fbcon_getxy() is the same as the default implementation since the softscroll removal in commit 50145474f6ef (fbcon: remove soft scrollback code). Drop that. Signed-off-by: Jiri Slaby (SUSE) Cc: Daniel Vetter Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel

[PATCH v2 39/47] fbcon: remove consw::con_screen_pos()

2024-01-22 Thread Jiri Slaby (SUSE)
llback code), both are always the same. So remove fbcon_screen_pos() too. Signed-off-by: Jiri Slaby (SUSE) Cc: Daniel Vetter Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/fbdev/core/fbcon.c | 6 -- 1 file changed, 6 deletions(-) d

[PATCH v2 36/47] tty: vt: make font of consw::con_font_set() const

2024-01-22 Thread Jiri Slaby (SUSE)
Provided the font parameter of consw::con_font_set() is not supposed to be changed, make it const. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Daniel Vetter Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc:

[PATCH v2 35/47] tty: vt: make types around consw::con_blank() bool

2024-01-22 Thread Jiri Slaby (SUSE)
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) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Daniel Ve

[PATCH v2 34/47] tty: vt: use enum constants for VESA blanking modes

2024-01-22 Thread Jiri Slaby (SUSE)
Use the new enum for VESA constants. This improves type checking in consw::con_blank(). Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Daniel Vetter Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-par...@vger.

[PATCH v2 25/47] tty: vt: sanitize consw::con_putc() parameters

2024-01-22 Thread Jiri Slaby (SUSE)
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

[PATCH v2 30/47] tty: vt: make consw::con_switch() return a bool

2024-01-22 Thread Jiri Slaby (SUSE)
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) Cc: Helge Deller Cc: "

[PATCH v2 37/47] tty: vt: make consw::con_font_default()'s name const

2024-01-22 Thread Jiri Slaby (SUSE)
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) Cc: "James E.J. Bottomley" Cc: Daniel Vetter Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-par...@vger.kernel.o

[PATCH v2 27/47] consoles: use if instead of switch-case in consw::con_cursor()

2024-01-22 Thread Jiri Slaby (SUSE)
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) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@l

[PATCH v2 38/47] tty: vt: change consw::con_set_origin() return type

2024-01-22 Thread Jiri Slaby (SUSE)
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) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org C

[PATCH v2 24/47] tty: vt: eliminate unneeded consw::con_putc() implementations

2024-01-22 Thread Jiri Slaby (SUSE)
missing (NULL). Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Daniel Vetter Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-par...@vger.kernel.org --- drivers/video/console/mdacon.c | 6 -- drivers/video/consol

[PATCH v2 32/47] tty: vt: define a common enum for VESA blanking constants

2024-01-22 Thread Jiri Slaby (SUSE)
t 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) Cc: Helge Deller Cc: linux-ker...@vger.kernel.org Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: Thomas Zimme

[PATCH v2 33/47] tty: vt: use VESA blanking constants

2024-01-22 Thread Jiri Slaby (SUSE)
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) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-par...@vger.

[PATCH v2 21/47] tty: vt: sanitize arguments of consw::con_clear()

2024-01-22 Thread Jiri Slaby (SUSE)
left in place -- they are taken care of in the next patches. And document the hook. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Daniel Vetter Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-par...@vger.kernel.org --- d

[PATCH v2 31/47] tty: vt: stop using -1 for blank mode in consw::con_blank()

2024-01-22 Thread Jiri Slaby (SUSE)
ew 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) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/tty/vt/vt.c| 2 +- driver

[PATCH v2 19/47] tty: vt: make consw::con_debug_*() return void

2024-01-22 Thread Jiri Slaby (SUSE)
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) Cc: Daniel Vetter Cc: Helge Deller Cc: lin

[PATCH v2 29/47] tty: vt: remove CM_* constants

2024-01-22 Thread Jiri Slaby (SUSE)
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)

[PATCH v2 28/47] fbdev/core: simplify cursor_state setting in fbcon_ops::cursor()

2024-01-22 Thread Jiri Slaby (SUSE)
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) Cc: Daniel Vetter Cc: Helge Deller Cc: linux-fb

[PATCH v2 22/47] tty: vt: remove checks for count in consw::con_clear() implementations

2024-01-22 Thread Jiri Slaby (SUSE)
set). 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) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.fre

[PATCH v2 20/47] tty: vt: make init parameter of consw::con_init() a bool

2024-01-22 Thread Jiri Slaby (SUSE)
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) Reviewed-by: Geert Uytterhoeven Cc: Helge Deller Cc: "James E.J. Bottomley" C

[PATCH v2 02/47] fbcon: make display_desc a static array in fbcon_startup()

2024-01-22 Thread Jiri Slaby (SUSE)
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) Cc: Daniel Vetter Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org

[PATCH v2 00/47] tty: vt: cleanup and documentation

2024-01-22 Thread Jiri Slaby (SUSE)
Cc: Thomas Zimmermann Jiri Slaby (SUSE) (47): vgacon: inline vc_scrolldelta_helper() into vgacon_scrolldelta() fbcon: make display_desc a static array in fbcon_startup() tty: vt: fix 20 vs 0x20 typo in EScsiignore tty: vt: expect valid vc when in tty ops tty: vt: pass proper pointers from

[PATCH v2 07/47] tty: vt: pass vc_resize_user as a parameter

2024-01-22 Thread Jiri Slaby (SUSE)
, 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) Cc: Helge Deller Cc: Daniel Vetter Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/tty/vt/vt.c

[PATCH v2 01/47] vgacon: inline vc_scrolldelta_helper() into vgacon_scrolldelta()

2024-01-22 Thread Jiri Slaby (SUSE)
Since commit 74d58cd48a8f ("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) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc:

Re: [PATCH 31/45] tty: vt: use VESA blanking constants

2024-01-18 Thread Jiri Slaby
On 18. 01. 24, 9:41, Thomas Zimmermann wrote: Is it hard to get a new UAPI header accepted (honest question)? Not at all, IMO. The header just needs to be correct™ as it would be set in stone once released. thanks, -- js suse labs

Re: [PATCH 31/45] tty: vt: use VESA blanking constants

2024-01-18 Thread Jiri Slaby
On 18. 01. 24, 9:30, Thomas Zimmermann wrote: Am 18.01.24 um 08:57 schrieb Jiri Slaby (SUSE): There are VESA blanking constants defined in console.h already. So use them in the console code instead of constant values. These constants also exist in include/uapi/linux/fb.h. It would be nice to

[PATCH 34/45] tty: vt: make font of consw::con_font_set() const

2024-01-18 Thread Jiri Slaby (SUSE)
Provided the font parameter of consw::con_font_set() is not supposed to be changed, make it const. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Daniel Vetter Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc:

[PATCH 33/45] tty: vt: make types around consw::con_blank() bool

2024-01-17 Thread Jiri Slaby (SUSE)
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) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Daniel Ve

[PATCH 32/45] tty: vt: use enum for VESA blanking modes

2024-01-17 Thread Jiri Slaby (SUSE)
kernel too. So protect them using __KERNEL__. In the kernel case, include linux/console.h instead. This header dependency is preexisting. Alternatively, we could create a vesa.h header with that sole enum and include it. If it turns out linux/console.h is too much for fb.h. Signed-off-by: Jiri Slaby

[PATCH 31/45] tty: vt: use VESA blanking constants

2024-01-17 Thread Jiri Slaby (SUSE)
There are VESA blanking constants defined in console.h already. So use them in the console code instead of constant values. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc:

[PATCH 30/45] tty: vt: stop using -1 for blank mode in consw::con_blank()

2024-01-17 Thread Jiri Slaby (SUSE)
ew 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) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/tty/vt/vt.c| 2 +- driver

[PATCH 40/45] fbcon: remove fbcon_getxy()

2024-01-17 Thread Jiri Slaby (SUSE)
Again, fbcon_getxy() is the same as the default implementation since the softscroll removal in commit 50145474f6ef (fbcon: remove soft scrollback code). Drop that. Signed-off-by: Jiri Slaby (SUSE) Cc: Daniel Vetter Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel

[PATCH 27/45] fbdev/core: simplify cursor_state setting in fbcon_ops::cursor()

2024-01-17 Thread Jiri Slaby (SUSE)
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) Cc: Daniel Vetter Cc: Helge Deller Cc: linux-fb

[PATCH 37/45] fbcon: remove consw::con_screen_pos()

2024-01-17 Thread Jiri Slaby (SUSE)
llback code), both are always the same. So remove fbcon_screen_pos() too. Signed-off-by: Jiri Slaby (SUSE) Cc: Daniel Vetter Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/fbdev/core/fbcon.c | 6 -- 1 file changed, 6 deletions(-) d

[PATCH 36/45] tty: vt: change consw::con_set_origin() return type

2024-01-17 Thread Jiri Slaby (SUSE)
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) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org C

[PATCH 24/45] tty: vt: sanitize consw::con_putc() parameters

2024-01-17 Thread Jiri Slaby (SUSE)
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

[PATCH 35/45] tty: vt: make consw::con_font_default()'s name const

2024-01-17 Thread Jiri Slaby (SUSE)
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) Cc: "James E.J. Bottomley" Cc: Daniel Vetter Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-par...@vger.kernel.o

[PATCH 18/45] tty: vt: make consw::con_debug_*() return void

2024-01-17 Thread Jiri Slaby (SUSE)
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) Cc: Daniel Vetter Cc: Helge Deller Cc: lin

[PATCH 29/45] tty: vt: make consw::con_switch() return a bool

2024-01-17 Thread Jiri Slaby (SUSE)
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) Cc: Helge Deller Cc: "

[PATCH 28/45] tty: vt: remove CM_* constants

2024-01-17 Thread Jiri Slaby (SUSE)
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)

[PATCH 26/45] consoles: use if instead of switch-case in consw::con_cursor()

2024-01-17 Thread Jiri Slaby (SUSE)
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) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@l

[PATCH 23/45] tty: vt: eliminate unneeded consw::con_putc() implementations

2024-01-17 Thread Jiri Slaby (SUSE)
missing (NULL). Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Daniel Vetter Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-par...@vger.kernel.org --- drivers/video/console/mdacon.c | 6 -- drivers/video/consol

[PATCH 21/45] tty: vt: remove checks for count in consw::con_clear() implementations

2024-01-17 Thread Jiri Slaby (SUSE)
set). 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) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.fre

[PATCH 20/45] tty: vt: sanitize arguments of consw::con_clear()

2024-01-17 Thread Jiri Slaby (SUSE)
left in place -- they are taken care of in the next patches. And document the hook. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Daniel Vetter Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-par...@vger.kernel.org --- d

[PATCH 19/45] tty: vt: make init parameter of consw::con_init() a bool

2024-01-17 Thread Jiri Slaby (SUSE)
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) Cc: Helge Deller Cc: "James E.J. Bottomley" Cc: Daniel Vetter Cc: linux-fb..

[PATCH 00/45] tty: vt: cleanup and documentation

2024-01-17 Thread Jiri Slaby (SUSE)
Cc: "James E.J. Bottomley" Cc: Jonathan Corbet Cc: linux-...@vger.kernel.org Cc: linux-fb...@vger.kernel.org Cc: linux-par...@vger.kernel.org Cc: Martin Hostettler Jiri Slaby (SUSE) (45): vgacon: inline vc_scrolldelta_helper() into vgacon_scrolldelta() fbcon: make display_desc a st

[PATCH 01/45] vgacon: inline vc_scrolldelta_helper() into vgacon_scrolldelta()

2024-01-17 Thread Jiri Slaby (SUSE)
Since commit 74d58cd48a8f ("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) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc:

[PATCH 07/45] tty: vt: pass vc_resize_user as a parameter

2024-01-17 Thread Jiri Slaby (SUSE)
, 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) Cc: Helge Deller Cc: Daniel Vetter Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/tty/vt/vt.c

[PATCH 02/45] fbcon: make display_desc a static array in fbcon_startup()

2024-01-17 Thread Jiri Slaby (SUSE)
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) Cc: Daniel Vetter Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org

Re: [PATCH v2 04/15] tty: Remove now superfluous sentinel element from ctl_table array

2023-10-02 Thread Jiri Slaby
~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/zo5yx5jfoggi%2f...@bombadil.infradead.org/) Remove sentinel from tty_table Signed-off-by: Joel Granados Reviewed-by: Jiri Slaby thanks, -- js suse labs

Re: [PATCH 04/15] tty: Remove now superfluous sentinel element from ctl_table array

2023-10-02 Thread Jiri Slaby
On 28. 09. 23, 15:21, Joel Granados via B4 Relay wrote: From: Joel Granados This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by

Re: [PATCH v2 1/1] drm/i915: Move abs_diff() to math.h

2023-07-23 Thread Jiri Slaby
On 21. 07. 23, 15:53, Andy Shevchenko wrote: abs_diff() belongs to math.h. Move it there. This will allow others to use it. Signed-off-by: Andy Shevchenko Reviewed-by: Jiri Slaby # tty/serial -- -- js suse labs

[PATCH 7/7] fbcon: remove unused display (p) from fbcon_redraw()

2023-07-12 Thread Jiri Slaby (SUSE)
The parameter is unused. Signed-off-by: Jiri Slaby (SUSE) Cc: Daniel Vetter Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/fbdev/core/fbcon.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev

[PATCH 5/7] vgacon: cache vc_cell_height in vgacon_cursor()

2023-07-12 Thread Jiri Slaby (SUSE)
There are many places c->vc_cell_height is used in the code of vgacon_cursor(). Caching the value to a local variable makes the code much easier to follow. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/vi

[PATCH 6/7] sticon: make sticon_set_def_font() void and remove op parameter

2023-07-12 Thread Jiri Slaby (SUSE)
sticon_set_def_font() always returns 0, so make it void. And remove an unused 'op' parameter. Signed-off-by: Jiri Slaby (SUSE) Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-par...@vger.kernel.org Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.or

[PATCH 3/7] vgacon: remove unused xpos from vgacon_set_cursor_size()

2023-07-12 Thread Jiri Slaby (SUSE)
xpos is unused, remove it. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/console/vgacon.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/video

[PATCH 4/7] vgacon: let vgacon_doresize() return void

2023-07-12 Thread Jiri Slaby (SUSE)
The return value is neither used, nor vgacon_doresize() returns an error. So change the reurn type to void. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/console/vgacon.c | 3 +-- 1 file changed, 1

[PATCH 2/7] vgacon: remove unneeded forward declarations

2023-07-12 Thread Jiri Slaby (SUSE)
Most of the forward declarations in vgacon are not needed. Drop them. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/console/vgacon.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff

[PATCH 1/7] vgacon: switch vgacon_scrolldelta() and vgacon_restore_screen()

2023-07-12 Thread Jiri Slaby (SUSE)
Switch vgacon_scrolldelta() and vgacon_restore_screen() positions, so that the former is not needed to be forward-declared. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/console/vgacon.c | 12

Re: [PATCH] fbcon: Check font dimension limits

2023-01-26 Thread Jiri Slaby
On 26. 01. 23, 8:43, Greg KH wrote: --- linux-6.0.orig/drivers/video/fbdev/core/fbcon.c +++ linux-6.0/drivers/video/fbdev/core/fbcon.c @@ -2489,9 +2489,12 @@ static int fbcon_set_font(struct vc_data h > FBCON_SWAP(info->var.rotate, info->var.yres, info->var.xres)) retu

Re: [PATCH] fbcon: Check font dimension limits

2023-01-26 Thread Jiri Slaby
On 26. 01. 23, 1:49, Samuel Thibault wrote: blit_x and blit_y are uint32_t, so fbcon currently cannot support fonts larger than 32x32. The 32x32 case also needs shifting an unsigned int, to properly set bit 31, otherwise we get "UBSAN: shift-out-of-bounds in fbcon_set_font", as reported on http

[PATCH -resend] drm/nouveau/kms/nv50- (gcc13): fix nv50_wndw_new_ prototype

2023-01-16 Thread Jiri Slaby (SUSE)
dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Jiri Slaby (SUSE) --- Notes: [v2] switch to uint instead of to enum drivers/gpu/drm/nouveau/dispnv50/wndw.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gp

[PATCH -resend] drm/nouveau/kms/nv50- (gcc13): fix nv50_wndw_new_ prototype

2023-01-16 Thread Jiri Slaby (SUSE)
dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Jiri Slaby (SUSE) --- Notes: [v2] switch to uint instead of to enum drivers/gpu/drm/nouveau/dispnv50/wndw.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gp

[PATCH] drm/nouveau/kms/nv50- (gcc13): fix nv50_wndw_new_ prototype

2022-12-12 Thread Jiri Slaby (SUSE)
dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Jiri Slaby (SUSE) --- drivers/gpu/drm/nouveau/dispnv50/wndw.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.h b/drivers/gpu/drm/no

[PATCH v2] drm/i915: remove circ_buf.h includes

2022-11-14 Thread Jiri Slaby (SUSE)
Cc: intel-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Jiri Slaby (SUSE) --- Notes: [v2] fixed e-mail setup drivers/gpu/drm/i915/display/intel_pipe_crc.c | 1 - drivers/gpu/drm/i915/i915_irq.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drive

[PATCH] drm/amd/display (gcc13): fix enum mismatch

2022-10-31 Thread Jiri Slaby (SUSE)
; Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: amd-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Jiri Slaby (SUSE) --- .../drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

[PATCH] drm/nouveau/kms/nv50- (gcc13): fix nv50_wndw_new_ prototype

2022-10-31 Thread Jiri Slaby (SUSE)
dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Jiri Slaby (SUSE) --- drivers/gpu/drm/nouveau/dispnv50/wndw.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.h b/drivers/gpu/drm/no

Re: [PATCH 1/2] drm/i915/display: fix randconfig build

2022-10-05 Thread Jiri Slaby
On 04. 10. 22, 12:52, Jani Nikula wrote: On Tue, 04 Oct 2022, "Jiri Slaby (SUSE)" wrote: When DRM_I915=y and BACKLIGHT_CLASS_DEVICE=m, the build fails: ld: drivers/gpu/drm/i915/display/intel_backlight.o: in function `intel_backlight_device_register': intel_backlight.

[PATCH 2/2] drm/i915: remove circ_buf.h includes

2022-10-04 Thread Jiri Slaby (SUSE)
Cc: intel-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Jiri Slaby (SUSE) --- drivers/gpu/drm/i915/display/intel_pipe_crc.c | 1 - drivers/gpu/drm/i915/i915_irq.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_pip

[PATCH 1/2] drm/i915/display: fix randconfig build

2022-10-04 Thread Jiri Slaby (SUSE)
Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: David Airlie Cc: Daniel Vetter Cc: intel-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Reported-by: Martin Liška Signed-off-by: Jiri Slaby (SUSE) --- drivers/gpu/drm/i915/display/intel_backlight.c | 2 +-

Re: [PATCH] tty/vt: Remove printable variable

2022-08-29 Thread Jiri Slaby
more. Give it a send off with style and let it rest in peace. FWIW: Reviewed-by: Jiri Slaby In hopes, nothing breaks. Signed-off-by: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: "Ilpo Järvinen" Cc: nick black Cc: Daniel Vetter Cc: Tetsuo Handa Cc: Yangxi Xiang C

Re: [PATCH] tty: vt: selection: Add check for valid tiocl_selection values

2022-08-04 Thread Jiri Slaby
On 04. 08. 22, 10:44, Helge Deller wrote: On 8/4/22 09:15, Helge Deller wrote: Hello Jiri, Thanks for looking into this patch! On 8/4/22 07:47, Jiri Slaby wrote: On 30. 07. 22, 20:49, Helge Deller wrote: The line and column numbers for the selection need to start at 1. Add the checks to

Re: [PATCH] tty: vt: selection: Add check for valid tiocl_selection values

2022-08-03 Thread Jiri Slaby
On 30. 07. 22, 20:49, Helge Deller wrote: The line and column numbers for the selection need to start at 1. Add the checks to prevent invalid input. Signed-off-by: Helge Deller Reported-by: syzbot+14b0e8f3fd1612e35...@syzkaller.appspotmail.com diff --git a/drivers/tty/vt/selection.c b/drivers/

[PATCH] drm/i915: remove circ_buf.h includes

2021-12-16 Thread Jiri Slaby
The last user of macros from that include was removed in 2018 by the commit below. Fixes: 6cc42152b02b ("drm/i915: Remove support for legacy debugfs crc interface") Signed-off-by: Jiri Slaby Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: David Airlie

[PATCH 04/44] vgacon: comment on vga_rolled_over

2021-03-01 Thread Jiri Slaby
Long time ago, I figured out what this number is good for and documented that locally. But never submitted, so do it now. Signed-off-by: Jiri Slaby Cc: dri-devel@lists.freedesktop.org Cc: linux-fb...@vger.kernel.org --- drivers/video/console/vgacon.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 09/12] vgacon: drop BROKEN_GRAPHICS_PROGRAMS

2021-01-05 Thread Jiri Slaby
vga_font_is_default global as it is only set and never read. Signed-off-by: Jiri Slaby Cc: dri-devel@lists.freedesktop.org Cc: linux-fb...@vger.kernel.org --- drivers/video/console/vgacon.c | 19 --- include/linux/vt_kern.h| 12 2 files changed, 31 deletions

Re: [PATCH v2 1/2] console: Remove dummy con_font_op() callback implementations

2020-11-02 Thread Jiri Slaby
On 02. 11. 20, 10:36, Peilin Ye wrote: `struct console_font` is a UAPI structure, thus ideally should not be used for kernel internal abstraction. Remove some dummy .con_font_set, .con_font_default and .con_font_copy `struct consw` callback implementations, to make it cleaner. ESEMANTIC_ERROR.

Re: [PATCH] fbcon: Disable accelerated scrolling

2020-10-28 Thread Jiri Slaby
On 28. 10. 20, 17:06, Daniel Vetter wrote: So ever since syzbot discovered fbcon, we have solid proof that it's full of bugs. And often the solution is to just delete code and remove features, e.g. 50145474f6ef ("fbcon: remove soft scrollback code"). ... --- a/drivers/video/fbdev/core/fbcon.c

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-29 Thread Jiri Slaby
On 29. 09. 20, 14:34, Peilin Ye wrote: > the work in general? I couldn't think of how do we clean up subsystems > one by one, while keeping a `console_font` in `struct vc_data`. Hi, feel free to change struct vc_data's content as you need, of course. Only the UAPI _definitions_ have to be preserv

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-24 Thread Jiri Slaby
On 24. 09. 20, 15:38, Peilin Ye wrote: > Hi all, > > syzbot has reported [1] a global out-of-bounds read issue in > fbcon_get_font(). A malicious user may resize `vc_font.height` to a large > value in vt_ioctl(), causing fbcon_get_font() to overflow our built-in > font data buffers, declared in li

Re: [PATCH 1/2] drm/virtio: fix unblank

2020-08-24 Thread Jiri Slaby
bool to force an update to fix that. > > v2: use drm_atomic_crtc_needs_modeset() (Daniel). > > Cc: 1882...@bugs.launchpad.net > Fixes: 3954ff10e06e ("drm/virtio: skip set_scanout if framebuffer didn't > change") > Signed-off-by: Gerd Hoffmann Tested-by: Jiri

Re: [PATCH 2/2] drm/virtio: Remove open-coded commit-tail function

2020-08-19 Thread Jiri Slaby
On 19. 08. 20, 15:24, Gerd Hoffmann wrote: > On Wed, Aug 19, 2020 at 02:43:28PM +0200, Jiri Slaby wrote: >> On 09. 07. 20, 14:33, Daniel Vetter wrote: >>> Exactly matches the one in the helpers. >> >> It's not that exact. The order of modeset_enables and planes

Re: [PATCH 2/2] drm/virtio: Remove open-coded commit-tail function

2020-08-19 Thread Jiri Slaby
On 19. 08. 20, 14:43, Jiri Slaby wrote: > On 09. 07. 20, 14:33, Daniel Vetter wrote: >> Exactly matches the one in the helpers. > > It's not that exact. The order of modeset_enables and planes is > different. And this causes a regression -- no fb in qemu. > > So if

  1   2   3   >