From nobody Thu Oct 2 22:48:44 2025 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 8866B33EB1A for ; Tue, 9 Sep 2025 12:49:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757422153; cv=none; b=F9brCJFuCKl3lF3T7zgCDtj1M4sN/wtNA+wYg3T9D7Qr+SSG1lzwllqNxIdUAj2Skb5KFTQEo6oFm8dAjTpPtVZQ/PTRhqha49b6F6oSY0Z++fx+HUgoTbDWToj8x6pX7Bgl5oAW4m4359IcJPbWO8cZUx1mWdnCMPFoXvtU+6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757422153; c=relaxed/simple; bh=jFTFkBdeUmrgMiNd5kCssdxObQfxExXXABln9vTuyG4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ABfbjSDG3iFEGiLUkQg4a1qes/sKNlSjQ9oJEvgVuvQw6Pi/AQUmEIKKXEiQALrTqFYHu8gJbyen0ocYjUI9c4xEvcbZ2rd+Ybn6hPIBoX8MBlMDclY15cuFvXJsr7ocDXM1F8zT70Jl9Y/b/8Rbfz42wLZQ6FenGsgfnYXbpXI= 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=MY4zDBU/; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=3e6eDYNZ; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=MY4zDBU/; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=3e6eDYNZ; arc=none smtp.client-ip=195.135.223.131 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="MY4zDBU/"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="3e6eDYNZ"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="MY4zDBU/"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="3e6eDYNZ" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out2.suse.de (Postfix) with ESMTPS id 3608920AC2; Tue, 9 Sep 2025 12:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757422144; 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=O0HvIyf9fblBRJJsPTgmzAyP2FHmBSKfV09sfj/n55A=; b=MY4zDBU/pm0M8yGjL7mhWamUc8chewhM2UN0E8AueCuwGB8Z7/52lWo9Et94wwTH1PVe1u 9RAOKWZvM4C1QQb8NHF/xnyFElFTQGtI1x91ynGSc+ugl2+aFafJ9wtL1poxwgh7NFzu22 nv4uZupKOwfmIdTW+c/4H4NndnOqIYs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757422144; 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=O0HvIyf9fblBRJJsPTgmzAyP2FHmBSKfV09sfj/n55A=; b=3e6eDYNZ/nGkoMHXPcX18f8vsalZ4zuxB1G9waIIO6NGRs/J4tKutbP1P8K6tTljAyHNhL e231ExLbFXLf+kDg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="MY4zDBU/"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=3e6eDYNZ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757422144; 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=O0HvIyf9fblBRJJsPTgmzAyP2FHmBSKfV09sfj/n55A=; b=MY4zDBU/pm0M8yGjL7mhWamUc8chewhM2UN0E8AueCuwGB8Z7/52lWo9Et94wwTH1PVe1u 9RAOKWZvM4C1QQb8NHF/xnyFElFTQGtI1x91ynGSc+ugl2+aFafJ9wtL1poxwgh7NFzu22 nv4uZupKOwfmIdTW+c/4H4NndnOqIYs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757422144; 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=O0HvIyf9fblBRJJsPTgmzAyP2FHmBSKfV09sfj/n55A=; b=3e6eDYNZ/nGkoMHXPcX18f8vsalZ4zuxB1G9waIIO6NGRs/J4tKutbP1P8K6tTljAyHNhL e231ExLbFXLf+kDg== 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 F18A513A56; Tue, 9 Sep 2025 12:49:03 +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 eBTBOT8iwGilUAAAD6G6ig (envelope-from ); Tue, 09 Sep 2025 12:49:03 +0000 From: Thomas Zimmermann To: sam@ravnborg.org, simona@ffwll.ch, deller@gmx.de Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 1/5] fbcon: Fix empty lines in fbcon.h Date: Tue, 9 Sep 2025 14:44:41 +0200 Message-ID: <20250909124616.143365-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250909124616.143365-1-tzimmermann@suse.de> References: <20250909124616.143365-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-Spam-Level: X-Spam-Flag: NO X-Rspamd-Queue-Id: 3608920AC2 X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; FREEMAIL_TO(0.00)[ravnborg.org,ffwll.ch,gmx.de]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_ENVRCPT(0.00)[gmx.de] X-Spam-Score: -3.01 Content-Type: text/plain; charset="utf-8" Add and remove empty lines as necessary to fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg --- drivers/video/fbdev/core/fbcon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fb= con.h index 4d97e6d8a16a..c535d8f84356 100644 --- a/drivers/video/fbdev/core/fbcon.h +++ b/drivers/video/fbdev/core/fbcon.h @@ -87,6 +87,7 @@ struct fbcon_ops { u32 cursor_size; u32 fd_size; }; + /* * Attribute Decoding */ @@ -106,7 +107,6 @@ struct fbcon_ops { ((s) & 0x400) #define attr_blink(s) \ ((s) & 0x8000) -=09 =20 static inline int mono_col(const struct fb_info *info) { --=20 2.51.0 From nobody Thu Oct 2 22:48:44 2025 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 B7F87340D9B for ; Tue, 9 Sep 2025 12:49:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757422162; cv=none; b=ubVl6opfraGO2QS9tC3EEedlhSKGDrx/XQreYmn3RITuV8zVwE08u5EFfyD0CDny8vhpsWZfvRwhkqZU+rxQtDUPuNPNUr9Y5nSFpHorML1bHQyH+voCwYLFTjP8eaXvO433cm/jkGEQ9hWUEcKkOEXyk0p5DEYXDH8AIeqKKWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757422162; c=relaxed/simple; bh=gcQoly8Gn0Zr8GwzyeGRg53TFA3mscYQL3dYFhayKX4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FhliNiRXEuQwjK7HCBCJ5SwSCOg2DhvFQ7CPj+uapMI46vhB3t/AmS2ScYeFSeF3VzOUuDZQ68Mc7ayb9Z/oklZz/0FyfGkUCUPAiivD/Jv7276Og1DjjCkwO6YXx+SKfQiMf5SOPr3biWgxbb8hKI2H02qmB4Ko1tW4GEzD5zA= 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=Qw1X818J; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=yf7gTkKY; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Qw1X818J; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=yf7gTkKY; arc=none smtp.client-ip=195.135.223.131 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="Qw1X818J"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="yf7gTkKY"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Qw1X818J"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="yf7gTkKY" 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-out2.suse.de (Postfix) with ESMTPS id 7A4D220CF6; Tue, 9 Sep 2025 12:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757422144; 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=nhV6omhRkIAcx5Agy1hZhkSEpHUCdZqiaQduhn9Jekg=; b=Qw1X818JstDWgMYpNrAKrTZcC3yBT/p+8tNiETQ/NhsHhNpZUgi3JeuMC1Umaz3hfJDJcH td+GsjuL+7aFXPbr7yUHWmIUb5GIHVq9JVkJKHTgBHo5CEx6DKcenjtcZ6PEbsyIfVpN2/ vzgiXJB6O/Je8k5hEcdW/1hjveDk/i0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757422144; 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=nhV6omhRkIAcx5Agy1hZhkSEpHUCdZqiaQduhn9Jekg=; b=yf7gTkKYAW9XjH8IIbli/5UlRmxuuzvFmioYKzt8l8sxxMhAmGa+jCixje6VTClhuyMMf2 y73hgzu9mSUPzDBA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757422144; 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=nhV6omhRkIAcx5Agy1hZhkSEpHUCdZqiaQduhn9Jekg=; b=Qw1X818JstDWgMYpNrAKrTZcC3yBT/p+8tNiETQ/NhsHhNpZUgi3JeuMC1Umaz3hfJDJcH td+GsjuL+7aFXPbr7yUHWmIUb5GIHVq9JVkJKHTgBHo5CEx6DKcenjtcZ6PEbsyIfVpN2/ vzgiXJB6O/Je8k5hEcdW/1hjveDk/i0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757422144; 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=nhV6omhRkIAcx5Agy1hZhkSEpHUCdZqiaQduhn9Jekg=; b=yf7gTkKYAW9XjH8IIbli/5UlRmxuuzvFmioYKzt8l8sxxMhAmGa+jCixje6VTClhuyMMf2 y73hgzu9mSUPzDBA== 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 38E371388C; Tue, 9 Sep 2025 12:49:04 +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 qN6yDEAiwGilUAAAD6G6ig (envelope-from ); Tue, 09 Sep 2025 12:49:04 +0000 From: Thomas Zimmermann To: sam@ravnborg.org, simona@ffwll.ch, deller@gmx.de Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 2/5] fbcon: Rename struct fbcon_ops to struct fbcon_par Date: Tue, 9 Sep 2025 14:44:42 +0200 Message-ID: <20250909124616.143365-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250909124616.143365-1-tzimmermann@suse.de> References: <20250909124616.143365-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-Spam-Level: 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)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:mid,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[ravnborg.org,ffwll.ch,gmx.de]; RCVD_TLS_ALL(0.00)[]; TO_DN_SOME(0.00)[]; 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-Score: -2.80 Content-Type: text/plain; charset="utf-8" The type struct fbcon_ops contains fbcon state and callbacks. As the callbacks will be removed from struct fbcon_ops, rename the data type to struct fbcon_par. Also rename the variables from ops to par. The _par postfix ("private access registers") is used throughout the fbdev subsystem for per-driver state. The fbcon pointer within struct fb_info is also named fbcon_par. Hence, the new naming fits existing practice. v2: - rename struct fbcon_ops to struct fbcon_par - fix build for CONFIG_FB_TILEBITTING=3Dn (kernel test robot) - fix indention Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg --- drivers/video/fbdev/core/bitblit.c | 122 +++---- drivers/video/fbdev/core/fbcon.c | 419 ++++++++++++------------ drivers/video/fbdev/core/fbcon.h | 6 +- drivers/video/fbdev/core/fbcon_ccw.c | 146 ++++----- drivers/video/fbdev/core/fbcon_cw.c | 146 ++++----- drivers/video/fbdev/core/fbcon_rotate.c | 40 +-- drivers/video/fbdev/core/fbcon_rotate.h | 6 +- drivers/video/fbdev/core/fbcon_ud.c | 162 ++++----- drivers/video/fbdev/core/softcursor.c | 18 +- drivers/video/fbdev/core/tileblit.c | 28 +- 10 files changed, 541 insertions(+), 552 deletions(-) diff --git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/= bitblit.c index f9475c14f733..ebadc9619699 100644 --- a/drivers/video/fbdev/core/bitblit.c +++ b/drivers/video/fbdev/core/bitblit.c @@ -236,10 +236,10 @@ static void bit_cursor(struct vc_data *vc, struct fb_= info *info, bool enable, int fg, int bg) { struct fb_cursor cursor; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; unsigned short charmask =3D vc->vc_hi_font_mask ? 0x1ff : 0xff; int w =3D DIV_ROUND_UP(vc->vc_font.width, 8), c; - int y =3D real_y(ops->p, vc->state.y); + int y =3D real_y(par->p, vc->state.y); int attribute, use_sw =3D vc->vc_cursor_type & CUR_SW; int err =3D 1; char *src; @@ -253,10 +253,10 @@ static void bit_cursor(struct vc_data *vc, struct fb_= info *info, bool enable, attribute =3D get_attribute(info, c); src =3D vc->vc_font.data + ((c & charmask) * (w * vc->vc_font.height)); =20 - if (ops->cursor_state.image.data !=3D src || - ops->cursor_reset) { - ops->cursor_state.image.data =3D src; - cursor.set |=3D FB_CUR_SETIMAGE; + if (par->cursor_state.image.data !=3D src || + par->cursor_reset) { + par->cursor_state.image.data =3D src; + cursor.set |=3D FB_CUR_SETIMAGE; } =20 if (attribute) { @@ -265,46 +265,46 @@ static void bit_cursor(struct vc_data *vc, struct fb_= info *info, bool enable, dst =3D kmalloc_array(w, vc->vc_font.height, GFP_ATOMIC); if (!dst) return; - kfree(ops->cursor_data); - ops->cursor_data =3D dst; + kfree(par->cursor_data); + par->cursor_data =3D dst; update_attr(dst, src, attribute, vc); src =3D dst; } =20 - if (ops->cursor_state.image.fg_color !=3D fg || - ops->cursor_state.image.bg_color !=3D bg || - ops->cursor_reset) { - ops->cursor_state.image.fg_color =3D fg; - ops->cursor_state.image.bg_color =3D bg; + if (par->cursor_state.image.fg_color !=3D fg || + par->cursor_state.image.bg_color !=3D bg || + par->cursor_reset) { + par->cursor_state.image.fg_color =3D fg; + par->cursor_state.image.bg_color =3D bg; cursor.set |=3D FB_CUR_SETCMAP; } =20 - if ((ops->cursor_state.image.dx !=3D (vc->vc_font.width * vc->state.x)) || - (ops->cursor_state.image.dy !=3D (vc->vc_font.height * y)) || - ops->cursor_reset) { - ops->cursor_state.image.dx =3D vc->vc_font.width * vc->state.x; - ops->cursor_state.image.dy =3D vc->vc_font.height * y; + if ((par->cursor_state.image.dx !=3D (vc->vc_font.width * vc->state.x)) || + (par->cursor_state.image.dy !=3D (vc->vc_font.height * y)) || + par->cursor_reset) { + par->cursor_state.image.dx =3D vc->vc_font.width * vc->state.x; + par->cursor_state.image.dy =3D vc->vc_font.height * y; cursor.set |=3D FB_CUR_SETPOS; } =20 - if (ops->cursor_state.image.height !=3D vc->vc_font.height || - ops->cursor_state.image.width !=3D vc->vc_font.width || - ops->cursor_reset) { - ops->cursor_state.image.height =3D vc->vc_font.height; - ops->cursor_state.image.width =3D vc->vc_font.width; + if (par->cursor_state.image.height !=3D vc->vc_font.height || + par->cursor_state.image.width !=3D vc->vc_font.width || + par->cursor_reset) { + par->cursor_state.image.height =3D vc->vc_font.height; + par->cursor_state.image.width =3D vc->vc_font.width; cursor.set |=3D FB_CUR_SETSIZE; } =20 - if (ops->cursor_state.hot.x || ops->cursor_state.hot.y || - ops->cursor_reset) { - ops->cursor_state.hot.x =3D cursor.hot.y =3D 0; + if (par->cursor_state.hot.x || par->cursor_state.hot.y || + par->cursor_reset) { + par->cursor_state.hot.x =3D cursor.hot.y =3D 0; cursor.set |=3D FB_CUR_SETHOT; } =20 if (cursor.set & FB_CUR_SETSIZE || - vc->vc_cursor_type !=3D ops->p->cursor_shape || - ops->cursor_state.mask =3D=3D NULL || - ops->cursor_reset) { + vc->vc_cursor_type !=3D par->p->cursor_shape || + par->cursor_state.mask =3D=3D NULL || + par->cursor_reset) { char *mask =3D kmalloc_array(w, vc->vc_font.height, GFP_ATOMIC); int cur_height, size, i =3D 0; u8 msk =3D 0xff; @@ -312,13 +312,13 @@ static void bit_cursor(struct vc_data *vc, struct fb_= info *info, bool enable, if (!mask) return; =20 - kfree(ops->cursor_state.mask); - ops->cursor_state.mask =3D mask; + kfree(par->cursor_state.mask); + par->cursor_state.mask =3D mask; =20 - ops->p->cursor_shape =3D vc->vc_cursor_type; + par->p->cursor_shape =3D vc->vc_cursor_type; cursor.set |=3D FB_CUR_SETSHAPE; =20 - switch (CUR_SIZE(ops->p->cursor_shape)) { + switch (CUR_SIZE(par->p->cursor_shape)) { case CUR_NONE: cur_height =3D 0; break; @@ -347,19 +347,19 @@ static void bit_cursor(struct vc_data *vc, struct fb_= info *info, bool enable, mask[i++] =3D msk; } =20 - ops->cursor_state.enable =3D enable && !use_sw; + par->cursor_state.enable =3D enable && !use_sw; =20 cursor.image.data =3D src; - cursor.image.fg_color =3D ops->cursor_state.image.fg_color; - cursor.image.bg_color =3D ops->cursor_state.image.bg_color; - cursor.image.dx =3D ops->cursor_state.image.dx; - cursor.image.dy =3D ops->cursor_state.image.dy; - cursor.image.height =3D ops->cursor_state.image.height; - cursor.image.width =3D ops->cursor_state.image.width; - cursor.hot.x =3D ops->cursor_state.hot.x; - cursor.hot.y =3D ops->cursor_state.hot.y; - cursor.mask =3D ops->cursor_state.mask; - cursor.enable =3D ops->cursor_state.enable; + cursor.image.fg_color =3D par->cursor_state.image.fg_color; + cursor.image.bg_color =3D par->cursor_state.image.bg_color; + cursor.image.dx =3D par->cursor_state.image.dx; + cursor.image.dy =3D par->cursor_state.image.dy; + cursor.image.height =3D par->cursor_state.image.height; + cursor.image.width =3D par->cursor_state.image.width; + cursor.hot.x =3D par->cursor_state.hot.x; + cursor.hot.y =3D par->cursor_state.hot.y; + cursor.mask =3D par->cursor_state.mask; + cursor.enable =3D par->cursor_state.enable; cursor.image.depth =3D 1; cursor.rop =3D ROP_XOR; =20 @@ -369,31 +369,31 @@ static void bit_cursor(struct vc_data *vc, struct fb_= info *info, bool enable, if (err) soft_cursor(info, &cursor); =20 - ops->cursor_reset =3D 0; + par->cursor_reset =3D 0; } =20 static int bit_update_start(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; int err; =20 - err =3D fb_pan_display(info, &ops->var); - ops->var.xoffset =3D info->var.xoffset; - ops->var.yoffset =3D info->var.yoffset; - ops->var.vmode =3D info->var.vmode; + err =3D fb_pan_display(info, &par->var); + par->var.xoffset =3D info->var.xoffset; + par->var.yoffset =3D info->var.yoffset; + par->var.vmode =3D info->var.vmode; return err; } =20 -void fbcon_set_bitops(struct fbcon_ops *ops) +void fbcon_set_bitops(struct fbcon_par *par) { - ops->bmove =3D bit_bmove; - ops->clear =3D bit_clear; - ops->putcs =3D bit_putcs; - ops->clear_margins =3D bit_clear_margins; - ops->cursor =3D bit_cursor; - ops->update_start =3D bit_update_start; - ops->rotate_font =3D NULL; - - if (ops->rotate) - fbcon_set_rotate(ops); + par->bmove =3D bit_bmove; + par->clear =3D bit_clear; + par->putcs =3D bit_putcs; + par->clear_margins =3D bit_clear_margins; + par->cursor =3D bit_cursor; + par->update_start =3D bit_update_start; + par->rotate_font =3D NULL; + + if (par->rotate) + fbcon_set_rotate(par); } diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fb= con.c index 55f5731e94c3..7f871ef3e624 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -198,27 +198,27 @@ static struct device *fbcon_device; #ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION static inline void fbcon_set_rotation(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 if (!(info->flags & FBINFO_MISC_TILEBLITTING) && - ops->p->con_rotate < 4) - ops->rotate =3D ops->p->con_rotate; + par->p->con_rotate < 4) + par->rotate =3D par->p->con_rotate; else - ops->rotate =3D 0; + par->rotate =3D 0; } =20 static void fbcon_rotate(struct fb_info *info, u32 rotate) { - struct fbcon_ops *ops=3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fb_info *fb_info; =20 - if (!ops || ops->currcon =3D=3D -1) + if (!par || par->currcon =3D=3D -1) return; =20 - fb_info =3D fbcon_info_from_console(ops->currcon); + fb_info =3D fbcon_info_from_console(par->currcon); =20 if (info =3D=3D fb_info) { - struct fbcon_display *p =3D &fb_display[ops->currcon]; + struct fbcon_display *p =3D &fb_display[par->currcon]; =20 if (rotate < 4) p->con_rotate =3D rotate; @@ -231,12 +231,12 @@ static void fbcon_rotate(struct fb_info *info, u32 ro= tate) =20 static void fbcon_rotate_all(struct fb_info *info, u32 rotate) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct vc_data *vc; struct fbcon_display *p; int i; =20 - if (!ops || ops->currcon < 0 || rotate > 3) + if (!par || par->currcon < 0 || rotate > 3) return; =20 for (i =3D first_fb_vc; i <=3D last_fb_vc; i++) { @@ -254,9 +254,9 @@ static void fbcon_rotate_all(struct fb_info *info, u32 = rotate) #else static inline void fbcon_set_rotation(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 - ops->rotate =3D FB_ROTATE_UR; + par->rotate =3D FB_ROTATE_UR; } =20 static void fbcon_rotate(struct fb_info *info, u32 rotate) @@ -272,9 +272,9 @@ static void fbcon_rotate_all(struct fb_info *info, u32 = rotate) =20 static int fbcon_get_rotate(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 - return (ops) ? ops->rotate : 0; + return (par) ? par->rotate : 0; } =20 static bool fbcon_skip_panic(struct fb_info *info) @@ -291,10 +291,10 @@ static bool fbcon_skip_panic(struct fb_info *info) =20 static inline bool fbcon_is_active(struct vc_data *vc, struct fb_info *inf= o) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 return info->state =3D=3D FBINFO_STATE_RUNNING && - vc->vc_mode =3D=3D KD_TEXT && !ops->graphics && !fbcon_skip_panic(info); + vc->vc_mode =3D=3D KD_TEXT && !par->graphics && !fbcon_skip_panic(info); } =20 static int get_color(struct vc_data *vc, struct fb_info *info, @@ -376,7 +376,7 @@ static int get_bg_color(struct vc_data *vc, struct fb_i= nfo *info, u16 c) =20 static void fb_flashcursor(struct work_struct *work) { - struct fbcon_ops *ops =3D container_of(work, struct fbcon_ops, cursor_wor= k.work); + struct fbcon_par *par =3D container_of(work, struct fbcon_par, cursor_wor= k.work); struct fb_info *info; struct vc_data *vc =3D NULL; int c; @@ -391,10 +391,10 @@ static void fb_flashcursor(struct work_struct *work) return; =20 /* protected by console_lock */ - info =3D ops->info; + info =3D par->info; =20 - if (ops->currcon !=3D -1) - vc =3D vc_cons[ops->currcon].d; + if (par->currcon !=3D -1) + vc =3D vc_cons[par->currcon].d; =20 if (!vc || !con_is_visible(vc) || fbcon_info_from_console(vc->vc_num) !=3D info || @@ -404,30 +404,30 @@ static void fb_flashcursor(struct work_struct *work) } =20 c =3D scr_readw((u16 *) vc->vc_pos); - enable =3D ops->cursor_flash && !ops->cursor_state.enable; - ops->cursor(vc, info, enable, + enable =3D par->cursor_flash && !par->cursor_state.enable; + par->cursor(vc, info, enable, get_fg_color(vc, info, c), get_bg_color(vc, info, c)); console_unlock(); =20 - queue_delayed_work(system_power_efficient_wq, &ops->cursor_work, - ops->cur_blink_jiffies); + queue_delayed_work(system_power_efficient_wq, &par->cursor_work, + par->cur_blink_jiffies); } =20 static void fbcon_add_cursor_work(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 if (fbcon_cursor_blink) - queue_delayed_work(system_power_efficient_wq, &ops->cursor_work, - ops->cur_blink_jiffies); + queue_delayed_work(system_power_efficient_wq, &par->cursor_work, + par->cur_blink_jiffies); } =20 static void fbcon_del_cursor_work(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 - cancel_delayed_work_sync(&ops->cursor_work); + cancel_delayed_work_sync(&par->cursor_work); } =20 #ifndef MODULE @@ -587,7 +587,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, stru= ct fb_info *info, int cols, int rows, int new_cols, int new_rows) { /* Need to make room for the logo */ - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; int cnt, erase =3D vc->vc_video_erase_char, step; unsigned short *save =3D NULL, *r, *q; int logo_height; @@ -603,7 +603,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, stru= ct fb_info *info, */ if (fb_get_color_depth(&info->var, &info->fix) =3D=3D 1) erase &=3D ~0x400; - logo_height =3D fb_prepare_logo(info, ops->rotate); + logo_height =3D fb_prepare_logo(info, par->rotate); logo_lines =3D DIV_ROUND_UP(logo_height, vc->vc_font.height); q =3D (unsigned short *) (vc->vc_origin + vc->vc_size_row * rows); @@ -675,15 +675,15 @@ static void fbcon_prepare_logo(struct vc_data *vc, st= ruct fb_info *info, #ifdef CONFIG_FB_TILEBLITTING static void set_blitting_type(struct vc_data *vc, struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 - ops->p =3D &fb_display[vc->vc_num]; + par->p =3D &fb_display[vc->vc_num]; =20 if ((info->flags & FBINFO_MISC_TILEBLITTING)) fbcon_set_tileops(vc, info); else { fbcon_set_rotation(info); - fbcon_set_bitops(ops); + fbcon_set_bitops(par); } } =20 @@ -700,12 +700,12 @@ static int fbcon_invalid_charcount(struct fb_info *in= fo, unsigned charcount) #else static void set_blitting_type(struct vc_data *vc, struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 info->flags &=3D ~FBINFO_MISC_TILEBLITTING; - ops->p =3D &fb_display[vc->vc_num]; + par->p =3D &fb_display[vc->vc_num]; fbcon_set_rotation(info); - fbcon_set_bitops(ops); + fbcon_set_bitops(par); } =20 static int fbcon_invalid_charcount(struct fb_info *info, unsigned charcoun= t) @@ -725,13 +725,13 @@ static void fbcon_release(struct fb_info *info) module_put(info->fbops->owner); =20 if (info->fbcon_par) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 fbcon_del_cursor_work(info); - kfree(ops->cursor_state.mask); - kfree(ops->cursor_data); - kfree(ops->cursor_src); - kfree(ops->fontbuffer); + kfree(par->cursor_state.mask); + kfree(par->cursor_data); + kfree(par->cursor_src); + kfree(par->fontbuffer); kfree(info->fbcon_par); info->fbcon_par =3D NULL; } @@ -739,7 +739,7 @@ static void fbcon_release(struct fb_info *info) =20 static int fbcon_open(struct fb_info *info) { - struct fbcon_ops *ops; + struct fbcon_par *par; =20 if (!try_module_get(info->fbops->owner)) return -ENODEV; @@ -753,16 +753,16 @@ static int fbcon_open(struct fb_info *info) } unlock_fb_info(info); =20 - ops =3D kzalloc(sizeof(struct fbcon_ops), GFP_KERNEL); - if (!ops) { + par =3D kzalloc(sizeof(*par), GFP_KERNEL); + if (!par) { fbcon_release(info); return -ENOMEM; } =20 - INIT_DELAYED_WORK(&ops->cursor_work, fb_flashcursor); - ops->info =3D info; - info->fbcon_par =3D ops; - ops->cur_blink_jiffies =3D HZ / 5; + INIT_DELAYED_WORK(&par->cursor_work, fb_flashcursor); + par->info =3D info; + info->fbcon_par =3D par; + par->cur_blink_jiffies =3D HZ / 5; =20 return 0; } @@ -809,12 +809,12 @@ static void con2fb_release_oldinfo(struct vc_data *vc= , struct fb_info *oldinfo, static void con2fb_init_display(struct vc_data *vc, struct fb_info *info, int unit, int show_logo) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; int ret; =20 - ops->currcon =3D fg_console; + par->currcon =3D fg_console; =20 - if (info->fbops->fb_set_par && !ops->initialized) { + if (info->fbops->fb_set_par && !par->initialized) { ret =3D info->fbops->fb_set_par(info); =20 if (ret) @@ -823,8 +823,8 @@ static void con2fb_init_display(struct vc_data *vc, str= uct fb_info *info, "error code %d\n", ret); } =20 - ops->initialized =3D true; - ops->graphics =3D 0; + par->initialized =3D true; + par->graphics =3D 0; fbcon_set_disp(info, &info->var, unit); =20 if (show_logo) { @@ -961,7 +961,7 @@ static const char *fbcon_startup(void) struct vc_data *vc =3D vc_cons[fg_console].d; const struct font_desc *font =3D NULL; struct fb_info *info =3D NULL; - struct fbcon_ops *ops; + struct fbcon_par *par; int rows, cols; =20 /* @@ -981,10 +981,10 @@ static const char *fbcon_startup(void) if (fbcon_open(info)) return NULL; =20 - ops =3D info->fbcon_par; - ops->currcon =3D -1; - ops->graphics =3D 1; - ops->cur_rotate =3D -1; + par =3D info->fbcon_par; + par->currcon =3D -1; + par->graphics =3D 1; + par->cur_rotate =3D -1; =20 p->con_rotate =3D initial_rotation; if (p->con_rotate =3D=3D -1) @@ -1007,8 +1007,8 @@ static const char *fbcon_startup(void) vc->vc_font.charcount =3D font->charcount; } =20 - cols =3D FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); - rows =3D FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); + cols =3D FBCON_SWAP(par->rotate, info->var.xres, info->var.yres); + rows =3D FBCON_SWAP(par->rotate, info->var.yres, info->var.xres); cols /=3D vc->vc_font.width; rows /=3D vc->vc_font.height; vc_resize(vc, cols, rows); @@ -1026,7 +1026,7 @@ static const char *fbcon_startup(void) static void fbcon_init(struct vc_data *vc, bool init) { struct fb_info *info; - struct fbcon_ops *ops; + struct fbcon_par *par; struct vc_data **default_mode =3D vc->vc_display_fg; struct vc_data *svc =3D *default_mode; struct fbcon_display *t, *p =3D &fb_display[vc->vc_num]; @@ -1100,8 +1100,8 @@ static void fbcon_init(struct vc_data *vc, bool init) if (!*vc->uni_pagedict_loc) con_copy_unimap(vc, svc); =20 - ops =3D info->fbcon_par; - ops->cur_blink_jiffies =3D msecs_to_jiffies(vc->vc_cur_blink_ms); + par =3D info->fbcon_par; + par->cur_blink_jiffies =3D msecs_to_jiffies(vc->vc_cur_blink_ms); =20 p->con_rotate =3D initial_rotation; if (p->con_rotate =3D=3D -1) @@ -1113,8 +1113,8 @@ static void fbcon_init(struct vc_data *vc, bool init) =20 cols =3D vc->vc_cols; rows =3D vc->vc_rows; - new_cols =3D FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); - new_rows =3D FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); + new_cols =3D FBCON_SWAP(par->rotate, info->var.xres, info->var.yres); + new_rows =3D FBCON_SWAP(par->rotate, info->var.yres, info->var.xres); new_cols /=3D vc->vc_font.width; new_rows /=3D vc->vc_font.height; =20 @@ -1126,7 +1126,7 @@ static void fbcon_init(struct vc_data *vc, bool init) * We need to do it in fbcon_init() to prevent screen corruption. */ if (con_is_visible(vc) && vc->vc_mode =3D=3D KD_TEXT) { - if (info->fbops->fb_set_par && !ops->initialized) { + if (info->fbops->fb_set_par && !par->initialized) { ret =3D info->fbops->fb_set_par(info); =20 if (ret) @@ -1135,10 +1135,10 @@ static void fbcon_init(struct vc_data *vc, bool ini= t) "error code %d\n", ret); } =20 - ops->initialized =3D true; + par->initialized =3D true; } =20 - ops->graphics =3D 0; + par->graphics =3D 0; =20 #ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION if ((info->flags & FBINFO_HWACCEL_COPYAREA) && @@ -1162,12 +1162,12 @@ static void fbcon_init(struct vc_data *vc, bool ini= t) if (logo) fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows); =20 - if (ops->rotate_font && ops->rotate_font(info, vc)) { - ops->rotate =3D FB_ROTATE_UR; + if (par->rotate_font && par->rotate_font(info, vc)) { + par->rotate =3D FB_ROTATE_UR; set_blitting_type(vc, info); } =20 - ops->p =3D &fb_display[fg_console]; + par->p =3D &fb_display[fg_console]; } =20 static void fbcon_free_font(struct fbcon_display *p) @@ -1205,7 +1205,7 @@ static void fbcon_deinit(struct vc_data *vc) { struct fbcon_display *p =3D &fb_display[vc->vc_num]; struct fb_info *info; - struct fbcon_ops *ops; + struct fbcon_par *par; int idx; =20 fbcon_free_font(p); @@ -1219,15 +1219,15 @@ static void fbcon_deinit(struct vc_data *vc) if (!info) goto finished; =20 - ops =3D info->fbcon_par; + par =3D info->fbcon_par; =20 - if (!ops) + if (!par) goto finished; =20 if (con_is_visible(vc)) fbcon_del_cursor_work(info); =20 - ops->initialized =3D false; + par->initialized =3D false; finished: =20 fbcon_free_font(p); @@ -1274,7 +1274,7 @@ static void __fbcon_clear(struct vc_data *vc, unsigne= d int sy, unsigned int sx, unsigned int height, unsigned int width) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; int fg, bg; struct fbcon_display *p =3D &fb_display[vc->vc_num]; u_int y_break; @@ -1289,7 +1289,7 @@ static void __fbcon_clear(struct vc_data *vc, unsigne= d int sy, unsigned int sx, vc->vc_top =3D 0; /* * If the font dimensions are not an integral of the display - * dimensions then the ops->clear below won't end up clearing + * dimensions then the par->clear below won't end up clearing * the margins. Call clear_margins here in case the logo * bitmap stretched into the margin area. */ @@ -1303,11 +1303,10 @@ static void __fbcon_clear(struct vc_data *vc, unsig= ned int sy, unsigned int sx, y_break =3D p->vrows - p->yscroll; if (sy < y_break && sy + height - 1 >=3D y_break) { u_int b =3D y_break - sy; - ops->clear(vc, info, real_y(p, sy), sx, b, width, fg, bg); - ops->clear(vc, info, real_y(p, sy + b), sx, height - b, - width, fg, bg); + par->clear(vc, info, real_y(p, sy), sx, b, width, fg, bg); + par->clear(vc, info, real_y(p, sy + b), sx, height - b, width, fg, bg); } else - ops->clear(vc, info, real_y(p, sy), sx, height, width, fg, bg); + par->clear(vc, info, real_y(p, sy), sx, height, width, fg, bg); } =20 static void fbcon_clear(struct vc_data *vc, unsigned int sy, unsigned int = sx, @@ -1321,10 +1320,10 @@ static void fbcon_putcs(struct vc_data *vc, const u= 16 *s, unsigned int count, { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); struct fbcon_display *p =3D &fb_display[vc->vc_num]; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 if (fbcon_is_active(vc, info)) - ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, + par->putcs(vc, info, s, count, real_y(p, ypos), xpos, get_fg_color(vc, info, scr_readw(s)), get_bg_color(vc, info, scr_readw(s))); } @@ -1332,19 +1331,19 @@ static void fbcon_putcs(struct vc_data *vc, const u= 16 *s, unsigned int count, static void fbcon_clear_margins(struct vc_data *vc, int bottom_only) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 if (fbcon_is_active(vc, info)) - ops->clear_margins(vc, info, margin_color, bottom_only); + par->clear_margins(vc, info, margin_color, bottom_only); } =20 static void fbcon_cursor(struct vc_data *vc, bool enable) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; int c =3D scr_readw((u16 *) vc->vc_pos); =20 - ops->cur_blink_jiffies =3D msecs_to_jiffies(vc->vc_cur_blink_ms); + par->cur_blink_jiffies =3D msecs_to_jiffies(vc->vc_cur_blink_ms); =20 if (!fbcon_is_active(vc, info) || vc->vc_deccm !=3D 1) return; @@ -1354,12 +1353,12 @@ static void fbcon_cursor(struct vc_data *vc, bool e= nable) else fbcon_add_cursor_work(info); =20 - ops->cursor_flash =3D enable; + par->cursor_flash =3D enable; =20 - if (!ops->cursor) + if (!par->cursor) return; =20 - ops->cursor(vc, info, enable, + par->cursor(vc, info, enable, get_fg_color(vc, info, c), get_bg_color(vc, info, c)); } @@ -1374,7 +1373,7 @@ static void fbcon_set_disp(struct fb_info *info, stru= ct fb_var_screeninfo *var, struct fbcon_display *p, *t; struct vc_data **default_mode, *vc; struct vc_data *svc; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; int rows, cols; unsigned long ret =3D 0; =20 @@ -1407,7 +1406,7 @@ static void fbcon_set_disp(struct fb_info *info, stru= ct fb_var_screeninfo *var, var->yoffset =3D info->var.yoffset; var->xoffset =3D info->var.xoffset; fb_set_var(info, var); - ops->var =3D info->var; + par->var =3D info->var; vc->vc_can_do_color =3D (fb_get_color_depth(&info->var, &info->fix)!=3D1); vc->vc_complement_mask =3D vc->vc_can_do_color ? 0x7700 : 0x0800; if (vc->vc_font.charcount =3D=3D 256) { @@ -1423,8 +1422,8 @@ static void fbcon_set_disp(struct fb_info *info, stru= ct fb_var_screeninfo *var, if (!*vc->uni_pagedict_loc) con_copy_unimap(vc, svc); =20 - cols =3D FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); - rows =3D FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); + cols =3D FBCON_SWAP(par->rotate, info->var.xres, info->var.yres); + rows =3D FBCON_SWAP(par->rotate, info->var.yres, info->var.xres); cols /=3D vc->vc_font.width; rows /=3D vc->vc_font.height; ret =3D vc_resize(vc, cols, rows); @@ -1436,16 +1435,16 @@ static void fbcon_set_disp(struct fb_info *info, st= ruct fb_var_screeninfo *var, static __inline__ void ywrap_up(struct vc_data *vc, int count) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fbcon_display *p =3D &fb_display[vc->vc_num]; =20 p->yscroll +=3D count; if (p->yscroll >=3D p->vrows) /* Deal with wrap */ p->yscroll -=3D p->vrows; - ops->var.xoffset =3D 0; - ops->var.yoffset =3D p->yscroll * vc->vc_font.height; - ops->var.vmode |=3D FB_VMODE_YWRAP; - ops->update_start(info); + par->var.xoffset =3D 0; + par->var.yoffset =3D p->yscroll * vc->vc_font.height; + par->var.vmode |=3D FB_VMODE_YWRAP; + par->update_start(info); scrollback_max +=3D count; if (scrollback_max > scrollback_phys_max) scrollback_max =3D scrollback_phys_max; @@ -1455,16 +1454,16 @@ static __inline__ void ywrap_up(struct vc_data *vc,= int count) static __inline__ void ywrap_down(struct vc_data *vc, int count) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fbcon_display *p =3D &fb_display[vc->vc_num]; =20 p->yscroll -=3D count; if (p->yscroll < 0) /* Deal with wrap */ p->yscroll +=3D p->vrows; - ops->var.xoffset =3D 0; - ops->var.yoffset =3D p->yscroll * vc->vc_font.height; - ops->var.vmode |=3D FB_VMODE_YWRAP; - ops->update_start(info); + par->var.xoffset =3D 0; + par->var.yoffset =3D p->yscroll * vc->vc_font.height; + par->var.vmode |=3D FB_VMODE_YWRAP; + par->update_start(info); scrollback_max -=3D count; if (scrollback_max < 0) scrollback_max =3D 0; @@ -1475,19 +1474,19 @@ static __inline__ void ypan_up(struct vc_data *vc, = int count) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); struct fbcon_display *p =3D &fb_display[vc->vc_num]; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 p->yscroll +=3D count; if (p->yscroll > p->vrows - vc->vc_rows) { - ops->bmove(vc, info, p->vrows - vc->vc_rows, + par->bmove(vc, info, p->vrows - vc->vc_rows, 0, 0, 0, vc->vc_rows, vc->vc_cols); p->yscroll -=3D p->vrows - vc->vc_rows; } =20 - ops->var.xoffset =3D 0; - ops->var.yoffset =3D p->yscroll * vc->vc_font.height; - ops->var.vmode &=3D ~FB_VMODE_YWRAP; - ops->update_start(info); + par->var.xoffset =3D 0; + par->var.yoffset =3D p->yscroll * vc->vc_font.height; + par->var.vmode &=3D ~FB_VMODE_YWRAP; + par->update_start(info); fbcon_clear_margins(vc, 1); scrollback_max +=3D count; if (scrollback_max > scrollback_phys_max) @@ -1498,7 +1497,7 @@ static __inline__ void ypan_up(struct vc_data *vc, in= t count) static __inline__ void ypan_up_redraw(struct vc_data *vc, int t, int count) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fbcon_display *p =3D &fb_display[vc->vc_num]; =20 p->yscroll +=3D count; @@ -1508,10 +1507,10 @@ static __inline__ void ypan_up_redraw(struct vc_dat= a *vc, int t, int count) fbcon_redraw_move(vc, p, t + count, vc->vc_rows - count, t); } =20 - ops->var.xoffset =3D 0; - ops->var.yoffset =3D p->yscroll * vc->vc_font.height; - ops->var.vmode &=3D ~FB_VMODE_YWRAP; - ops->update_start(info); + par->var.xoffset =3D 0; + par->var.yoffset =3D p->yscroll * vc->vc_font.height; + par->var.vmode &=3D ~FB_VMODE_YWRAP; + par->update_start(info); fbcon_clear_margins(vc, 1); scrollback_max +=3D count; if (scrollback_max > scrollback_phys_max) @@ -1523,19 +1522,19 @@ static __inline__ void ypan_down(struct vc_data *vc= , int count) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); struct fbcon_display *p =3D &fb_display[vc->vc_num]; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 p->yscroll -=3D count; if (p->yscroll < 0) { - ops->bmove(vc, info, 0, 0, p->vrows - vc->vc_rows, + par->bmove(vc, info, 0, 0, p->vrows - vc->vc_rows, 0, vc->vc_rows, vc->vc_cols); p->yscroll +=3D p->vrows - vc->vc_rows; } =20 - ops->var.xoffset =3D 0; - ops->var.yoffset =3D p->yscroll * vc->vc_font.height; - ops->var.vmode &=3D ~FB_VMODE_YWRAP; - ops->update_start(info); + par->var.xoffset =3D 0; + par->var.yoffset =3D p->yscroll * vc->vc_font.height; + par->var.vmode &=3D ~FB_VMODE_YWRAP; + par->update_start(info); fbcon_clear_margins(vc, 1); scrollback_max -=3D count; if (scrollback_max < 0) @@ -1546,7 +1545,7 @@ static __inline__ void ypan_down(struct vc_data *vc, = int count) static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int cou= nt) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fbcon_display *p =3D &fb_display[vc->vc_num]; =20 p->yscroll -=3D count; @@ -1556,10 +1555,10 @@ static __inline__ void ypan_down_redraw(struct vc_d= ata *vc, int t, int count) fbcon_redraw_move(vc, p, t, vc->vc_rows - count, t + count); } =20 - ops->var.xoffset =3D 0; - ops->var.yoffset =3D p->yscroll * vc->vc_font.height; - ops->var.vmode &=3D ~FB_VMODE_YWRAP; - ops->update_start(info); + par->var.xoffset =3D 0; + par->var.yoffset =3D p->yscroll * vc->vc_font.height; + par->var.vmode &=3D ~FB_VMODE_YWRAP; + par->update_start(info); fbcon_clear_margins(vc, 1); scrollback_max -=3D count; if (scrollback_max < 0) @@ -1608,7 +1607,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, str= uct fb_info *info, unsigned short *d =3D (unsigned short *) (vc->vc_origin + vc->vc_size_row * line); unsigned short *s =3D d + offset; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 while (count--) { unsigned short *start =3D s; @@ -1621,8 +1620,8 @@ static void fbcon_redraw_blit(struct vc_data *vc, str= uct fb_info *info, =20 if (c =3D=3D scr_readw(d)) { if (s > start) { - ops->bmove(vc, info, line + ycount, x, - line, x, 1, s-start); + par->bmove(vc, info, line + ycount, x, + line, x, 1, s - start); x +=3D s - start + 1; start =3D s + 1; } else { @@ -1637,8 +1636,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, str= uct fb_info *info, d++; } while (s < le); if (s > start) - ops->bmove(vc, info, line + ycount, x, line, x, 1, - s-start); + par->bmove(vc, info, line + ycount, x, line, x, 1, s - start); console_conditional_schedule(); if (ycount > 0) line++; @@ -1709,7 +1707,7 @@ static void fbcon_bmove_rec(struct vc_data *vc, struc= t fbcon_display *p, int sy, int dy, int dx, int height, int width, u_int y_break) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; u_int b; =20 if (sy < y_break && sy + height > y_break) { @@ -1743,8 +1741,7 @@ static void fbcon_bmove_rec(struct vc_data *vc, struc= t fbcon_display *p, int sy, } return; } - ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, - height, width); + par->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, height, width); } =20 static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx, @@ -1971,15 +1968,13 @@ static void updatescrollmode_accel(struct fbcon_dis= play *p, struct vc_data *vc) { #ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; int cap =3D info->flags; u16 t =3D 0; - int ypan =3D FBCON_SWAP(ops->rotate, info->fix.ypanstep, - info->fix.xpanstep); - int ywrap =3D FBCON_SWAP(ops->rotate, info->fix.ywrapstep, t); - int yres =3D FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); - int vyres =3D FBCON_SWAP(ops->rotate, info->var.yres_virtual, - info->var.xres_virtual); + int ypan =3D FBCON_SWAP(par->rotate, info->fix.ypanstep, info->fix.xpanst= ep); + int ywrap =3D FBCON_SWAP(par->rotate, info->fix.ywrapstep, t); + int yres =3D FBCON_SWAP(par->rotate, info->var.yres, info->var.xres); + int vyres =3D FBCON_SWAP(par->rotate, info->var.yres_virtual, info->var.x= res_virtual); int good_pan =3D (cap & FBINFO_HWACCEL_YPAN) && divides(ypan, vc->vc_font.height) && vyres > yres; int good_wrap =3D (cap & FBINFO_HWACCEL_YWRAP) && @@ -2012,11 +2007,10 @@ static void updatescrollmode(struct fbcon_display *= p, struct fb_info *info, struct vc_data *vc) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; int fh =3D vc->vc_font.height; - int yres =3D FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); - int vyres =3D FBCON_SWAP(ops->rotate, info->var.yres_virtual, - info->var.xres_virtual); + int yres =3D FBCON_SWAP(par->rotate, info->var.yres, info->var.xres); + int vyres =3D FBCON_SWAP(par->rotate, info->var.yres_virtual, info->var.x= res_virtual); =20 p->vrows =3D vyres/fh; if (yres > (fh * (vc->vc_rows + 1))) @@ -2035,7 +2029,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned = int width, unsigned int height, bool from_user) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fbcon_display *p =3D &fb_display[vc->vc_num]; struct fb_var_screeninfo var =3D info->var; int x_diff, y_diff, virt_w, virt_h, virt_fw, virt_fh; @@ -2058,12 +2052,10 @@ static int fbcon_resize(struct vc_data *vc, unsigne= d int width, return -EINVAL; } =20 - virt_w =3D FBCON_SWAP(ops->rotate, width, height); - virt_h =3D FBCON_SWAP(ops->rotate, height, width); - virt_fw =3D FBCON_SWAP(ops->rotate, vc->vc_font.width, - vc->vc_font.height); - virt_fh =3D FBCON_SWAP(ops->rotate, vc->vc_font.height, - vc->vc_font.width); + virt_w =3D FBCON_SWAP(par->rotate, width, height); + virt_h =3D FBCON_SWAP(par->rotate, height, width); + virt_fw =3D FBCON_SWAP(par->rotate, vc->vc_font.width, vc->vc_font.height= ); + virt_fh =3D FBCON_SWAP(par->rotate, vc->vc_font.height, vc->vc_font.width= ); var.xres =3D virt_w * virt_fw; var.yres =3D virt_h * virt_fh; x_diff =3D info->var.xres - var.xres; @@ -2089,7 +2081,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned = int width, fb_set_var(info, &var); } var_to_display(p, &info->var, info); - ops->var =3D info->var; + par->var =3D info->var; } updatescrollmode(p, info, vc); return 0; @@ -2098,13 +2090,13 @@ static int fbcon_resize(struct vc_data *vc, unsigne= d int width, static bool fbcon_switch(struct vc_data *vc) { struct fb_info *info, *old_info =3D NULL; - struct fbcon_ops *ops; + struct fbcon_par *par; struct fbcon_display *p =3D &fb_display[vc->vc_num]; struct fb_var_screeninfo var; int i, ret, prev_console; =20 info =3D fbcon_info_from_console(vc->vc_num); - ops =3D info->fbcon_par; + par =3D info->fbcon_par; =20 if (logo_shown >=3D 0) { struct vc_data *conp2 =3D vc_cons[logo_shown].d; @@ -2115,7 +2107,7 @@ static bool fbcon_switch(struct vc_data *vc) logo_shown =3D FBCON_LOGO_CANSHOW; } =20 - prev_console =3D ops->currcon; + prev_console =3D par->currcon; if (prev_console !=3D -1) old_info =3D fbcon_info_from_console(prev_console); /* @@ -2128,9 +2120,9 @@ static bool fbcon_switch(struct vc_data *vc) */ fbcon_for_each_registered_fb(i) { if (fbcon_registered_fb[i]->fbcon_par) { - struct fbcon_ops *o =3D fbcon_registered_fb[i]->fbcon_par; + struct fbcon_par *par =3D fbcon_registered_fb[i]->fbcon_par; =20 - o->currcon =3D vc->vc_num; + par->currcon =3D vc->vc_num; } } memset(&var, 0, sizeof(struct fb_var_screeninfo)); @@ -2144,7 +2136,7 @@ static bool fbcon_switch(struct vc_data *vc) info->var.activate =3D var.activate; var.vmode |=3D info->var.vmode & ~FB_VMODE_MASK; fb_set_var(info, &var); - ops->var =3D info->var; + par->var =3D info->var; =20 if (old_info !=3D NULL && (old_info !=3D info || info->flags & FBINFO_MISC_ALWAYS_SETPAR)) { @@ -2161,17 +2153,16 @@ static bool fbcon_switch(struct vc_data *vc) fbcon_del_cursor_work(old_info); } =20 - if (!fbcon_is_active(vc, info) || - ops->blank_state !=3D FB_BLANK_UNBLANK) + if (!fbcon_is_active(vc, info) || par->blank_state !=3D FB_BLANK_UNBLANK) fbcon_del_cursor_work(info); else fbcon_add_cursor_work(info); =20 set_blitting_type(vc, info); - ops->cursor_reset =3D 1; + par->cursor_reset =3D 1; =20 - if (ops->rotate_font && ops->rotate_font(info, vc)) { - ops->rotate =3D FB_ROTATE_UR; + if (par->rotate_font && par->rotate_font(info, vc)) { + par->rotate =3D FB_ROTATE_UR; set_blitting_type(vc, info); } =20 @@ -2202,8 +2193,8 @@ static bool fbcon_switch(struct vc_data *vc) scrollback_current =3D 0; =20 if (fbcon_is_active(vc, info)) { - ops->var.xoffset =3D ops->var.yoffset =3D p->yscroll =3D 0; - ops->update_start(info); + par->var.xoffset =3D par->var.yoffset =3D p->yscroll =3D 0; + par->update_start(info); } =20 fbcon_set_palette(vc, color_table); @@ -2212,7 +2203,7 @@ static bool fbcon_switch(struct vc_data *vc) if (logo_shown =3D=3D FBCON_LOGO_DRAW) { =20 logo_shown =3D fg_console; - fb_show_logo(info, ops->rotate); + fb_show_logo(info, par->rotate); update_region(vc, vc->vc_origin + vc->vc_size_row * vc->vc_top, vc->vc_size_row * (vc->vc_bottom - @@ -2241,27 +2232,27 @@ static bool fbcon_blank(struct vc_data *vc, enum ve= sa_blank_mode blank, bool mode_switch) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 if (mode_switch) { struct fb_var_screeninfo var =3D info->var; =20 - ops->graphics =3D 1; + par->graphics =3D 1; =20 if (!blank) { var.activate =3D FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE | FB_ACTIVATE_KD_TEXT; fb_set_var(info, &var); - ops->graphics =3D 0; - ops->var =3D info->var; + par->graphics =3D 0; + par->var =3D info->var; } } =20 if (fbcon_is_active(vc, info)) { - if (ops->blank_state !=3D blank) { - ops->blank_state =3D blank; + if (par->blank_state !=3D blank) { + par->blank_state =3D blank; fbcon_cursor(vc, !blank); - ops->cursor_flash =3D (!blank); + par->cursor_flash =3D (!blank); =20 if (fb_blank(info, blank)) fbcon_generic_blank(vc, info, blank); @@ -2271,8 +2262,7 @@ static bool fbcon_blank(struct vc_data *vc, enum vesa= _blank_mode blank, update_screen(vc); } =20 - if (mode_switch || !fbcon_is_active(vc, info) || - ops->blank_state !=3D FB_BLANK_UNBLANK) + if (mode_switch || !fbcon_is_active(vc, info) || par->blank_state !=3D FB= _BLANK_UNBLANK) fbcon_del_cursor_work(info); else fbcon_add_cursor_work(info); @@ -2283,10 +2273,10 @@ static bool fbcon_blank(struct vc_data *vc, enum ve= sa_blank_mode blank, static void fbcon_debug_enter(struct vc_data *vc) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 - ops->save_graphics =3D ops->graphics; - ops->graphics =3D 0; + par->save_graphics =3D par->graphics; + par->graphics =3D 0; if (info->fbops->fb_debug_enter) info->fbops->fb_debug_enter(info); fbcon_set_palette(vc, color_table); @@ -2295,9 +2285,9 @@ static void fbcon_debug_enter(struct vc_data *vc) static void fbcon_debug_leave(struct vc_data *vc) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 - ops->graphics =3D ops->save_graphics; + par->graphics =3D par->save_graphics; if (info->fbops->fb_debug_leave) info->fbops->fb_debug_leave(info); } @@ -2432,7 +2422,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int = w, int h, int charcount, const u8 * data, int userfont) { struct fb_info *info =3D fbcon_info_from_console(vc->vc_num); - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fbcon_display *p =3D &fb_display[vc->vc_num]; int resize, ret, old_userfont, old_width, old_height, old_charcount; u8 *old_data =3D vc->vc_font.data; @@ -2458,8 +2448,8 @@ static int fbcon_do_set_font(struct vc_data *vc, int = w, int h, int charcount, if (resize) { int cols, rows; =20 - cols =3D FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); - rows =3D FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); + cols =3D FBCON_SWAP(par->rotate, info->var.xres, info->var.yres); + rows =3D FBCON_SWAP(par->rotate, info->var.yres, info->var.xres); cols /=3D w; rows /=3D h; ret =3D vc_resize(vc, cols, rows); @@ -2651,11 +2641,11 @@ static void fbcon_invert_region(struct vc_data *vc,= u16 * p, int cnt) void fbcon_suspended(struct fb_info *info) { struct vc_data *vc =3D NULL; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 - if (!ops || ops->currcon < 0) + if (!par || par->currcon < 0) return; - vc =3D vc_cons[ops->currcon].d; + vc =3D vc_cons[par->currcon].d; =20 /* Clear cursor, restore saved data */ fbcon_cursor(vc, false); @@ -2664,27 +2654,27 @@ void fbcon_suspended(struct fb_info *info) void fbcon_resumed(struct fb_info *info) { struct vc_data *vc; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 - if (!ops || ops->currcon < 0) + if (!par || par->currcon < 0) return; - vc =3D vc_cons[ops->currcon].d; + vc =3D vc_cons[par->currcon].d; =20 update_screen(vc); } =20 static void fbcon_modechanged(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct vc_data *vc; struct fbcon_display *p; int rows, cols; =20 - if (!ops || ops->currcon < 0) + if (!par || par->currcon < 0) return; - vc =3D vc_cons[ops->currcon].d; + vc =3D vc_cons[par->currcon].d; if (vc->vc_mode !=3D KD_TEXT || - fbcon_info_from_console(ops->currcon) !=3D info) + fbcon_info_from_console(par->currcon) !=3D info) return; =20 p =3D &fb_display[vc->vc_num]; @@ -2692,8 +2682,8 @@ static void fbcon_modechanged(struct fb_info *info) =20 if (con_is_visible(vc)) { var_to_display(p, &info->var, info); - cols =3D FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); - rows =3D FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); + cols =3D FBCON_SWAP(par->rotate, info->var.xres, info->var.yres); + rows =3D FBCON_SWAP(par->rotate, info->var.yres, info->var.xres); cols /=3D vc->vc_font.width; rows /=3D vc->vc_font.height; vc_resize(vc, cols, rows); @@ -2702,8 +2692,8 @@ static void fbcon_modechanged(struct fb_info *info) scrollback_current =3D 0; =20 if (fbcon_is_active(vc, info)) { - ops->var.xoffset =3D ops->var.yoffset =3D p->yscroll =3D 0; - ops->update_start(info); + par->var.xoffset =3D par->var.yoffset =3D p->yscroll =3D 0; + par->update_start(info); } =20 fbcon_set_palette(vc, color_table); @@ -2713,12 +2703,12 @@ static void fbcon_modechanged(struct fb_info *info) =20 static void fbcon_set_all_vcs(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct vc_data *vc; struct fbcon_display *p; int i, rows, cols, fg =3D -1; =20 - if (!ops || ops->currcon < 0) + if (!par || par->currcon < 0) return; =20 for (i =3D first_fb_vc; i <=3D last_fb_vc; i++) { @@ -2735,8 +2725,8 @@ static void fbcon_set_all_vcs(struct fb_info *info) p =3D &fb_display[vc->vc_num]; set_blitting_type(vc, info); var_to_display(p, &info->var, info); - cols =3D FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); - rows =3D FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); + cols =3D FBCON_SWAP(par->rotate, info->var.xres, info->var.yres); + rows =3D FBCON_SWAP(par->rotate, info->var.yres, info->var.xres); cols /=3D vc->vc_font.width; rows /=3D vc->vc_font.height; vc_resize(vc, cols, rows); @@ -2759,13 +2749,13 @@ EXPORT_SYMBOL(fbcon_update_vcs); /* let fbcon check if it supports a new screen resolution */ int fbcon_modechange_possible(struct fb_info *info, struct fb_var_screenin= fo *var) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct vc_data *vc; unsigned int i; =20 WARN_CONSOLE_UNLOCKED(); =20 - if (!ops) + if (!par) return 0; =20 /* prevent setting a screen size which is smaller than font size */ @@ -3037,15 +3027,14 @@ int fbcon_fb_registered(struct fb_info *info) =20 void fbcon_fb_blanked(struct fb_info *info, int blank) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct vc_data *vc; =20 - if (!ops || ops->currcon < 0) + if (!par || par->currcon < 0) return; =20 - vc =3D vc_cons[ops->currcon].d; - if (vc->vc_mode !=3D KD_TEXT || - fbcon_info_from_console(ops->currcon) !=3D info) + vc =3D vc_cons[par->currcon].d; + if (vc->vc_mode !=3D KD_TEXT || fbcon_info_from_console(par->currcon) != =3D info) return; =20 if (con_is_visible(vc)) { @@ -3054,7 +3043,7 @@ void fbcon_fb_blanked(struct fb_info *info, int blank) else do_unblank_screen(0); } - ops->blank_state =3D blank; + par->blank_state =3D blank; } =20 void fbcon_new_modelist(struct fb_info *info) @@ -3244,7 +3233,7 @@ static ssize_t cursor_blink_show(struct device *devic= e, struct device_attribute *attr, char *buf) { struct fb_info *info; - struct fbcon_ops *ops; + struct fbcon_par *par; int idx, blink =3D -1; =20 console_lock(); @@ -3254,12 +3243,12 @@ static ssize_t cursor_blink_show(struct device *dev= ice, goto err; =20 info =3D fbcon_registered_fb[idx]; - ops =3D info->fbcon_par; + par =3D info->fbcon_par; =20 - if (!ops) + if (!par) goto err; =20 - blink =3D delayed_work_pending(&ops->cursor_work); + blink =3D delayed_work_pending(&par->cursor_work); err: console_unlock(); return sysfs_emit(buf, "%d\n", blink); diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fb= con.h index c535d8f84356..94991a1ba11f 100644 --- a/drivers/video/fbdev/core/fbcon.h +++ b/drivers/video/fbdev/core/fbcon.h @@ -51,7 +51,7 @@ struct fbcon_display { const struct fb_videomode *mode; }; =20 -struct fbcon_ops { +struct fbcon_par { void (*bmove)(struct vc_data *vc, struct fb_info *info, int sy, int sx, int dy, int dx, int height, int width); void (*clear)(struct vc_data *vc, struct fb_info *info, int sy, @@ -186,7 +186,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_ops *ops); +extern void fbcon_set_bitops(struct fbcon_par *par); extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); =20 #define FBCON_ATTRIBUTE_UNDERLINE 1 @@ -225,7 +225,7 @@ static inline int get_attribute(struct fb_info *info, u= 16 c) (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_ops *ops); +extern void fbcon_set_rotate(struct fbcon_par *par); #else #define fbcon_set_rotate(x) do {} while(0) #endif /* CONFIG_FRAMEBUFFER_CONSOLE_ROTATION */ diff --git a/drivers/video/fbdev/core/fbcon_ccw.c b/drivers/video/fbdev/cor= e/fbcon_ccw.c index 89ef4ba7e867..2ba8ec4c3e2b 100644 --- a/drivers/video/fbdev/core/fbcon_ccw.c +++ b/drivers/video/fbdev/core/fbcon_ccw.c @@ -63,9 +63,9 @@ static void ccw_update_attr(u8 *dst, u8 *src, int attribu= te, static void ccw_bmove(struct vc_data *vc, struct fb_info *info, int sy, int sx, int dy, int dx, int height, int width) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fb_copyarea area; - u32 vyres =3D GETVYRES(ops->p, info); + u32 vyres =3D GETVYRES(par->p, info); =20 area.sx =3D sy * vc->vc_font.height; area.sy =3D vyres - ((sx + width) * vc->vc_font.width); @@ -80,9 +80,9 @@ static void ccw_bmove(struct vc_data *vc, struct fb_info = *info, int sy, static void ccw_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width, int fg, int bg) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fb_fillrect region; - u32 vyres =3D GETVYRES(ops->p, info); + u32 vyres =3D GETVYRES(par->p, info); =20 region.color =3D bg; region.dx =3D sy * vc->vc_font.height; @@ -99,13 +99,13 @@ static inline void ccw_putcs_aligned(struct vc_data *vc= , struct fb_info *info, u32 d_pitch, u32 s_pitch, u32 cellsize, struct fb_image *image, u8 *buf, u8 *dst) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; u16 charmask =3D vc->vc_hi_font_mask ? 0x1ff : 0xff; u32 idx =3D (vc->vc_font.height + 7) >> 3; u8 *src; =20 while (cnt--) { - src =3D ops->fontbuffer + (scr_readw(s--) & charmask)*cellsize; + src =3D par->fontbuffer + (scr_readw(s--) & charmask) * cellsize; =20 if (attr) { ccw_update_attr(buf, src, attr, vc); @@ -130,7 +130,7 @@ static void ccw_putcs(struct vc_data *vc, struct fb_inf= o *info, int fg, int bg) { struct fb_image image; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; u32 width =3D (vc->vc_font.height + 7)/8; u32 cellsize =3D width * vc->vc_font.width; u32 maxcnt =3D info->pixmap.size/cellsize; @@ -139,9 +139,9 @@ static void ccw_putcs(struct vc_data *vc, struct fb_inf= o *info, u32 cnt, pitch, size; u32 attribute =3D get_attribute(info, scr_readw(s)); u8 *dst, *buf =3D NULL; - u32 vyres =3D GETVYRES(ops->p, info); + u32 vyres =3D GETVYRES(par->p, info); =20 - if (!ops->fontbuffer) + if (!par->fontbuffer) return; =20 image.fg_color =3D fg; @@ -221,28 +221,28 @@ static void ccw_cursor(struct vc_data *vc, struct fb_= info *info, bool enable, int fg, int bg) { struct fb_cursor cursor; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; unsigned short charmask =3D vc->vc_hi_font_mask ? 0x1ff : 0xff; int w =3D (vc->vc_font.height + 7) >> 3, c; - int y =3D real_y(ops->p, vc->state.y); + int y =3D real_y(par->p, vc->state.y); int attribute, use_sw =3D vc->vc_cursor_type & CUR_SW; int err =3D 1, dx, dy; char *src; - u32 vyres =3D GETVYRES(ops->p, info); + u32 vyres =3D GETVYRES(par->p, info); =20 - if (!ops->fontbuffer) + if (!par->fontbuffer) return; =20 cursor.set =3D 0; =20 c =3D scr_readw((u16 *) vc->vc_pos); attribute =3D get_attribute(info, c); - src =3D ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); + src =3D par->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); =20 - if (ops->cursor_state.image.data !=3D src || - ops->cursor_reset) { - ops->cursor_state.image.data =3D src; - cursor.set |=3D FB_CUR_SETIMAGE; + if (par->cursor_state.image.data !=3D src || + par->cursor_reset) { + par->cursor_state.image.data =3D src; + cursor.set |=3D FB_CUR_SETIMAGE; } =20 if (attribute) { @@ -251,49 +251,49 @@ static void ccw_cursor(struct vc_data *vc, struct fb_= info *info, bool enable, dst =3D kmalloc_array(w, vc->vc_font.width, GFP_ATOMIC); if (!dst) return; - kfree(ops->cursor_data); - ops->cursor_data =3D dst; + kfree(par->cursor_data); + par->cursor_data =3D dst; ccw_update_attr(dst, src, attribute, vc); src =3D dst; } =20 - if (ops->cursor_state.image.fg_color !=3D fg || - ops->cursor_state.image.bg_color !=3D bg || - ops->cursor_reset) { - ops->cursor_state.image.fg_color =3D fg; - ops->cursor_state.image.bg_color =3D bg; + if (par->cursor_state.image.fg_color !=3D fg || + par->cursor_state.image.bg_color !=3D bg || + par->cursor_reset) { + par->cursor_state.image.fg_color =3D fg; + par->cursor_state.image.bg_color =3D bg; cursor.set |=3D FB_CUR_SETCMAP; } =20 - if (ops->cursor_state.image.height !=3D vc->vc_font.width || - ops->cursor_state.image.width !=3D vc->vc_font.height || - ops->cursor_reset) { - ops->cursor_state.image.height =3D vc->vc_font.width; - ops->cursor_state.image.width =3D vc->vc_font.height; + if (par->cursor_state.image.height !=3D vc->vc_font.width || + par->cursor_state.image.width !=3D vc->vc_font.height || + par->cursor_reset) { + par->cursor_state.image.height =3D vc->vc_font.width; + par->cursor_state.image.width =3D vc->vc_font.height; cursor.set |=3D FB_CUR_SETSIZE; } =20 dx =3D y * vc->vc_font.height; dy =3D vyres - ((vc->state.x + 1) * vc->vc_font.width); =20 - if (ops->cursor_state.image.dx !=3D dx || - ops->cursor_state.image.dy !=3D dy || - ops->cursor_reset) { - ops->cursor_state.image.dx =3D dx; - ops->cursor_state.image.dy =3D dy; + if (par->cursor_state.image.dx !=3D dx || + par->cursor_state.image.dy !=3D dy || + par->cursor_reset) { + par->cursor_state.image.dx =3D dx; + par->cursor_state.image.dy =3D dy; cursor.set |=3D FB_CUR_SETPOS; } =20 - if (ops->cursor_state.hot.x || ops->cursor_state.hot.y || - ops->cursor_reset) { - ops->cursor_state.hot.x =3D cursor.hot.y =3D 0; + if (par->cursor_state.hot.x || par->cursor_state.hot.y || + par->cursor_reset) { + par->cursor_state.hot.x =3D cursor.hot.y =3D 0; cursor.set |=3D FB_CUR_SETHOT; } =20 if (cursor.set & FB_CUR_SETSIZE || - vc->vc_cursor_type !=3D ops->p->cursor_shape || - ops->cursor_state.mask =3D=3D NULL || - ops->cursor_reset) { + vc->vc_cursor_type !=3D par->p->cursor_shape || + par->cursor_state.mask =3D=3D NULL || + par->cursor_reset) { char *tmp, *mask =3D kmalloc_array(w, vc->vc_font.width, GFP_ATOMIC); int cur_height, size, i =3D 0; @@ -309,13 +309,13 @@ static void ccw_cursor(struct vc_data *vc, struct fb_= info *info, bool enable, return; } =20 - kfree(ops->cursor_state.mask); - ops->cursor_state.mask =3D mask; + kfree(par->cursor_state.mask); + par->cursor_state.mask =3D mask; =20 - ops->p->cursor_shape =3D vc->vc_cursor_type; + par->p->cursor_shape =3D vc->vc_cursor_type; cursor.set |=3D FB_CUR_SETSHAPE; =20 - switch (CUR_SIZE(ops->p->cursor_shape)) { + switch (CUR_SIZE(par->p->cursor_shape)) { case CUR_NONE: cur_height =3D 0; break; @@ -348,19 +348,19 @@ static void ccw_cursor(struct vc_data *vc, struct fb_= info *info, bool enable, kfree(tmp); } =20 - ops->cursor_state.enable =3D enable && !use_sw; + par->cursor_state.enable =3D enable && !use_sw; =20 cursor.image.data =3D src; - cursor.image.fg_color =3D ops->cursor_state.image.fg_color; - cursor.image.bg_color =3D ops->cursor_state.image.bg_color; - cursor.image.dx =3D ops->cursor_state.image.dx; - cursor.image.dy =3D ops->cursor_state.image.dy; - cursor.image.height =3D ops->cursor_state.image.height; - cursor.image.width =3D ops->cursor_state.image.width; - cursor.hot.x =3D ops->cursor_state.hot.x; - cursor.hot.y =3D ops->cursor_state.hot.y; - cursor.mask =3D ops->cursor_state.mask; - cursor.enable =3D ops->cursor_state.enable; + cursor.image.fg_color =3D par->cursor_state.image.fg_color; + cursor.image.bg_color =3D par->cursor_state.image.bg_color; + cursor.image.dx =3D par->cursor_state.image.dx; + cursor.image.dy =3D par->cursor_state.image.dy; + cursor.image.height =3D par->cursor_state.image.height; + cursor.image.width =3D par->cursor_state.image.width; + cursor.hot.x =3D par->cursor_state.hot.x; + cursor.hot.y =3D par->cursor_state.hot.y; + cursor.mask =3D par->cursor_state.mask; + cursor.enable =3D par->cursor_state.enable; cursor.image.depth =3D 1; cursor.rop =3D ROP_XOR; =20 @@ -370,32 +370,32 @@ static void ccw_cursor(struct vc_data *vc, struct fb_= info *info, bool enable, if (err) soft_cursor(info, &cursor); =20 - ops->cursor_reset =3D 0; + par->cursor_reset =3D 0; } =20 static int ccw_update_start(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; u32 yoffset; - u32 vyres =3D GETVYRES(ops->p, info); + u32 vyres =3D GETVYRES(par->p, info); int err; =20 - yoffset =3D (vyres - info->var.yres) - ops->var.xoffset; - ops->var.xoffset =3D ops->var.yoffset; - ops->var.yoffset =3D yoffset; - err =3D fb_pan_display(info, &ops->var); - ops->var.xoffset =3D info->var.xoffset; - ops->var.yoffset =3D info->var.yoffset; - ops->var.vmode =3D info->var.vmode; + yoffset =3D (vyres - info->var.yres) - par->var.xoffset; + par->var.xoffset =3D par->var.yoffset; + par->var.yoffset =3D yoffset; + err =3D fb_pan_display(info, &par->var); + par->var.xoffset =3D info->var.xoffset; + par->var.yoffset =3D info->var.yoffset; + par->var.vmode =3D info->var.vmode; return err; } =20 -void fbcon_rotate_ccw(struct fbcon_ops *ops) +void fbcon_rotate_ccw(struct fbcon_par *par) { - ops->bmove =3D ccw_bmove; - ops->clear =3D ccw_clear; - ops->putcs =3D ccw_putcs; - ops->clear_margins =3D ccw_clear_margins; - ops->cursor =3D ccw_cursor; - ops->update_start =3D ccw_update_start; + par->bmove =3D ccw_bmove; + par->clear =3D ccw_clear; + par->putcs =3D ccw_putcs; + par->clear_margins =3D ccw_clear_margins; + par->cursor =3D ccw_cursor; + par->update_start =3D ccw_update_start; } diff --git a/drivers/video/fbdev/core/fbcon_cw.c b/drivers/video/fbdev/core= /fbcon_cw.c index b9dac7940fb7..4bd22d5ee5f4 100644 --- a/drivers/video/fbdev/core/fbcon_cw.c +++ b/drivers/video/fbdev/core/fbcon_cw.c @@ -48,9 +48,9 @@ static void cw_update_attr(u8 *dst, u8 *src, int attribut= e, static void cw_bmove(struct vc_data *vc, struct fb_info *info, int sy, int sx, int dy, int dx, int height, int width) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fb_copyarea area; - u32 vxres =3D GETVXRES(ops->p, info); + u32 vxres =3D GETVXRES(par->p, info); =20 area.sx =3D vxres - ((sy + height) * vc->vc_font.height); area.sy =3D sx * vc->vc_font.width; @@ -65,9 +65,9 @@ static void cw_bmove(struct vc_data *vc, struct fb_info *= info, int sy, static void cw_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width, int fg, int bg) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fb_fillrect region; - u32 vxres =3D GETVXRES(ops->p, info); + u32 vxres =3D GETVXRES(par->p, info); =20 region.color =3D bg; region.dx =3D vxres - ((sy + height) * vc->vc_font.height); @@ -84,13 +84,13 @@ static inline void cw_putcs_aligned(struct vc_data *vc,= struct fb_info *info, u32 d_pitch, u32 s_pitch, u32 cellsize, struct fb_image *image, u8 *buf, u8 *dst) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; u16 charmask =3D vc->vc_hi_font_mask ? 0x1ff : 0xff; u32 idx =3D (vc->vc_font.height + 7) >> 3; u8 *src; =20 while (cnt--) { - src =3D ops->fontbuffer + (scr_readw(s++) & charmask)*cellsize; + src =3D par->fontbuffer + (scr_readw(s++) & charmask) * cellsize; =20 if (attr) { cw_update_attr(buf, src, attr, vc); @@ -115,7 +115,7 @@ static void cw_putcs(struct vc_data *vc, struct fb_info= *info, int fg, int bg) { struct fb_image image; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; u32 width =3D (vc->vc_font.height + 7)/8; u32 cellsize =3D width * vc->vc_font.width; u32 maxcnt =3D info->pixmap.size/cellsize; @@ -124,9 +124,9 @@ static void cw_putcs(struct vc_data *vc, struct fb_info= *info, u32 cnt, pitch, size; u32 attribute =3D get_attribute(info, scr_readw(s)); u8 *dst, *buf =3D NULL; - u32 vxres =3D GETVXRES(ops->p, info); + u32 vxres =3D GETVXRES(par->p, info); =20 - if (!ops->fontbuffer) + if (!par->fontbuffer) return; =20 image.fg_color =3D fg; @@ -204,28 +204,28 @@ static void cw_cursor(struct vc_data *vc, struct fb_i= nfo *info, bool enable, int fg, int bg) { struct fb_cursor cursor; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; unsigned short charmask =3D vc->vc_hi_font_mask ? 0x1ff : 0xff; int w =3D (vc->vc_font.height + 7) >> 3, c; - int y =3D real_y(ops->p, vc->state.y); + int y =3D real_y(par->p, vc->state.y); int attribute, use_sw =3D vc->vc_cursor_type & CUR_SW; int err =3D 1, dx, dy; char *src; - u32 vxres =3D GETVXRES(ops->p, info); + u32 vxres =3D GETVXRES(par->p, info); =20 - if (!ops->fontbuffer) + if (!par->fontbuffer) return; =20 cursor.set =3D 0; =20 c =3D scr_readw((u16 *) vc->vc_pos); attribute =3D get_attribute(info, c); - src =3D ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); + src =3D par->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); =20 - if (ops->cursor_state.image.data !=3D src || - ops->cursor_reset) { - ops->cursor_state.image.data =3D src; - cursor.set |=3D FB_CUR_SETIMAGE; + if (par->cursor_state.image.data !=3D src || + par->cursor_reset) { + par->cursor_state.image.data =3D src; + cursor.set |=3D FB_CUR_SETIMAGE; } =20 if (attribute) { @@ -234,49 +234,49 @@ static void cw_cursor(struct vc_data *vc, struct fb_i= nfo *info, bool enable, dst =3D kmalloc_array(w, vc->vc_font.width, GFP_ATOMIC); if (!dst) return; - kfree(ops->cursor_data); - ops->cursor_data =3D dst; + kfree(par->cursor_data); + par->cursor_data =3D dst; cw_update_attr(dst, src, attribute, vc); src =3D dst; } =20 - if (ops->cursor_state.image.fg_color !=3D fg || - ops->cursor_state.image.bg_color !=3D bg || - ops->cursor_reset) { - ops->cursor_state.image.fg_color =3D fg; - ops->cursor_state.image.bg_color =3D bg; + if (par->cursor_state.image.fg_color !=3D fg || + par->cursor_state.image.bg_color !=3D bg || + par->cursor_reset) { + par->cursor_state.image.fg_color =3D fg; + par->cursor_state.image.bg_color =3D bg; cursor.set |=3D FB_CUR_SETCMAP; } =20 - if (ops->cursor_state.image.height !=3D vc->vc_font.width || - ops->cursor_state.image.width !=3D vc->vc_font.height || - ops->cursor_reset) { - ops->cursor_state.image.height =3D vc->vc_font.width; - ops->cursor_state.image.width =3D vc->vc_font.height; + if (par->cursor_state.image.height !=3D vc->vc_font.width || + par->cursor_state.image.width !=3D vc->vc_font.height || + par->cursor_reset) { + par->cursor_state.image.height =3D vc->vc_font.width; + par->cursor_state.image.width =3D vc->vc_font.height; cursor.set |=3D FB_CUR_SETSIZE; } =20 dx =3D vxres - ((y * vc->vc_font.height) + vc->vc_font.height); dy =3D vc->state.x * vc->vc_font.width; =20 - if (ops->cursor_state.image.dx !=3D dx || - ops->cursor_state.image.dy !=3D dy || - ops->cursor_reset) { - ops->cursor_state.image.dx =3D dx; - ops->cursor_state.image.dy =3D dy; + if (par->cursor_state.image.dx !=3D dx || + par->cursor_state.image.dy !=3D dy || + par->cursor_reset) { + par->cursor_state.image.dx =3D dx; + par->cursor_state.image.dy =3D dy; cursor.set |=3D FB_CUR_SETPOS; } =20 - if (ops->cursor_state.hot.x || ops->cursor_state.hot.y || - ops->cursor_reset) { - ops->cursor_state.hot.x =3D cursor.hot.y =3D 0; + if (par->cursor_state.hot.x || par->cursor_state.hot.y || + par->cursor_reset) { + par->cursor_state.hot.x =3D cursor.hot.y =3D 0; cursor.set |=3D FB_CUR_SETHOT; } =20 if (cursor.set & FB_CUR_SETSIZE || - vc->vc_cursor_type !=3D ops->p->cursor_shape || - ops->cursor_state.mask =3D=3D NULL || - ops->cursor_reset) { + vc->vc_cursor_type !=3D par->p->cursor_shape || + par->cursor_state.mask =3D=3D NULL || + par->cursor_reset) { char *tmp, *mask =3D kmalloc_array(w, vc->vc_font.width, GFP_ATOMIC); int cur_height, size, i =3D 0; @@ -292,13 +292,13 @@ static void cw_cursor(struct vc_data *vc, struct fb_i= nfo *info, bool enable, return; } =20 - kfree(ops->cursor_state.mask); - ops->cursor_state.mask =3D mask; + kfree(par->cursor_state.mask); + par->cursor_state.mask =3D mask; =20 - ops->p->cursor_shape =3D vc->vc_cursor_type; + par->p->cursor_shape =3D vc->vc_cursor_type; cursor.set |=3D FB_CUR_SETSHAPE; =20 - switch (CUR_SIZE(ops->p->cursor_shape)) { + switch (CUR_SIZE(par->p->cursor_shape)) { case CUR_NONE: cur_height =3D 0; break; @@ -331,19 +331,19 @@ static void cw_cursor(struct vc_data *vc, struct fb_i= nfo *info, bool enable, kfree(tmp); } =20 - ops->cursor_state.enable =3D enable && !use_sw; + par->cursor_state.enable =3D enable && !use_sw; =20 cursor.image.data =3D src; - cursor.image.fg_color =3D ops->cursor_state.image.fg_color; - cursor.image.bg_color =3D ops->cursor_state.image.bg_color; - cursor.image.dx =3D ops->cursor_state.image.dx; - cursor.image.dy =3D ops->cursor_state.image.dy; - cursor.image.height =3D ops->cursor_state.image.height; - cursor.image.width =3D ops->cursor_state.image.width; - cursor.hot.x =3D ops->cursor_state.hot.x; - cursor.hot.y =3D ops->cursor_state.hot.y; - cursor.mask =3D ops->cursor_state.mask; - cursor.enable =3D ops->cursor_state.enable; + cursor.image.fg_color =3D par->cursor_state.image.fg_color; + cursor.image.bg_color =3D par->cursor_state.image.bg_color; + cursor.image.dx =3D par->cursor_state.image.dx; + cursor.image.dy =3D par->cursor_state.image.dy; + cursor.image.height =3D par->cursor_state.image.height; + cursor.image.width =3D par->cursor_state.image.width; + cursor.hot.x =3D par->cursor_state.hot.x; + cursor.hot.y =3D par->cursor_state.hot.y; + cursor.mask =3D par->cursor_state.mask; + cursor.enable =3D par->cursor_state.enable; cursor.image.depth =3D 1; cursor.rop =3D ROP_XOR; =20 @@ -353,32 +353,32 @@ static void cw_cursor(struct vc_data *vc, struct fb_i= nfo *info, bool enable, if (err) soft_cursor(info, &cursor); =20 - ops->cursor_reset =3D 0; + par->cursor_reset =3D 0; } =20 static int cw_update_start(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; - u32 vxres =3D GETVXRES(ops->p, info); + struct fbcon_par *par =3D info->fbcon_par; + u32 vxres =3D GETVXRES(par->p, info); u32 xoffset; int err; =20 - xoffset =3D vxres - (info->var.xres + ops->var.yoffset); - ops->var.yoffset =3D ops->var.xoffset; - ops->var.xoffset =3D xoffset; - err =3D fb_pan_display(info, &ops->var); - ops->var.xoffset =3D info->var.xoffset; - ops->var.yoffset =3D info->var.yoffset; - ops->var.vmode =3D info->var.vmode; + xoffset =3D vxres - (info->var.xres + par->var.yoffset); + par->var.yoffset =3D par->var.xoffset; + par->var.xoffset =3D xoffset; + err =3D fb_pan_display(info, &par->var); + par->var.xoffset =3D info->var.xoffset; + par->var.yoffset =3D info->var.yoffset; + par->var.vmode =3D info->var.vmode; return err; } =20 -void fbcon_rotate_cw(struct fbcon_ops *ops) +void fbcon_rotate_cw(struct fbcon_par *par) { - ops->bmove =3D cw_bmove; - ops->clear =3D cw_clear; - ops->putcs =3D cw_putcs; - ops->clear_margins =3D cw_clear_margins; - ops->cursor =3D cw_cursor; - ops->update_start =3D cw_update_start; + par->bmove =3D cw_bmove; + par->clear =3D cw_clear; + par->putcs =3D cw_putcs; + par->clear_margins =3D cw_clear_margins; + par->cursor =3D cw_cursor; + par->update_start =3D cw_update_start; } diff --git a/drivers/video/fbdev/core/fbcon_rotate.c b/drivers/video/fbdev/= core/fbcon_rotate.c index ec3c883400f7..380b2746451a 100644 --- a/drivers/video/fbdev/core/fbcon_rotate.c +++ b/drivers/video/fbdev/core/fbcon_rotate.c @@ -20,32 +20,32 @@ =20 static int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; int len, err =3D 0; int s_cellsize, d_cellsize, i; const u8 *src; u8 *dst; =20 - if (vc->vc_font.data =3D=3D ops->fontdata && - ops->p->con_rotate =3D=3D ops->cur_rotate) + if (vc->vc_font.data =3D=3D par->fontdata && + par->p->con_rotate =3D=3D par->cur_rotate) goto finished; =20 - src =3D ops->fontdata =3D vc->vc_font.data; - ops->cur_rotate =3D ops->p->con_rotate; + src =3D par->fontdata =3D vc->vc_font.data; + par->cur_rotate =3D par->p->con_rotate; len =3D vc->vc_font.charcount; s_cellsize =3D ((vc->vc_font.width + 7)/8) * vc->vc_font.height; d_cellsize =3D s_cellsize; =20 - if (ops->rotate =3D=3D FB_ROTATE_CW || - ops->rotate =3D=3D FB_ROTATE_CCW) + if (par->rotate =3D=3D FB_ROTATE_CW || + par->rotate =3D=3D FB_ROTATE_CCW) d_cellsize =3D ((vc->vc_font.height + 7)/8) * vc->vc_font.width; =20 if (info->fbops->fb_sync) info->fbops->fb_sync(info); =20 - if (ops->fd_size < d_cellsize * len) { + if (par->fd_size < d_cellsize * len) { dst =3D kmalloc_array(len, d_cellsize, GFP_KERNEL); =20 if (dst =3D=3D NULL) { @@ -53,15 +53,15 @@ static int fbcon_rotate_font(struct fb_info *info, stru= ct vc_data *vc) goto finished; } =20 - ops->fd_size =3D d_cellsize * len; - kfree(ops->fontbuffer); - ops->fontbuffer =3D dst; + par->fd_size =3D d_cellsize * len; + kfree(par->fontbuffer); + par->fontbuffer =3D dst; } =20 - dst =3D ops->fontbuffer; - memset(dst, 0, ops->fd_size); + dst =3D par->fontbuffer; + memset(dst, 0, par->fd_size); =20 - switch (ops->rotate) { + switch (par->rotate) { case FB_ROTATE_UD: for (i =3D len; i--; ) { rotate_ud(src, dst, vc->vc_font.width, @@ -93,19 +93,19 @@ static int fbcon_rotate_font(struct fb_info *info, stru= ct vc_data *vc) return err; } =20 -void fbcon_set_rotate(struct fbcon_ops *ops) +void fbcon_set_rotate(struct fbcon_par *par) { - ops->rotate_font =3D fbcon_rotate_font; + par->rotate_font =3D fbcon_rotate_font; =20 - switch(ops->rotate) { + switch (par->rotate) { case FB_ROTATE_CW: - fbcon_rotate_cw(ops); + fbcon_rotate_cw(par); break; case FB_ROTATE_UD: - fbcon_rotate_ud(ops); + fbcon_rotate_ud(par); break; case FB_ROTATE_CCW: - fbcon_rotate_ccw(ops); + fbcon_rotate_ccw(par); break; } } diff --git a/drivers/video/fbdev/core/fbcon_rotate.h b/drivers/video/fbdev/= core/fbcon_rotate.h index 01cbe303b8a2..48305e1a0763 100644 --- a/drivers/video/fbdev/core/fbcon_rotate.h +++ b/drivers/video/fbdev/core/fbcon_rotate.h @@ -90,7 +90,7 @@ static inline void rotate_ccw(const char *in, char *out, = u32 width, u32 height) } } =20 -extern void fbcon_rotate_cw(struct fbcon_ops *ops); -extern void fbcon_rotate_ud(struct fbcon_ops *ops); -extern void fbcon_rotate_ccw(struct fbcon_ops *ops); +extern void fbcon_rotate_cw(struct fbcon_par *par); +extern void fbcon_rotate_ud(struct fbcon_par *par); +extern void fbcon_rotate_ccw(struct fbcon_par *par); #endif diff --git a/drivers/video/fbdev/core/fbcon_ud.c b/drivers/video/fbdev/core= /fbcon_ud.c index 0af7913a2abd..14b40e2bf323 100644 --- a/drivers/video/fbdev/core/fbcon_ud.c +++ b/drivers/video/fbdev/core/fbcon_ud.c @@ -48,10 +48,10 @@ static void ud_update_attr(u8 *dst, u8 *src, int attrib= ute, static void ud_bmove(struct vc_data *vc, struct fb_info *info, int sy, int sx, int dy, int dx, int height, int width) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fb_copyarea area; - u32 vyres =3D GETVYRES(ops->p, info); - u32 vxres =3D GETVXRES(ops->p, info); + u32 vyres =3D GETVYRES(par->p, info); + u32 vxres =3D GETVXRES(par->p, info); =20 area.sy =3D vyres - ((sy + height) * vc->vc_font.height); area.sx =3D vxres - ((sx + width) * vc->vc_font.width); @@ -66,10 +66,10 @@ static void ud_bmove(struct vc_data *vc, struct fb_info= *info, int sy, static void ud_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width, int fg, int bg) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; struct fb_fillrect region; - u32 vyres =3D GETVYRES(ops->p, info); - u32 vxres =3D GETVXRES(ops->p, info); + u32 vyres =3D GETVYRES(par->p, info); + u32 vxres =3D GETVXRES(par->p, info); =20 region.color =3D bg; region.dy =3D vyres - ((sy + height) * vc->vc_font.height); @@ -86,13 +86,13 @@ static inline void ud_putcs_aligned(struct vc_data *vc,= struct fb_info *info, u32 d_pitch, u32 s_pitch, u32 cellsize, struct fb_image *image, u8 *buf, u8 *dst) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; u16 charmask =3D vc->vc_hi_font_mask ? 0x1ff : 0xff; u32 idx =3D vc->vc_font.width >> 3; u8 *src; =20 while (cnt--) { - src =3D ops->fontbuffer + (scr_readw(s--) & charmask)*cellsize; + src =3D par->fontbuffer + (scr_readw(s--) & charmask) * cellsize; =20 if (attr) { ud_update_attr(buf, src, attr, vc); @@ -119,7 +119,7 @@ static inline void ud_putcs_unaligned(struct vc_data *v= c, struct fb_image *image, u8 *buf, u8 *dst) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; u16 charmask =3D vc->vc_hi_font_mask ? 0x1ff : 0xff; u32 shift_low =3D 0, mod =3D vc->vc_font.width % 8; u32 shift_high =3D 8; @@ -127,7 +127,7 @@ static inline void ud_putcs_unaligned(struct vc_data *v= c, u8 *src; =20 while (cnt--) { - src =3D ops->fontbuffer + (scr_readw(s--) & charmask)*cellsize; + src =3D par->fontbuffer + (scr_readw(s--) & charmask) * cellsize; =20 if (attr) { ud_update_attr(buf, src, attr, vc); @@ -152,7 +152,7 @@ static void ud_putcs(struct vc_data *vc, struct fb_info= *info, int fg, int bg) { struct fb_image image; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; u32 width =3D (vc->vc_font.width + 7)/8; u32 cellsize =3D width * vc->vc_font.height; u32 maxcnt =3D info->pixmap.size/cellsize; @@ -161,10 +161,10 @@ static void ud_putcs(struct vc_data *vc, struct fb_in= fo *info, u32 mod =3D vc->vc_font.width % 8, cnt, pitch, size; u32 attribute =3D get_attribute(info, scr_readw(s)); u8 *dst, *buf =3D NULL; - u32 vyres =3D GETVYRES(ops->p, info); - u32 vxres =3D GETVXRES(ops->p, info); + u32 vyres =3D GETVYRES(par->p, info); + u32 vxres =3D GETVXRES(par->p, info); =20 - if (!ops->fontbuffer) + if (!par->fontbuffer) return; =20 image.fg_color =3D fg; @@ -251,29 +251,29 @@ static void ud_cursor(struct vc_data *vc, struct fb_i= nfo *info, bool enable, int fg, int bg) { struct fb_cursor cursor; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; unsigned short charmask =3D vc->vc_hi_font_mask ? 0x1ff : 0xff; int w =3D (vc->vc_font.width + 7) >> 3, c; - int y =3D real_y(ops->p, vc->state.y); + int y =3D real_y(par->p, vc->state.y); int attribute, use_sw =3D vc->vc_cursor_type & CUR_SW; int err =3D 1, dx, dy; char *src; - u32 vyres =3D GETVYRES(ops->p, info); - u32 vxres =3D GETVXRES(ops->p, info); + u32 vyres =3D GETVYRES(par->p, info); + u32 vxres =3D GETVXRES(par->p, info); =20 - if (!ops->fontbuffer) + if (!par->fontbuffer) return; =20 cursor.set =3D 0; =20 c =3D scr_readw((u16 *) vc->vc_pos); attribute =3D get_attribute(info, c); - src =3D ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.height)); + src =3D par->fontbuffer + ((c & charmask) * (w * vc->vc_font.height)); =20 - if (ops->cursor_state.image.data !=3D src || - ops->cursor_reset) { - ops->cursor_state.image.data =3D src; - cursor.set |=3D FB_CUR_SETIMAGE; + if (par->cursor_state.image.data !=3D src || + par->cursor_reset) { + par->cursor_state.image.data =3D src; + cursor.set |=3D FB_CUR_SETIMAGE; } =20 if (attribute) { @@ -282,49 +282,49 @@ static void ud_cursor(struct vc_data *vc, struct fb_i= nfo *info, bool enable, dst =3D kmalloc_array(w, vc->vc_font.height, GFP_ATOMIC); if (!dst) return; - kfree(ops->cursor_data); - ops->cursor_data =3D dst; + kfree(par->cursor_data); + par->cursor_data =3D dst; ud_update_attr(dst, src, attribute, vc); src =3D dst; } =20 - if (ops->cursor_state.image.fg_color !=3D fg || - ops->cursor_state.image.bg_color !=3D bg || - ops->cursor_reset) { - ops->cursor_state.image.fg_color =3D fg; - ops->cursor_state.image.bg_color =3D bg; + if (par->cursor_state.image.fg_color !=3D fg || + par->cursor_state.image.bg_color !=3D bg || + par->cursor_reset) { + par->cursor_state.image.fg_color =3D fg; + par->cursor_state.image.bg_color =3D bg; cursor.set |=3D FB_CUR_SETCMAP; } =20 - if (ops->cursor_state.image.height !=3D vc->vc_font.height || - ops->cursor_state.image.width !=3D vc->vc_font.width || - ops->cursor_reset) { - ops->cursor_state.image.height =3D vc->vc_font.height; - ops->cursor_state.image.width =3D vc->vc_font.width; + if (par->cursor_state.image.height !=3D vc->vc_font.height || + par->cursor_state.image.width !=3D vc->vc_font.width || + par->cursor_reset) { + par->cursor_state.image.height =3D vc->vc_font.height; + par->cursor_state.image.width =3D vc->vc_font.width; cursor.set |=3D FB_CUR_SETSIZE; } =20 dy =3D vyres - ((y * vc->vc_font.height) + vc->vc_font.height); dx =3D vxres - ((vc->state.x * vc->vc_font.width) + vc->vc_font.width); =20 - if (ops->cursor_state.image.dx !=3D dx || - ops->cursor_state.image.dy !=3D dy || - ops->cursor_reset) { - ops->cursor_state.image.dx =3D dx; - ops->cursor_state.image.dy =3D dy; + if (par->cursor_state.image.dx !=3D dx || + par->cursor_state.image.dy !=3D dy || + par->cursor_reset) { + par->cursor_state.image.dx =3D dx; + par->cursor_state.image.dy =3D dy; cursor.set |=3D FB_CUR_SETPOS; } =20 - if (ops->cursor_state.hot.x || ops->cursor_state.hot.y || - ops->cursor_reset) { - ops->cursor_state.hot.x =3D cursor.hot.y =3D 0; + if (par->cursor_state.hot.x || par->cursor_state.hot.y || + par->cursor_reset) { + par->cursor_state.hot.x =3D cursor.hot.y =3D 0; cursor.set |=3D FB_CUR_SETHOT; } =20 if (cursor.set & FB_CUR_SETSIZE || - vc->vc_cursor_type !=3D ops->p->cursor_shape || - ops->cursor_state.mask =3D=3D NULL || - ops->cursor_reset) { + vc->vc_cursor_type !=3D par->p->cursor_shape || + par->cursor_state.mask =3D=3D NULL || + par->cursor_reset) { char *mask =3D kmalloc_array(w, vc->vc_font.height, GFP_ATOMIC); int cur_height, size, i =3D 0; u8 msk =3D 0xff; @@ -332,13 +332,13 @@ static void ud_cursor(struct vc_data *vc, struct fb_i= nfo *info, bool enable, if (!mask) return; =20 - kfree(ops->cursor_state.mask); - ops->cursor_state.mask =3D mask; + kfree(par->cursor_state.mask); + par->cursor_state.mask =3D mask; =20 - ops->p->cursor_shape =3D vc->vc_cursor_type; + par->p->cursor_shape =3D vc->vc_cursor_type; cursor.set |=3D FB_CUR_SETSHAPE; =20 - switch (CUR_SIZE(ops->p->cursor_shape)) { + switch (CUR_SIZE(par->p->cursor_shape)) { case CUR_NONE: cur_height =3D 0; break; @@ -371,19 +371,19 @@ static void ud_cursor(struct vc_data *vc, struct fb_i= nfo *info, bool enable, mask[i++] =3D ~msk; } =20 - ops->cursor_state.enable =3D enable && !use_sw; + par->cursor_state.enable =3D enable && !use_sw; =20 cursor.image.data =3D src; - cursor.image.fg_color =3D ops->cursor_state.image.fg_color; - cursor.image.bg_color =3D ops->cursor_state.image.bg_color; - cursor.image.dx =3D ops->cursor_state.image.dx; - cursor.image.dy =3D ops->cursor_state.image.dy; - cursor.image.height =3D ops->cursor_state.image.height; - cursor.image.width =3D ops->cursor_state.image.width; - cursor.hot.x =3D ops->cursor_state.hot.x; - cursor.hot.y =3D ops->cursor_state.hot.y; - cursor.mask =3D ops->cursor_state.mask; - cursor.enable =3D ops->cursor_state.enable; + cursor.image.fg_color =3D par->cursor_state.image.fg_color; + cursor.image.bg_color =3D par->cursor_state.image.bg_color; + cursor.image.dx =3D par->cursor_state.image.dx; + cursor.image.dy =3D par->cursor_state.image.dy; + cursor.image.height =3D par->cursor_state.image.height; + cursor.image.width =3D par->cursor_state.image.width; + cursor.hot.x =3D par->cursor_state.hot.x; + cursor.hot.y =3D par->cursor_state.hot.y; + cursor.mask =3D par->cursor_state.mask; + cursor.enable =3D par->cursor_state.enable; cursor.image.depth =3D 1; cursor.rop =3D ROP_XOR; =20 @@ -393,36 +393,36 @@ static void ud_cursor(struct vc_data *vc, struct fb_i= nfo *info, bool enable, if (err) soft_cursor(info, &cursor); =20 - ops->cursor_reset =3D 0; + par->cursor_reset =3D 0; } =20 static int ud_update_start(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; int xoffset, yoffset; - u32 vyres =3D GETVYRES(ops->p, info); - u32 vxres =3D GETVXRES(ops->p, info); + u32 vyres =3D GETVYRES(par->p, info); + u32 vxres =3D GETVXRES(par->p, info); int err; =20 - xoffset =3D vxres - info->var.xres - ops->var.xoffset; - yoffset =3D vyres - info->var.yres - ops->var.yoffset; + xoffset =3D vxres - info->var.xres - par->var.xoffset; + yoffset =3D vyres - info->var.yres - par->var.yoffset; if (yoffset < 0) yoffset +=3D vyres; - ops->var.xoffset =3D xoffset; - ops->var.yoffset =3D yoffset; - err =3D fb_pan_display(info, &ops->var); - ops->var.xoffset =3D info->var.xoffset; - ops->var.yoffset =3D info->var.yoffset; - ops->var.vmode =3D info->var.vmode; + par->var.xoffset =3D xoffset; + par->var.yoffset =3D yoffset; + err =3D fb_pan_display(info, &par->var); + par->var.xoffset =3D info->var.xoffset; + par->var.yoffset =3D info->var.yoffset; + par->var.vmode =3D info->var.vmode; return err; } =20 -void fbcon_rotate_ud(struct fbcon_ops *ops) +void fbcon_rotate_ud(struct fbcon_par *par) { - ops->bmove =3D ud_bmove; - ops->clear =3D ud_clear; - ops->putcs =3D ud_putcs; - ops->clear_margins =3D ud_clear_margins; - ops->cursor =3D ud_cursor; - ops->update_start =3D ud_update_start; + par->bmove =3D ud_bmove; + par->clear =3D ud_clear; + par->putcs =3D ud_putcs; + par->clear_margins =3D ud_clear_margins; + par->cursor =3D ud_cursor; + par->update_start =3D ud_update_start; } diff --git a/drivers/video/fbdev/core/softcursor.c b/drivers/video/fbdev/co= re/softcursor.c index 29e5b21cf373..900788c05915 100644 --- a/drivers/video/fbdev/core/softcursor.c +++ b/drivers/video/fbdev/core/softcursor.c @@ -21,7 +21,7 @@ =20 int soft_cursor(struct fb_info *info, struct fb_cursor *cursor) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; unsigned int scan_align =3D info->pixmap.scan_align - 1; unsigned int buf_align =3D info->pixmap.buf_align - 1; unsigned int i, size, dsize, s_pitch, d_pitch; @@ -34,19 +34,19 @@ int soft_cursor(struct fb_info *info, struct fb_cursor = *cursor) s_pitch =3D (cursor->image.width + 7) >> 3; dsize =3D s_pitch * cursor->image.height; =20 - if (dsize + sizeof(struct fb_image) !=3D ops->cursor_size) { - kfree(ops->cursor_src); - ops->cursor_size =3D dsize + sizeof(struct fb_image); + if (dsize + sizeof(struct fb_image) !=3D par->cursor_size) { + kfree(par->cursor_src); + par->cursor_size =3D dsize + sizeof(struct fb_image); =20 - ops->cursor_src =3D kmalloc(ops->cursor_size, GFP_ATOMIC); - if (!ops->cursor_src) { - ops->cursor_size =3D 0; + par->cursor_src =3D kmalloc(par->cursor_size, GFP_ATOMIC); + if (!par->cursor_src) { + par->cursor_size =3D 0; return -ENOMEM; } } =20 - src =3D ops->cursor_src + sizeof(struct fb_image); - image =3D (struct fb_image *)ops->cursor_src; + src =3D par->cursor_src + sizeof(struct fb_image); + image =3D (struct fb_image *)par->cursor_src; *image =3D cursor->image; d_pitch =3D (s_pitch + scan_align) & ~scan_align; =20 diff --git a/drivers/video/fbdev/core/tileblit.c b/drivers/video/fbdev/core= /tileblit.c index d342b90c42b7..4428f2bcd3f8 100644 --- a/drivers/video/fbdev/core/tileblit.c +++ b/drivers/video/fbdev/core/tileblit.c @@ -151,34 +151,34 @@ static void tile_cursor(struct vc_data *vc, struct fb= _info *info, bool enable, =20 static int tile_update_start(struct fb_info *info) { - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; int err; =20 - err =3D fb_pan_display(info, &ops->var); - ops->var.xoffset =3D info->var.xoffset; - ops->var.yoffset =3D info->var.yoffset; - ops->var.vmode =3D info->var.vmode; + err =3D fb_pan_display(info, &par->var); + par->var.xoffset =3D info->var.xoffset; + par->var.yoffset =3D info->var.yoffset; + par->var.vmode =3D info->var.vmode; return err; } =20 void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info) { struct fb_tilemap map; - struct fbcon_ops *ops =3D info->fbcon_par; + struct fbcon_par *par =3D info->fbcon_par; =20 - ops->bmove =3D tile_bmove; - ops->clear =3D tile_clear; - ops->putcs =3D tile_putcs; - ops->clear_margins =3D tile_clear_margins; - ops->cursor =3D tile_cursor; - ops->update_start =3D tile_update_start; + par->bmove =3D tile_bmove; + par->clear =3D tile_clear; + par->putcs =3D tile_putcs; + par->clear_margins =3D tile_clear_margins; + par->cursor =3D tile_cursor; + par->update_start =3D tile_update_start; =20 - if (ops->p) { + if (par->p) { map.width =3D vc->vc_font.width; map.height =3D vc->vc_font.height; map.depth =3D 1; map.length =3D vc->vc_font.charcount; - map.data =3D ops->p->fontdata; + map.data =3D par->p->fontdata; info->tileops->fb_settile(info, &map); } } --=20 2.51.0 From nobody Thu Oct 2 22:48:44 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 7961A338F48 for ; Tue, 9 Sep 2025 12:49:06 +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=1757422148; cv=none; b=cz56wwLQx9Od5qsYoz5CoPVEbSCG2O1OEdteSrveXf9r9n4i3+EW61LCALoVsw7QX0se9JRZC++OcyzTso8d9cG6aubYithwrJN55U+rPJmRTWciR4ii+giTuuKnjmF8M54IEJb+91UM7Cc45ZNRDZeHchY7t7SBFKM2j4kkWY8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757422148; c=relaxed/simple; bh=0sPZ4UDlhK0Uty8ucd3kLYPOpJgfKEOJZABTRt33hfg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U3hoO4JabXdvSsmZ0h5MxJU7LkG3XcuzN4Se3BPi47tls+wuS0nQpjYnMcSVKy82livckSFKQy6PPhKr20rIFWZynbVOjrFPKuu5LLdjfo5o1JCi+aNAM1ORFzVG/4fLoGf6Ts7QzmwsjVBQIghCApQX79UEa4VaoColjFCNZ2A= 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=YDs9QXfn; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=h9lQC/Ru; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=YDs9QXfn; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=h9lQC/Ru; 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="YDs9QXfn"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="h9lQC/Ru"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="YDs9QXfn"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="h9lQC/Ru" 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 B371121E16; Tue, 9 Sep 2025 12:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757422144; 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=iXrTNcIXey7r3a4IZTag05S2jAmGCHxkyv+nq5ZFf6M=; b=YDs9QXfneYE2dw+PtqHLKvs2/FNXKJ2iiguMZ0EAtbODZYry3bd0q2zUyNh8itqEXDTVEY vqrnffZE4Ng2g6u4SPbZuIuHeSu0nbqRRRhehdUFpHJ5Tnpc/ksKe4lIi7tsmQrtm/qyxl HOs/YtwMdn3tHIaClzztM+RyJiyYvLE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757422144; 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=iXrTNcIXey7r3a4IZTag05S2jAmGCHxkyv+nq5ZFf6M=; b=h9lQC/Rugoj6ozHiIuawqV6NJxEQ9gd5YCc6OGqxxn04zTdi9pSJ/PddpZnqGOSZHqyh5U CPMqde51n4z+3bDw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757422144; 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=iXrTNcIXey7r3a4IZTag05S2jAmGCHxkyv+nq5ZFf6M=; b=YDs9QXfneYE2dw+PtqHLKvs2/FNXKJ2iiguMZ0EAtbODZYry3bd0q2zUyNh8itqEXDTVEY vqrnffZE4Ng2g6u4SPbZuIuHeSu0nbqRRRhehdUFpHJ5Tnpc/ksKe4lIi7tsmQrtm/qyxl HOs/YtwMdn3tHIaClzztM+RyJiyYvLE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757422144; 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=iXrTNcIXey7r3a4IZTag05S2jAmGCHxkyv+nq5ZFf6M=; b=h9lQC/Rugoj6ozHiIuawqV6NJxEQ9gd5YCc6OGqxxn04zTdi9pSJ/PddpZnqGOSZHqyh5U CPMqde51n4z+3bDw== 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 7F80113A56; Tue, 9 Sep 2025 12:49:04 +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 qFP1HUAiwGilUAAAD6G6ig (envelope-from ); Tue, 09 Sep 2025 12:49:04 +0000 From: Thomas Zimmermann To: sam@ravnborg.org, simona@ffwll.ch, deller@gmx.de Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 3/5] fbcon: Set rotate_font callback with related callbacks Date: Tue, 9 Sep 2025 14:44:43 +0200 Message-ID: <20250909124616.143365-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250909124616.143365-1-tzimmermann@suse.de> References: <20250909124616.143365-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-Spam-Level: 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)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:email,suse.de:mid]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[ravnborg.org,ffwll.ch,gmx.de]; RCVD_TLS_ALL(0.00)[]; TO_DN_SOME(0.00)[]; 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-Score: -2.80 Content-Type: text/plain; charset="utf-8" The field struct fbcon_par.rotate_font points to fbcon_rotate_font() if the console is rotated. Set the callback in the same place as the other callbacks. Prepares for declaring all fbcon callbacks in a dedicated struct type. If not rotated, fbcon_set_bitops() still clears the callback to NULL. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg --- drivers/video/fbdev/core/fbcon_ccw.c | 1 + drivers/video/fbdev/core/fbcon_cw.c | 1 + drivers/video/fbdev/core/fbcon_rotate.c | 4 +--- drivers/video/fbdev/core/fbcon_rotate.h | 3 +++ drivers/video/fbdev/core/fbcon_ud.c | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon_ccw.c b/drivers/video/fbdev/cor= e/fbcon_ccw.c index 2ba8ec4c3e2b..ba744b67a4fd 100644 --- a/drivers/video/fbdev/core/fbcon_ccw.c +++ b/drivers/video/fbdev/core/fbcon_ccw.c @@ -398,4 +398,5 @@ void fbcon_rotate_ccw(struct fbcon_par *par) par->clear_margins =3D ccw_clear_margins; par->cursor =3D ccw_cursor; par->update_start =3D ccw_update_start; + par->rotate_font =3D fbcon_rotate_font; } diff --git a/drivers/video/fbdev/core/fbcon_cw.c b/drivers/video/fbdev/core= /fbcon_cw.c index 4bd22d5ee5f4..974bd9d9b770 100644 --- a/drivers/video/fbdev/core/fbcon_cw.c +++ b/drivers/video/fbdev/core/fbcon_cw.c @@ -381,4 +381,5 @@ void fbcon_rotate_cw(struct fbcon_par *par) par->clear_margins =3D cw_clear_margins; par->cursor =3D cw_cursor; par->update_start =3D cw_update_start; + par->rotate_font =3D fbcon_rotate_font; } diff --git a/drivers/video/fbdev/core/fbcon_rotate.c b/drivers/video/fbdev/= core/fbcon_rotate.c index 380b2746451a..0c7cac71a9c2 100644 --- a/drivers/video/fbdev/core/fbcon_rotate.c +++ b/drivers/video/fbdev/core/fbcon_rotate.c @@ -18,7 +18,7 @@ #include "fbcon.h" #include "fbcon_rotate.h" =20 -static int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc) +int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc) { struct fbcon_par *par =3D info->fbcon_par; int len, err =3D 0; @@ -95,8 +95,6 @@ static int fbcon_rotate_font(struct fb_info *info, struct= vc_data *vc) =20 void fbcon_set_rotate(struct fbcon_par *par) { - par->rotate_font =3D fbcon_rotate_font; - switch (par->rotate) { case FB_ROTATE_CW: fbcon_rotate_cw(par); diff --git a/drivers/video/fbdev/core/fbcon_rotate.h b/drivers/video/fbdev/= core/fbcon_rotate.h index 48305e1a0763..784f3231a958 100644 --- a/drivers/video/fbdev/core/fbcon_rotate.h +++ b/drivers/video/fbdev/core/fbcon_rotate.h @@ -90,7 +90,10 @@ 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); + extern void fbcon_rotate_cw(struct fbcon_par *par); extern void fbcon_rotate_ud(struct fbcon_par *par); extern void fbcon_rotate_ccw(struct fbcon_par *par); + #endif diff --git a/drivers/video/fbdev/core/fbcon_ud.c b/drivers/video/fbdev/core= /fbcon_ud.c index 14b40e2bf323..1a214a4d538f 100644 --- a/drivers/video/fbdev/core/fbcon_ud.c +++ b/drivers/video/fbdev/core/fbcon_ud.c @@ -425,4 +425,5 @@ void fbcon_rotate_ud(struct fbcon_par *par) par->clear_margins =3D ud_clear_margins; par->cursor =3D ud_cursor; par->update_start =3D ud_update_start; + par->rotate_font =3D fbcon_rotate_font; } --=20 2.51.0 From nobody Thu Oct 2 22:48:44 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 9F7BB340D83 for ; Tue, 9 Sep 2025 12:49:12 +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=1757422154; cv=none; b=pIj7ACjjxrQSOHE5zjx4Nru52IHvbGYi0U57AoLxtCrVG0+TaXtaErxw27k2SFAPbP5cKrqfMd5hlVKR3TOdtCN9dXeaYZENY54WFFbF/Gdz2rPmBpIi3Qauc6QPJzQxzWGGKa8Dqj9cG57DOMt1k+WVvFoEsCycDNO9U61Evgs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757422154; c=relaxed/simple; bh=le/opr90WsLbRLVDS3JYJ3bEM/c1+AewdiFgAwCHpVE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aFjzZTLcUHo9D8O1Mlu8kZHO08V7Wg+sS/EJaB0AYjxmIhb90CQZBfw+quXcYUFZG2uC7+CTZVd6J5uJUkuaUIDXNTdN2DEK2FXc0EPuCASCKXpK9Pv9TneEFaT9I3WDrjYh8IAnRkOR2KIRW/wicxtRYP/JuraTr9f6KKrDLzk= 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=E7RPGP5t; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=5OXIV/oz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=apCQyMD/; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=iURf8Ofq; 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="E7RPGP5t"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="5OXIV/oz"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="apCQyMD/"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="iURf8Ofq" 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 E9C793376B; Tue, 9 Sep 2025 12:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757422145; 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=yxQHbrTyV81RyPWG/FvFLq/8PTMVadCkyymJBMEKf1s=; b=E7RPGP5tUBp3hJXwjQlYBjPZB51ej65wuiRBtKTuniqKzjWdWD6N8Bg/Ntl7yDU99ujWd6 EnYoVFlehQLHjAHGK9SF1y66yMTVHjsYD+ogSVZ5kRXgu2GIXYU9gQ+YL0iIx+3HEaKvMY JKDtYG9RY+UsA7CnKhvyYDnsrPwNfZk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757422145; 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=yxQHbrTyV81RyPWG/FvFLq/8PTMVadCkyymJBMEKf1s=; b=5OXIV/oz7cSVM9MTaaTuSGdPgzJBwe42WNyqk3cjzMwaLttYxizvxTO3xI+hMSjObGyzES mHgHfdQdalS05VAA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757422144; 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=yxQHbrTyV81RyPWG/FvFLq/8PTMVadCkyymJBMEKf1s=; b=apCQyMD/AQBbIYn0l7epPkCH5gNwwW79ueYI1JAiiD2NZ/eZor5B6MzFEEQq271Jd6pYwU atNl97qTupo4ddx3oH6MD+uDFargqbKaI9AYrYBqLRMKBv/dJ7z+6Q3p2tA0IXDIdcPdkm LR7DrNrtCx1mF0mjYFyyOHJC3i9iIIo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757422144; 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=yxQHbrTyV81RyPWG/FvFLq/8PTMVadCkyymJBMEKf1s=; b=iURf8OfqkbnlodLJwTniUJ9im2c+Wi8H3DcaCODB5mWSaqYVskgY/Jyu82XC1+lZLOcUSk MA+Ql4tlmqvDBHAg== 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 B93CB1388C; Tue, 9 Sep 2025 12:49:04 +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 mM4DLEAiwGilUAAAD6G6ig (envelope-from ); Tue, 09 Sep 2025 12:49:04 +0000 From: Thomas Zimmermann To: sam@ravnborg.org, simona@ffwll.ch, deller@gmx.de Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 4/5] fbcon: Move fbcon callbacks into struct fbcon_bitops Date: Tue, 9 Sep 2025 14:44:44 +0200 Message-ID: <20250909124616.143365-5-tzimmermann@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250909124616.143365-1-tzimmermann@suse.de> References: <20250909124616.143365-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-Spam-Level: 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)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:mid,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[ravnborg.org,ffwll.ch,gmx.de]; RCVD_TLS_ALL(0.00)[]; TO_DN_SOME(0.00)[]; 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-Score: -2.80 Content-Type: text/plain; charset="utf-8" Depending on rotation settings, fbcon sets different callback functions in struct fbcon_par from within fbcon_set_bitops(). Declare the callback functions in the new type struct fbcon_bitops. Then only replace the single bitops pointer in struct fbcon_par. Keeping callbacks in constant instances of struct fbcon_bitops makes it harder to exploit the callbacks. Also makes the code slightly easier to maintain. For tile-based consoles, there's a separate instance of the bitops structure. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg --- drivers/video/fbdev/core/bitblit.c | 17 ++++--- drivers/video/fbdev/core/fbcon.c | 67 +++++++++++++++------------- drivers/video/fbdev/core/fbcon.h | 7 ++- drivers/video/fbdev/core/fbcon_ccw.c | 18 +++++--- drivers/video/fbdev/core/fbcon_cw.c | 18 +++++--- drivers/video/fbdev/core/fbcon_ud.c | 18 +++++--- drivers/video/fbdev/core/tileblit.c | 16 ++++--- 7 files changed, 94 insertions(+), 67 deletions(-) diff --git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/= bitblit.c index ebadc9619699..7a68372f0444 100644 --- a/drivers/video/fbdev/core/bitblit.c +++ b/drivers/video/fbdev/core/bitblit.c @@ -384,15 +384,18 @@ static int bit_update_start(struct fb_info *info) return err; } =20 +static const struct fbcon_bitops bit_fbcon_bitops =3D { + .bmove =3D bit_bmove, + .clear =3D bit_clear, + .putcs =3D bit_putcs, + .clear_margins =3D bit_clear_margins, + .cursor =3D bit_cursor, + .update_start =3D bit_update_start, +}; + void fbcon_set_bitops(struct fbcon_par *par) { - par->bmove =3D bit_bmove; - par->clear =3D bit_clear; - par->putcs =3D bit_putcs; - par->clear_margins =3D bit_clear_margins; - par->cursor =3D bit_cursor; - par->update_start =3D bit_update_start; - par->rotate_font =3D NULL; + par->bitops =3D &bit_fbcon_bitops; =20 if (par->rotate) fbcon_set_rotate(par); diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fb= con.c index 7f871ef3e624..1074dc90ed92 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -405,9 +405,9 @@ static void fb_flashcursor(struct work_struct *work) =20 c =3D scr_readw((u16 *) vc->vc_pos); enable =3D par->cursor_flash && !par->cursor_state.enable; - par->cursor(vc, info, enable, - get_fg_color(vc, info, c), - get_bg_color(vc, info, c)); + par->bitops->cursor(vc, info, enable, + get_fg_color(vc, info, c), + get_bg_color(vc, info, c)); console_unlock(); =20 queue_delayed_work(system_power_efficient_wq, &par->cursor_work, @@ -1162,7 +1162,7 @@ static void fbcon_init(struct vc_data *vc, bool init) if (logo) fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows); =20 - if (par->rotate_font && par->rotate_font(info, vc)) { + if (par->bitops->rotate_font && par->bitops->rotate_font(info, vc)) { par->rotate =3D FB_ROTATE_UR; set_blitting_type(vc, info); } @@ -1303,10 +1303,11 @@ static void __fbcon_clear(struct vc_data *vc, unsig= ned int sy, unsigned int sx, y_break =3D p->vrows - p->yscroll; if (sy < y_break && sy + height - 1 >=3D y_break) { u_int b =3D y_break - sy; - par->clear(vc, info, real_y(p, sy), sx, b, width, fg, bg); - par->clear(vc, info, real_y(p, sy + b), sx, height - b, width, fg, bg); + par->bitops->clear(vc, info, real_y(p, sy), sx, b, width, fg, bg); + par->bitops->clear(vc, info, real_y(p, sy + b), sx, height - b, + width, fg, bg); } else - par->clear(vc, info, real_y(p, sy), sx, height, width, fg, bg); + par->bitops->clear(vc, info, real_y(p, sy), sx, height, width, fg, bg); } =20 static void fbcon_clear(struct vc_data *vc, unsigned int sy, unsigned int = sx, @@ -1323,9 +1324,9 @@ static void fbcon_putcs(struct vc_data *vc, const u16= *s, unsigned int count, struct fbcon_par *par =3D info->fbcon_par; =20 if (fbcon_is_active(vc, info)) - par->putcs(vc, info, s, count, real_y(p, ypos), xpos, - get_fg_color(vc, info, scr_readw(s)), - get_bg_color(vc, info, scr_readw(s))); + par->bitops->putcs(vc, info, s, count, real_y(p, ypos), xpos, + get_fg_color(vc, info, scr_readw(s)), + get_bg_color(vc, info, scr_readw(s))); } =20 static void fbcon_clear_margins(struct vc_data *vc, int bottom_only) @@ -1334,7 +1335,7 @@ static void fbcon_clear_margins(struct vc_data *vc, i= nt bottom_only) struct fbcon_par *par =3D info->fbcon_par; =20 if (fbcon_is_active(vc, info)) - par->clear_margins(vc, info, margin_color, bottom_only); + par->bitops->clear_margins(vc, info, margin_color, bottom_only); } =20 static void fbcon_cursor(struct vc_data *vc, bool enable) @@ -1355,12 +1356,12 @@ static void fbcon_cursor(struct vc_data *vc, bool e= nable) =20 par->cursor_flash =3D enable; =20 - if (!par->cursor) + if (!par->bitops->cursor) return; =20 - par->cursor(vc, info, enable, - get_fg_color(vc, info, c), - get_bg_color(vc, info, c)); + par->bitops->cursor(vc, info, enable, + get_fg_color(vc, info, c), + get_bg_color(vc, info, c)); } =20 static int scrollback_phys_max =3D 0; @@ -1444,7 +1445,7 @@ static __inline__ void ywrap_up(struct vc_data *vc, i= nt count) par->var.xoffset =3D 0; par->var.yoffset =3D p->yscroll * vc->vc_font.height; par->var.vmode |=3D FB_VMODE_YWRAP; - par->update_start(info); + par->bitops->update_start(info); scrollback_max +=3D count; if (scrollback_max > scrollback_phys_max) scrollback_max =3D scrollback_phys_max; @@ -1463,7 +1464,7 @@ static __inline__ void ywrap_down(struct vc_data *vc,= int count) par->var.xoffset =3D 0; par->var.yoffset =3D p->yscroll * vc->vc_font.height; par->var.vmode |=3D FB_VMODE_YWRAP; - par->update_start(info); + par->bitops->update_start(info); scrollback_max -=3D count; if (scrollback_max < 0) scrollback_max =3D 0; @@ -1478,15 +1479,15 @@ static __inline__ void ypan_up(struct vc_data *vc, = int count) =20 p->yscroll +=3D count; if (p->yscroll > p->vrows - vc->vc_rows) { - par->bmove(vc, info, p->vrows - vc->vc_rows, - 0, 0, 0, vc->vc_rows, vc->vc_cols); + par->bitops->bmove(vc, info, p->vrows - vc->vc_rows, + 0, 0, 0, vc->vc_rows, vc->vc_cols); p->yscroll -=3D p->vrows - vc->vc_rows; } =20 par->var.xoffset =3D 0; par->var.yoffset =3D p->yscroll * vc->vc_font.height; par->var.vmode &=3D ~FB_VMODE_YWRAP; - par->update_start(info); + par->bitops->update_start(info); fbcon_clear_margins(vc, 1); scrollback_max +=3D count; if (scrollback_max > scrollback_phys_max) @@ -1510,7 +1511,7 @@ static __inline__ void ypan_up_redraw(struct vc_data = *vc, int t, int count) par->var.xoffset =3D 0; par->var.yoffset =3D p->yscroll * vc->vc_font.height; par->var.vmode &=3D ~FB_VMODE_YWRAP; - par->update_start(info); + par->bitops->update_start(info); fbcon_clear_margins(vc, 1); scrollback_max +=3D count; if (scrollback_max > scrollback_phys_max) @@ -1526,15 +1527,15 @@ static __inline__ void ypan_down(struct vc_data *vc= , int count) =20 p->yscroll -=3D count; if (p->yscroll < 0) { - par->bmove(vc, info, 0, 0, p->vrows - vc->vc_rows, - 0, vc->vc_rows, vc->vc_cols); + par->bitops->bmove(vc, info, 0, 0, p->vrows - vc->vc_rows, + 0, vc->vc_rows, vc->vc_cols); p->yscroll +=3D p->vrows - vc->vc_rows; } =20 par->var.xoffset =3D 0; par->var.yoffset =3D p->yscroll * vc->vc_font.height; par->var.vmode &=3D ~FB_VMODE_YWRAP; - par->update_start(info); + par->bitops->update_start(info); fbcon_clear_margins(vc, 1); scrollback_max -=3D count; if (scrollback_max < 0) @@ -1558,7 +1559,7 @@ static __inline__ void ypan_down_redraw(struct vc_dat= a *vc, int t, int count) par->var.xoffset =3D 0; par->var.yoffset =3D p->yscroll * vc->vc_font.height; par->var.vmode &=3D ~FB_VMODE_YWRAP; - par->update_start(info); + par->bitops->update_start(info); fbcon_clear_margins(vc, 1); scrollback_max -=3D count; if (scrollback_max < 0) @@ -1620,8 +1621,8 @@ static void fbcon_redraw_blit(struct vc_data *vc, str= uct fb_info *info, =20 if (c =3D=3D scr_readw(d)) { if (s > start) { - par->bmove(vc, info, line + ycount, x, - line, x, 1, s - start); + par->bitops->bmove(vc, info, line + ycount, x, + line, x, 1, s - start); x +=3D s - start + 1; start =3D s + 1; } else { @@ -1636,7 +1637,8 @@ static void fbcon_redraw_blit(struct vc_data *vc, str= uct fb_info *info, d++; } while (s < le); if (s > start) - par->bmove(vc, info, line + ycount, x, line, x, 1, s - start); + par->bitops->bmove(vc, info, line + ycount, x, line, x, 1, + s - start); console_conditional_schedule(); if (ycount > 0) line++; @@ -1741,7 +1743,8 @@ static void fbcon_bmove_rec(struct vc_data *vc, struc= t fbcon_display *p, int sy, } return; } - par->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, height, width); + par->bitops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, + height, width); } =20 static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx, @@ -2161,7 +2164,7 @@ static bool fbcon_switch(struct vc_data *vc) set_blitting_type(vc, info); par->cursor_reset =3D 1; =20 - if (par->rotate_font && par->rotate_font(info, vc)) { + if (par->bitops->rotate_font && par->bitops->rotate_font(info, vc)) { par->rotate =3D FB_ROTATE_UR; set_blitting_type(vc, info); } @@ -2194,7 +2197,7 @@ static bool fbcon_switch(struct vc_data *vc) =20 if (fbcon_is_active(vc, info)) { par->var.xoffset =3D par->var.yoffset =3D p->yscroll =3D 0; - par->update_start(info); + par->bitops->update_start(info); } =20 fbcon_set_palette(vc, color_table); @@ -2693,7 +2696,7 @@ static void fbcon_modechanged(struct fb_info *info) =20 if (fbcon_is_active(vc, info)) { par->var.xoffset =3D par->var.yoffset =3D p->yscroll =3D 0; - par->update_start(info); + par->bitops->update_start(info); } =20 fbcon_set_palette(vc, color_table); diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fb= con.h index 94991a1ba11f..4bff4f5b3ec1 100644 --- a/drivers/video/fbdev/core/fbcon.h +++ b/drivers/video/fbdev/core/fbcon.h @@ -51,7 +51,7 @@ struct fbcon_display { const struct fb_videomode *mode; }; =20 -struct fbcon_par { +struct fbcon_bitops { void (*bmove)(struct vc_data *vc, struct fb_info *info, int sy, int sx, int dy, int dx, int height, int width); void (*clear)(struct vc_data *vc, struct fb_info *info, int sy, @@ -65,6 +65,9 @@ struct fbcon_par { bool enable, int fg, int bg); int (*update_start)(struct fb_info *info); int (*rotate_font)(struct fb_info *info, struct vc_data *vc); +}; + +struct fbcon_par { struct fb_var_screeninfo var; /* copy of the current fb_var_screeninfo */ struct delayed_work cursor_work; /* Cursor timer */ struct fb_cursor cursor_state; @@ -86,6 +89,8 @@ struct fbcon_par { u8 *cursor_src; u32 cursor_size; u32 fd_size; + + const struct fbcon_bitops *bitops; }; =20 /* diff --git a/drivers/video/fbdev/core/fbcon_ccw.c b/drivers/video/fbdev/cor= e/fbcon_ccw.c index ba744b67a4fd..4721f4b5e29a 100644 --- a/drivers/video/fbdev/core/fbcon_ccw.c +++ b/drivers/video/fbdev/core/fbcon_ccw.c @@ -390,13 +390,17 @@ static int ccw_update_start(struct fb_info *info) return err; } =20 +static const struct fbcon_bitops ccw_fbcon_bitops =3D { + .bmove =3D ccw_bmove, + .clear =3D ccw_clear, + .putcs =3D ccw_putcs, + .clear_margins =3D ccw_clear_margins, + .cursor =3D ccw_cursor, + .update_start =3D ccw_update_start, + .rotate_font =3D fbcon_rotate_font, +}; + void fbcon_rotate_ccw(struct fbcon_par *par) { - par->bmove =3D ccw_bmove; - par->clear =3D ccw_clear; - par->putcs =3D ccw_putcs; - par->clear_margins =3D ccw_clear_margins; - par->cursor =3D ccw_cursor; - par->update_start =3D ccw_update_start; - par->rotate_font =3D fbcon_rotate_font; + par->bitops =3D &ccw_fbcon_bitops; } diff --git a/drivers/video/fbdev/core/fbcon_cw.c b/drivers/video/fbdev/core= /fbcon_cw.c index 974bd9d9b770..2771924d0fb7 100644 --- a/drivers/video/fbdev/core/fbcon_cw.c +++ b/drivers/video/fbdev/core/fbcon_cw.c @@ -373,13 +373,17 @@ static int cw_update_start(struct fb_info *info) return err; } =20 +static const struct fbcon_bitops cw_fbcon_bitops =3D { + .bmove =3D cw_bmove, + .clear =3D cw_clear, + .putcs =3D cw_putcs, + .clear_margins =3D cw_clear_margins, + .cursor =3D cw_cursor, + .update_start =3D cw_update_start, + .rotate_font =3D fbcon_rotate_font, +}; + void fbcon_rotate_cw(struct fbcon_par *par) { - par->bmove =3D cw_bmove; - par->clear =3D cw_clear; - par->putcs =3D cw_putcs; - par->clear_margins =3D cw_clear_margins; - par->cursor =3D cw_cursor; - par->update_start =3D cw_update_start; - par->rotate_font =3D fbcon_rotate_font; + par->bitops =3D &cw_fbcon_bitops; } diff --git a/drivers/video/fbdev/core/fbcon_ud.c b/drivers/video/fbdev/core= /fbcon_ud.c index 1a214a4d538f..148ca9b539d1 100644 --- a/drivers/video/fbdev/core/fbcon_ud.c +++ b/drivers/video/fbdev/core/fbcon_ud.c @@ -417,13 +417,17 @@ static int ud_update_start(struct fb_info *info) return err; } =20 +static const struct fbcon_bitops ud_fbcon_bitops =3D { + .bmove =3D ud_bmove, + .clear =3D ud_clear, + .putcs =3D ud_putcs, + .clear_margins =3D ud_clear_margins, + .cursor =3D ud_cursor, + .update_start =3D ud_update_start, + .rotate_font =3D fbcon_rotate_font, +}; + void fbcon_rotate_ud(struct fbcon_par *par) { - par->bmove =3D ud_bmove; - par->clear =3D ud_clear; - par->putcs =3D ud_putcs; - par->clear_margins =3D ud_clear_margins; - par->cursor =3D ud_cursor; - par->update_start =3D ud_update_start; - par->rotate_font =3D fbcon_rotate_font; + par->bitops =3D &ud_fbcon_bitops; } diff --git a/drivers/video/fbdev/core/tileblit.c b/drivers/video/fbdev/core= /tileblit.c index 4428f2bcd3f8..a9db668caf72 100644 --- a/drivers/video/fbdev/core/tileblit.c +++ b/drivers/video/fbdev/core/tileblit.c @@ -161,17 +161,21 @@ static int tile_update_start(struct fb_info *info) return err; } =20 +static const struct fbcon_bitops tile_fbcon_bitops =3D { + .bmove =3D tile_bmove, + .clear =3D tile_clear, + .putcs =3D tile_putcs, + .clear_margins =3D tile_clear_margins, + .cursor =3D tile_cursor, + .update_start =3D tile_update_start, +}; + void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info) { struct fb_tilemap map; struct fbcon_par *par =3D info->fbcon_par; =20 - par->bmove =3D tile_bmove; - par->clear =3D tile_clear; - par->putcs =3D tile_putcs; - par->clear_margins =3D tile_clear_margins; - par->cursor =3D tile_cursor; - par->update_start =3D tile_update_start; + par->bitops =3D &tile_fbcon_bitops; =20 if (par->p) { map.width =3D vc->vc_font.width; --=20 2.51.0 From nobody Thu Oct 2 22:48:44 2025 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 C8EE8338F53 for ; Tue, 9 Sep 2025 12:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757422169; cv=none; b=Vn3dXrzelCbrpUeVxPcmS8LjSQ2NnZPNwgQMl4o1Ktw5w6/1wTm0LuYS94Y8zOkVH5WOc/bN/pvGFNVJ6cO8Py8oNGvq6olN079I5abjLdr6PHS1EwWud+tqcEUIPvOrgwb7f/uaaZbdrU1k6HxfyDtHzpq7c0z0haA0ABT/km0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757422169; c=relaxed/simple; bh=lL+kvbuubvLsUhD/Ea2na6fl33qse3s5rjzCMrWvCIU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tYgnMYmb7SWDreLQZ687fwQlbEFd6zBU2WrgckMlvLlOSzLNaegBRAVvRI927pfYFC8ZKh2I3Q3qgEZts9SctzhcR6DouXT2JArjoFLaJMUFe2im5lhz1pMCN4LVxMxWEjMDxZxSay2v3RV0oZv+5Epo2Zzm+HfZA1pBWOIIl7E= 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=fnO036Fu; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=AOaw69do; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=BHigqScE; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=y988j1Jh; arc=none smtp.client-ip=195.135.223.131 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="fnO036Fu"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="AOaw69do"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="BHigqScE"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="y988j1Jh" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out2.suse.de (Postfix) with ESMTPS id 2ED121FFD8; Tue, 9 Sep 2025 12:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757422146; 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=fXbkr+4cgZLwwrnUjo+/GvjaLMuCY/Ju3904Tb+aKU0=; b=fnO036Fu3RJdegvx/pc9wOpsTV1UoybHRZBbBZyr/vcRrVn0oi+Ken5IfchiRfjJ8GU/DM PeUmG216gUjdCz38W6M1/gcTRkUmitxfAZtkGw5IA+j1ai5iHktz/5WSrDj+bqSkuaHi86 bLL/h6yfcIKVOwq/kxb+Uzgt6nnOu9A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757422146; 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=fXbkr+4cgZLwwrnUjo+/GvjaLMuCY/Ju3904Tb+aKU0=; b=AOaw69doyO0pB9NNqss+sf119DIs6N1TATn05fBf6atwbmPIST5klJqHImdY42/tIJ2RfL rItnCWZlGRHGUNDg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=BHigqScE; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=y988j1Jh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757422145; 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=fXbkr+4cgZLwwrnUjo+/GvjaLMuCY/Ju3904Tb+aKU0=; b=BHigqScE4BfBkUAV7fn7TFFvrWXAVeynfbwjcnGCftFL9Relu0Szbn5c9pTzuD+q+T9O52 RgrdphSuApG0MgQTZerI7+FRWTJhJLmF3fA+XQyPg4B46l5Aejtz8ZntpxPwUW5h832EIS 9DjP9QZpGXxXvetsS8Kt85/3JqD4xyA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757422145; 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=fXbkr+4cgZLwwrnUjo+/GvjaLMuCY/Ju3904Tb+aKU0=; b=y988j1JhBL2DPsrKJVSeXr0OzSLoI+8YP/V6tX9hLtL0iZ3JbzQxJh/iJV6YiMPg91fI4e RP8KJzFAbnQVDzDA== 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 F09DC13A56; Tue, 9 Sep 2025 12:49:04 +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 OKqOOUAiwGilUAAAD6G6ig (envelope-from ); Tue, 09 Sep 2025 12:49:04 +0000 From: Thomas Zimmermann To: sam@ravnborg.org, simona@ffwll.ch, deller@gmx.de Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 5/5] fbcon: Streamline setting rotated/unrotated bitops Date: Tue, 9 Sep 2025 14:44:45 +0200 Message-ID: <20250909124616.143365-6-tzimmermann@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250909124616.143365-1-tzimmermann@suse.de> References: <20250909124616.143365-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 [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; FREEMAIL_TO(0.00)[ravnborg.org,ffwll.ch,gmx.de]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:mid,suse.de:dkim,suse.de:email]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_ENVRCPT(0.00)[gmx.de] X-Spam-Flag: NO X-Spam-Level: X-Rspamd-Queue-Id: 2ED121FFD8 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Score: -3.01 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 Reviewed-by: Sam Ravnborg --- 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 | 15 ++++++++++++--- drivers/video/fbdev/core/fbcon_ud.c | 2 +- 8 files changed, 38 insertions(+), 32 deletions(-) diff --git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/= bitblit.c index 7a68372f0444..08cfcd81c6b4 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_par *par) +void fbcon_set_bitops_ur(struct fbcon_par *par) { par->bitops =3D &bit_fbcon_bitops; - - if (par->rotate) - fbcon_set_rotate(par); } diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fb= con.c index 1074dc90ed92..85f63f87d3c1 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_par *par) +{ + switch (par->rotate) { + default: + fallthrough; + case FB_ROTATE_UR: + fbcon_set_bitops_ur(par); + break; + case FB_ROTATE_CW: + fbcon_set_bitops_cw(par); + break; + case FB_ROTATE_UD: + fbcon_set_bitops_ud(par); + break; + case FB_ROTATE_CCW: + fbcon_set_bitops_ccw(par); + break; + } +} + static int fbcon_get_rotate(struct fb_info *info) { struct fbcon_par *par =3D info->fbcon_par; diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fb= con.h index 4bff4f5b3ec1..44ea4ae4bba0 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_par *par); +extern void fbcon_set_bitops_ur(struct fbcon_par *par); 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_par *par); -#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 4721f4b5e29a..2f394b5a17f7 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_par *par) +void fbcon_set_bitops_ccw(struct fbcon_par *par) { par->bitops =3D &ccw_fbcon_bitops; } diff --git a/drivers/video/fbdev/core/fbcon_cw.c b/drivers/video/fbdev/core= /fbcon_cw.c index 2771924d0fb7..3c3ad3471ec4 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_par *par) +void fbcon_set_bitops_cw(struct fbcon_par *par) { par->bitops =3D &cw_fbcon_bitops; } diff --git a/drivers/video/fbdev/core/fbcon_rotate.c b/drivers/video/fbdev/= core/fbcon_rotate.c index 0c7cac71a9c2..1562a8f20b4f 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_par *par) -{ - switch (par->rotate) { - case FB_ROTATE_CW: - fbcon_rotate_cw(par); - break; - case FB_ROTATE_UD: - fbcon_rotate_ud(par); - break; - case FB_ROTATE_CCW: - fbcon_rotate_ccw(par); - break; - } -} diff --git a/drivers/video/fbdev/core/fbcon_rotate.h b/drivers/video/fbdev/= core/fbcon_rotate.h index 784f3231a958..8cb019e8a9c0 100644 --- a/drivers/video/fbdev/core/fbcon_rotate.h +++ b/drivers/video/fbdev/core/fbcon_rotate.h @@ -92,8 +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_par *par); -extern void fbcon_rotate_ud(struct fbcon_par *par); -extern void fbcon_rotate_ccw(struct fbcon_par *par); +#if defined(CONFIG_FRAMEBUFFER_CONSOLE_ROTATION) +void fbcon_set_bitops_cw(struct fbcon_par *par); +void fbcon_set_bitops_ud(struct fbcon_par *par); +void fbcon_set_bitops_ccw(struct fbcon_par *par); +#else +static inline void fbcon_set_bitops_cw(struct fbcon_par *par) +{ } +static inline void fbcon_set_bitops_ud(struct fbcon_par *par) +{ } +static inline void fbcon_set_bitops_ccw(struct fbcon_par *par) +{ } +#endif =20 #endif diff --git a/drivers/video/fbdev/core/fbcon_ud.c b/drivers/video/fbdev/core= /fbcon_ud.c index 148ca9b539d1..6fc30cad5b19 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_par *par) +void fbcon_set_bitops_ud(struct fbcon_par *par) { par->bitops =3D &ud_fbcon_bitops; } --=20 2.51.0