From nobody Sat Oct 4 11:11:50 2025 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48282315773 for ; Mon, 18 Aug 2025 10:50:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755514212; cv=none; b=ec6j+w2X2pXojvl4uxuKRTpqgfmADTCG2vsBrcH/BJitTWgdzk/pyqArlg1DRX3cZkPrAcvnd9qAnA52XfUHEhftKVVjIeBNTdO6ZuILKNDpeN7EB/PpHUIN9hD2pTQkF3pk8gGh+iUwVD14a8aQFzF5pISFDQKo9TiAdBZrU9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755514212; c=relaxed/simple; bh=1FtGflq7EJb8RQspDnIkdCESNYr/H5gDqZATe00b9zQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tLajZ7Uqac5/ODuYgrMMc+RL0rpcrch4wSxq2RlNXJ8DOZdg3QDcsExfdMkiLKRYZ0OHnOj6w36Gi/BVfp297INExzHeCS6u1ZxNavVVOQtfdLuKINISV7die/NfWYmoeEllF5h9+I1cUvMLpuaEidjKEzsLcrq2oLXdhfxhKXk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=WN7XiqjM; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=T8I4AkLO; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=WN7XiqjM; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=T8I4AkLO; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="WN7XiqjM"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="T8I4AkLO"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="WN7XiqjM"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="T8I4AkLO" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3A7F421254; Mon, 18 Aug 2025 10:49:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1755514186; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v2TZ48VDTt1jbJ/079dh0Dt6TM12VQX3cMjlOnsLeV0=; b=WN7XiqjMC2CXeB7IIC3TK5W+k8ibKJe2ix9IIDmv674S9Zl+mMzrtLv4/VT4qg28roKz9Y SivRobi7jv0Xo5uyBD3/Q7lWP6Cqz6Jiibec6PHKKWIFysY0rFTOi0Op7tBCOBTn1eVMBZ h/MQIGuGS5f7gFZ20tLcEuJlVZV/nHY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1755514186; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v2TZ48VDTt1jbJ/079dh0Dt6TM12VQX3cMjlOnsLeV0=; b=T8I4AkLOdhW8Gm86qgVPLemZ0++JzOtzAn8yK6Y9a/pI+KRllE0TRMR8G3RU+XGrEotmvb ArpGxsmU8BkM95CA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1755514186; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v2TZ48VDTt1jbJ/079dh0Dt6TM12VQX3cMjlOnsLeV0=; b=WN7XiqjMC2CXeB7IIC3TK5W+k8ibKJe2ix9IIDmv674S9Zl+mMzrtLv4/VT4qg28roKz9Y SivRobi7jv0Xo5uyBD3/Q7lWP6Cqz6Jiibec6PHKKWIFysY0rFTOi0Op7tBCOBTn1eVMBZ h/MQIGuGS5f7gFZ20tLcEuJlVZV/nHY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1755514186; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v2TZ48VDTt1jbJ/079dh0Dt6TM12VQX3cMjlOnsLeV0=; b=T8I4AkLOdhW8Gm86qgVPLemZ0++JzOtzAn8yK6Y9a/pI+KRllE0TRMR8G3RU+XGrEotmvb ArpGxsmU8BkM95CA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 0A95D13686; Mon, 18 Aug 2025 10:49:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id MIUhAUoFo2hQVQAAD6G6ig (envelope-from ); Mon, 18 Aug 2025 10:49:46 +0000 From: Thomas Zimmermann To: simona@ffwll.ch, deller@gmx.de, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 5/6] fbcon: Streamline setting rotated/unrotated bitops Date: Mon, 18 Aug 2025 12:36:40 +0200 Message-ID: <20250818104655.235001-6-tzimmermann@suse.de> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818104655.235001-1-tzimmermann@suse.de> References: <20250818104655.235001-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; R_RATELIMIT(0.00)[to_ip_from(RLqirfcw6gnbcr9a9yhi49fhi6)]; TO_DN_SOME(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; URIBL_BLOCKED(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[ffwll.ch,gmx.de,vger.kernel.org,lists.freedesktop.org]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[gmx.de] X-Spam-Flag: NO X-Spam-Level: X-Spam-Score: -2.80 Content-Type: text/plain; charset="utf-8" Support for console rotation is somewhat bolted onto the helper fbcon_set_bitops() for unrotated displays. Update fbcon_set_bitops() with a switch statement that picks the correct settings helper for the current rotation. For unrotated consoles, set the bitops for in the new helper fbcon_set_bitops_ur(). Rename the other, existing helpers to match the common naming scheme. The old helper fbcon_set_rotate() is no longer used. Signed-off-by: Thomas Zimmermann --- drivers/video/fbdev/core/bitblit.c | 5 +---- drivers/video/fbdev/core/fbcon.c | 21 +++++++++++++++++++++ drivers/video/fbdev/core/fbcon.h | 8 +------- drivers/video/fbdev/core/fbcon_ccw.c | 2 +- drivers/video/fbdev/core/fbcon_cw.c | 2 +- drivers/video/fbdev/core/fbcon_rotate.c | 15 --------------- drivers/video/fbdev/core/fbcon_rotate.h | 16 +++++++++++++--- drivers/video/fbdev/core/fbcon_ud.c | 2 +- 8 files changed, 39 insertions(+), 32 deletions(-) diff --git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/= bitblit.c index 267bd1635a41..5fd5fa69a796 100644 --- a/drivers/video/fbdev/core/bitblit.c +++ b/drivers/video/fbdev/core/bitblit.c @@ -393,10 +393,7 @@ static const struct fbcon_bitops bit_fbcon_bitops =3D { .update_start =3D bit_update_start, }; =20 -void fbcon_set_bitops(struct fbcon *confb) +void fbcon_set_bitops_ur(struct fbcon *confb) { confb->bitops =3D &bit_fbcon_bitops; - - if (confb->rotate) - fbcon_set_rotate(confb); } diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fb= con.c index baaed48dbb4f..369a656521bd 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -81,6 +81,7 @@ #include =20 #include "fbcon.h" +#include "fbcon_rotate.h" #include "fb_internal.h" =20 /* @@ -270,6 +271,26 @@ static void fbcon_rotate_all(struct fb_info *info, u32= rotate) } #endif /* CONFIG_FRAMEBUFFER_CONSOLE_ROTATION */ =20 +static void fbcon_set_bitops(struct fbcon *confb) +{ + switch (confb->rotate) { + default: + fallthrough; + case FB_ROTATE_UR: + fbcon_set_bitops_ur(confb); + break; + case FB_ROTATE_CW: + fbcon_set_bitops_cw(confb); + break; + case FB_ROTATE_UD: + fbcon_set_bitops_ud(confb); + break; + case FB_ROTATE_CCW: + fbcon_set_bitops_ccw(confb); + break; + } +} + static int fbcon_get_rotate(struct fb_info *info) { struct fbcon *confb =3D info->fbcon_par; diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fb= con.h index 6a4dac3fd12e..8d5a4b980747 100644 --- a/drivers/video/fbdev/core/fbcon.h +++ b/drivers/video/fbdev/core/fbcon.h @@ -191,7 +191,7 @@ static inline u_short fb_scrollmode(struct fbcon_displa= y *fb) #ifdef CONFIG_FB_TILEBLITTING extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info); #endif -extern void fbcon_set_bitops(struct fbcon *confb); +extern void fbcon_set_bitops_ur(struct fbcon *confb); extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); =20 #define FBCON_ATTRIBUTE_UNDERLINE 1 @@ -229,10 +229,4 @@ static inline int get_attribute(struct fb_info *info, = u16 c) (void) (&_r =3D=3D &_v); \ (i =3D=3D FB_ROTATE_UR || i =3D=3D FB_ROTATE_UD) ? _r : _v; }) =20 -#ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION -extern void fbcon_set_rotate(struct fbcon *confb); -#else -#define fbcon_set_rotate(x) do {} while(0) -#endif /* CONFIG_FRAMEBUFFER_CONSOLE_ROTATION */ - #endif /* _VIDEO_FBCON_H */ diff --git a/drivers/video/fbdev/core/fbcon_ccw.c b/drivers/video/fbdev/cor= e/fbcon_ccw.c index 4902541305dd..1b1a0c923297 100644 --- a/drivers/video/fbdev/core/fbcon_ccw.c +++ b/drivers/video/fbdev/core/fbcon_ccw.c @@ -400,7 +400,7 @@ static const struct fbcon_bitops ccw_fbcon_bitops =3D { .rotate_font =3D fbcon_rotate_font, }; =20 -void fbcon_rotate_ccw(struct fbcon *confb) +void fbcon_set_bitops_ccw(struct fbcon *confb) { confb->bitops =3D &ccw_fbcon_bitops; } diff --git a/drivers/video/fbdev/core/fbcon_cw.c b/drivers/video/fbdev/core= /fbcon_cw.c index 0c924581e65d..72288b0cd27f 100644 --- a/drivers/video/fbdev/core/fbcon_cw.c +++ b/drivers/video/fbdev/core/fbcon_cw.c @@ -383,7 +383,7 @@ static const struct fbcon_bitops cw_fbcon_bitops =3D { .rotate_font =3D fbcon_rotate_font, }; =20 -void fbcon_rotate_cw(struct fbcon *confb) +void fbcon_set_bitops_cw(struct fbcon *confb) { confb->bitops =3D &cw_fbcon_bitops; } diff --git a/drivers/video/fbdev/core/fbcon_rotate.c b/drivers/video/fbdev/= core/fbcon_rotate.c index 8100d6f28e70..d311f15519dc 100644 --- a/drivers/video/fbdev/core/fbcon_rotate.c +++ b/drivers/video/fbdev/core/fbcon_rotate.c @@ -92,18 +92,3 @@ int fbcon_rotate_font(struct fb_info *info, struct vc_da= ta *vc) finished: return err; } - -void fbcon_set_rotate(struct fbcon *confb) -{ - switch (confb->rotate) { - case FB_ROTATE_CW: - fbcon_rotate_cw(confb); - break; - case FB_ROTATE_UD: - fbcon_rotate_ud(confb); - break; - case FB_ROTATE_CCW: - fbcon_rotate_ccw(confb); - break; - } -} diff --git a/drivers/video/fbdev/core/fbcon_rotate.h b/drivers/video/fbdev/= core/fbcon_rotate.h index c378687dd09d..ca70b91fab00 100644 --- a/drivers/video/fbdev/core/fbcon_rotate.h +++ b/drivers/video/fbdev/core/fbcon_rotate.h @@ -92,7 +92,17 @@ static inline void rotate_ccw(const char *in, char *out,= u32 width, u32 height) =20 int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc); =20 -extern void fbcon_rotate_cw(struct fbcon *confb); -extern void fbcon_rotate_ud(struct fbcon *confb); -extern void fbcon_rotate_ccw(struct fbcon *confb); +#if defined(CONFIG_FRAMEBUFFER_CONSOLE_ROTATION) +void fbcon_set_bitops_cw(struct fbcon *confb); +void fbcon_set_bitops_ud(struct fbcon *confb); +void fbcon_set_bitops_ccw(struct fbcon *confb); +#else +static inline void fbcon_set_bitops_cw(struct fbcon *confb) +{ } +static inline void fbcon_set_bitops_ud(struct fbcon *confb) +{ } +static inline void fbcon_set_bitops_ccw(struct fbcon *confb) +{ } +#endif + #endif diff --git a/drivers/video/fbdev/core/fbcon_ud.c b/drivers/video/fbdev/core= /fbcon_ud.c index 6bc73966e1ff..1f31eb87ec81 100644 --- a/drivers/video/fbdev/core/fbcon_ud.c +++ b/drivers/video/fbdev/core/fbcon_ud.c @@ -427,7 +427,7 @@ static const struct fbcon_bitops ud_fbcon_bitops =3D { .rotate_font =3D fbcon_rotate_font, }; =20 -void fbcon_rotate_ud(struct fbcon *confb) +void fbcon_set_bitops_ud(struct fbcon *confb) { confb->bitops =3D &ud_fbcon_bitops; } --=20 2.50.1