From: Helge Deller <deller@gmx.de>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
linux-fbdev@vger.kernel.org
Cc: Simona Vetter <simona@ffwll.ch>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/6] fbcon: fbcon_is_inactive() -> fbcon_is_active()
Date: Mon, 23 Sep 2024 21:44:59 +0200 [thread overview]
Message-ID: <d4a85d99-7dc3-454d-bcc2-4f4746a0f474@gmx.de> (raw)
In-Reply-To: <20240923155749.30846-5-ville.syrjala@linux.intel.com>
On 9/23/24 17:57, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Invert fbcon_is_inactive() into fbcon_is_active(). Much easier
> on the poor brain when you don't have to do dobule negations
> all over the place.
Agreed.
Acked-by: Helge Deller <deller@gmx.de>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/video/fbdev/core/fbcon.c | 30 +++++++++++++++---------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> index eb30aa872371..2a78cca3e9de 100644
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -281,12 +281,12 @@ static bool fbcon_skip_panic(struct fb_info *info)
> #endif
> }
>
> -static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info)
> +static inline int fbcon_is_active(struct vc_data *vc, struct fb_info *info)
> {
> struct fbcon_ops *ops = info->fbcon_par;
>
> - return (info->state != FBINFO_STATE_RUNNING ||
> - vc->vc_mode != KD_TEXT || ops->graphics || fbcon_skip_panic(info));
> + return info->state == FBINFO_STATE_RUNNING &&
> + vc->vc_mode == KD_TEXT && !ops->graphics && !fbcon_skip_panic(info);
> }
>
> static int get_color(struct vc_data *vc, struct fb_info *info,
> @@ -1253,7 +1253,7 @@ static void __fbcon_clear(struct vc_data *vc, unsigned int sy, unsigned int sx,
> struct fbcon_display *p = &fb_display[vc->vc_num];
> u_int y_break;
>
> - if (fbcon_is_inactive(vc, info))
> + if (!fbcon_is_active(vc, info))
> return;
>
> if (!height || !width)
> @@ -1295,7 +1295,7 @@ static void fbcon_putcs(struct vc_data *vc, const u16 *s, unsigned int count,
> struct fbcon_display *p = &fb_display[vc->vc_num];
> struct fbcon_ops *ops = info->fbcon_par;
>
> - if (!fbcon_is_inactive(vc, info))
> + if (fbcon_is_active(vc, info))
> ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
> get_color(vc, info, scr_readw(s), 1),
> get_color(vc, info, scr_readw(s), 0));
> @@ -1306,7 +1306,7 @@ static void fbcon_clear_margins(struct vc_data *vc, int bottom_only)
> struct fb_info *info = fbcon_info_from_console(vc->vc_num);
> struct fbcon_ops *ops = info->fbcon_par;
>
> - if (!fbcon_is_inactive(vc, info))
> + if (fbcon_is_active(vc, info))
> ops->clear_margins(vc, info, margin_color, bottom_only);
> }
>
> @@ -1318,7 +1318,7 @@ static void fbcon_cursor(struct vc_data *vc, bool enable)
>
> ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
>
> - if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
> + if (!fbcon_is_active(vc, info) || vc->vc_deccm != 1)
> return;
>
> if (vc->vc_cursor_type & CUR_SW)
> @@ -1724,7 +1724,7 @@ static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
> struct fb_info *info = fbcon_info_from_console(vc->vc_num);
> struct fbcon_display *p = &fb_display[vc->vc_num];
>
> - if (fbcon_is_inactive(vc, info))
> + if (!fbcon_is_active(vc, info))
> return;
>
> if (!width || !height)
> @@ -1748,7 +1748,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
> struct fbcon_display *p = &fb_display[vc->vc_num];
> int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK;
>
> - if (fbcon_is_inactive(vc, info))
> + if (!fbcon_is_active(vc, info))
> return true;
>
> fbcon_cursor(vc, false);
> @@ -2132,7 +2132,7 @@ static bool fbcon_switch(struct vc_data *vc)
> fbcon_del_cursor_work(old_info);
> }
>
> - if (fbcon_is_inactive(vc, info) ||
> + if (!fbcon_is_active(vc, info) ||
> ops->blank_state != FB_BLANK_UNBLANK)
> fbcon_del_cursor_work(info);
> else
> @@ -2172,7 +2172,7 @@ static bool fbcon_switch(struct vc_data *vc)
> scrollback_max = 0;
> scrollback_current = 0;
>
> - if (!fbcon_is_inactive(vc, info)) {
> + if (fbcon_is_active(vc, info)) {
> ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
> ops->update_start(info);
> }
> @@ -2228,7 +2228,7 @@ static bool fbcon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
> }
> }
>
> - if (!fbcon_is_inactive(vc, info)) {
> + if (fbcon_is_active(vc, info)) {
> if (ops->blank_state != blank) {
> ops->blank_state = blank;
> fbcon_cursor(vc, !blank);
> @@ -2242,7 +2242,7 @@ static bool fbcon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
> update_screen(vc);
> }
>
> - if (mode_switch || fbcon_is_inactive(vc, info) ||
> + if (mode_switch || !fbcon_is_active(vc, info) ||
> ops->blank_state != FB_BLANK_UNBLANK)
> fbcon_del_cursor_work(info);
> else
> @@ -2572,7 +2572,7 @@ static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table)
> int i, j, k, depth;
> u8 val;
>
> - if (fbcon_is_inactive(vc, info))
> + if (!fbcon_is_active(vc, info))
> return;
>
> if (!con_is_visible(vc))
> @@ -2672,7 +2672,7 @@ static void fbcon_modechanged(struct fb_info *info)
> scrollback_max = 0;
> scrollback_current = 0;
>
> - if (!fbcon_is_inactive(vc, info)) {
> + if (fbcon_is_active(vc, info)) {
> ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
> ops->update_start(info);
> }
next prev parent reply other threads:[~2024-09-23 19:45 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 15:57 [PATCH 0/6] fbcon: Fix 'cursor_blink' sysfs attribute Ville Syrjala
2024-09-23 15:57 ` [PATCH 1/6] fbcon: Make cursor_blink=0 work when configured before fb devices appear Ville Syrjala
2024-09-23 21:04 ` Helge Deller
2024-09-23 21:30 ` Ville Syrjälä
2024-09-23 21:50 ` Helge Deller
2024-09-24 8:27 ` Helge Deller
2024-09-24 8:30 ` Ville Syrjälä
2024-09-26 6:08 ` Helge Deller
2024-09-26 9:57 ` Ville Syrjälä
2024-09-26 10:13 ` Helge Deller
2025-02-13 14:42 ` Ville Syrjälä
2025-02-13 22:47 ` Helge Deller
2025-02-14 17:41 ` Ville Syrjälä
2025-02-14 19:17 ` Helge Deller
2024-09-23 15:57 ` [PATCH 2/6] fbcon: Add sysfs attributes before registering the device Ville Syrjala
2024-09-24 7:34 ` Thomas Zimmermann
2024-09-23 15:57 ` [PATCH 3/6] fbcon: fbcon_cursor_noblink -> fbcon_cursor_blink Ville Syrjala
2024-09-23 19:46 ` Helge Deller
2024-09-23 20:26 ` Ville Syrjälä
2024-09-23 20:48 ` [PATCH v2 " Ville Syrjala
2024-09-24 7:35 ` [PATCH " Thomas Zimmermann
2024-09-23 15:57 ` [PATCH 4/6] fbcon: fbcon_is_inactive() -> fbcon_is_active() Ville Syrjala
2024-09-23 19:44 ` Helge Deller [this message]
2024-09-24 7:37 ` Thomas Zimmermann
2024-09-23 15:57 ` [PATCH 5/6] fbcon: Introduce get_{fg,bg}_color() Ville Syrjala
2024-09-23 19:44 ` Helge Deller
2024-09-24 7:42 ` Thomas Zimmermann
2024-09-23 15:57 ` [PATCH 6/6] fbcon: Use 'bool' where appopriate Ville Syrjala
2024-09-23 19:47 ` Helge Deller
2024-09-23 20:50 ` [PATCH v2 " Ville Syrjala
2024-09-24 7:51 ` [PATCH " Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d4a85d99-7dc3-454d-bcc2-4f4746a0f474@gmx.de \
--to=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).