From nobody Sat Apr 18 19:08:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BE9AC43334 for ; Mon, 11 Jul 2022 15:51:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229530AbiGKPvA (ORCPT ); Mon, 11 Jul 2022 11:51:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229922AbiGKPun (ORCPT ); Mon, 11 Jul 2022 11:50:43 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5301377A40 for ; Mon, 11 Jul 2022 08:50:40 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by baptiste.telenet-ops.be with bizsmtp id trqd2700Z4C55Sk01rqdeL; Mon, 11 Jul 2022 17:50:38 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAvgD-0036wx-8w; Mon, 11 Jul 2022 17:50:37 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oAvgC-006sh9-RW; Mon, 11 Jul 2022 17:50:36 +0200 From: Geert Uytterhoeven To: Helge Deller Cc: Michael Schmitz , Jonathan Corbet , linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 01/10] video: fbdev: atari: Simplify atafb_pan_display() Date: Mon, 11 Jul 2022 17:50:25 +0200 Message-Id: <7b7c1c25309f40d780e25b258f726e6ebcc79ca4.1657554353.git.geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The fb_pan_display() function in the core already takes care of validating the panning parameters before calling the driver's .fb_pan_display() callback, and of updating the panning state afterwards, so there is no need to repeat that in the driver. Remove the duplicate code. Signed-off-by: Geert Uytterhoeven Tested-by: Michael Schmitz --- drivers/video/fbdev/atafb.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index 102c727cedc0f005..c0683d2a4efaf1e8 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -2407,35 +2407,10 @@ static void atafb_set_disp(struct fb_info *info) static int atafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { - int xoffset =3D var->xoffset; - int yoffset =3D var->yoffset; - int err; - - if (var->vmode & FB_VMODE_YWRAP) { - if (yoffset < 0 || yoffset >=3D info->var.yres_virtual || xoffset) - return -EINVAL; - } else { - if (xoffset + info->var.xres > info->var.xres_virtual || - yoffset + info->var.yres > info->var.yres_virtual) - return -EINVAL; - } - - if (fbhw->pan_display) { - err =3D fbhw->pan_display(var, info); - if (err) - return err; - } else + if (!fbhw->pan_display) return -EINVAL; =20 - info->var.xoffset =3D xoffset; - info->var.yoffset =3D yoffset; - - if (var->vmode & FB_VMODE_YWRAP) - info->var.vmode |=3D FB_VMODE_YWRAP; - else - info->var.vmode &=3D ~FB_VMODE_YWRAP; - - return 0; + return fbhw->pan_display(var, info); } =20 /* --=20 2.25.1 From nobody Sat Apr 18 19:08:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C500C43334 for ; Mon, 11 Jul 2022 15:51:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231748AbiGKPvL (ORCPT ); Mon, 11 Jul 2022 11:51:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231225AbiGKPut (ORCPT ); Mon, 11 Jul 2022 11:50:49 -0400 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD80A73931 for ; Mon, 11 Jul 2022 08:50:39 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by xavier.telenet-ops.be with bizsmtp id trqd2700h4C55Sk01rqd4C; Mon, 11 Jul 2022 17:50:38 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAvgD-0036wy-D6; Mon, 11 Jul 2022 17:50:37 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oAvgC-006shH-SJ; Mon, 11 Jul 2022 17:50:36 +0200 From: Geert Uytterhoeven To: Helge Deller Cc: Michael Schmitz , Jonathan Corbet , linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 02/10] video: fbdev: atari: Remove bogus FB_VMODE_YWRAP flags Date: Mon, 11 Jul 2022 17:50:26 +0200 Message-Id: <0373f203dc541e17e4e52981c9416b46b4df0c95.1657554353.git.geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Vertical wrap is not supported (fb_fix_screeninfo.ywrapstep =3D 0), hence there is no point in setting the FB_VMODE_YWRAP flag in video modes. Signed-off-by: Geert Uytterhoeven Tested-by: Michael Schmitz --- drivers/video/fbdev/atafb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index c0683d2a4efaf1e8..172ef547ff6f4883 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -467,27 +467,27 @@ static struct fb_videomode atafb_modedb[] __initdata = =3D { { /* 320x200, 15 kHz, 60 Hz (ST low) */ "st-low", 60, 320, 200, 32000, 32, 16, 31, 14, 96, 4, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP + 0, FB_VMODE_NONINTERLACED }, { /* 640x200, 15 kHz, 60 Hz (ST medium) */ "st-mid", 60, 640, 200, 32000, 32, 16, 31, 14, 96, 4, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP + 0, FB_VMODE_NONINTERLACED }, { /* 640x400, 30.25 kHz, 63.5 Hz (ST high) */ "st-high", 63, 640, 400, 32000, 128, 0, 40, 14, 128, 4, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP + 0, FB_VMODE_NONINTERLACED }, { /* 320x480, 15 kHz, 60 Hz (TT low) */ "tt-low", 60, 320, 480, 31041, 120, 100, 8, 16, 140, 30, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP + 0, FB_VMODE_NONINTERLACED }, { /* 640x480, 29 kHz, 57 Hz (TT medium) */ "tt-mid", 60, 640, 480, 31041, 120, 100, 8, 16, 140, 30, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP + 0, FB_VMODE_NONINTERLACED }, { /* 1280x960, 72 kHz, 72 Hz (TT high) */ "tt-high", 57, 1280, 960, 7760, 260, 60, 36, 4, 192, 4, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP + 0, FB_VMODE_NONINTERLACED }, =20 /* @@ -497,11 +497,11 @@ static struct fb_videomode atafb_modedb[] __initdata = =3D { { /* 640x480, 31 kHz, 60 Hz (VGA) */ "vga", 63.5, 640, 480, 32000, 18, 42, 31, 11, 96, 3, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP + 0, FB_VMODE_NONINTERLACED }, { /* 640x400, 31 kHz, 70 Hz (VGA) */ "vga70", 70, 640, 400, 32000, 18, 42, 31, 11, 96, 3, - FB_SYNC_VERT_HIGH_ACT | FB_SYNC_COMP_HIGH_ACT, FB_VMODE_NONINTERLACED | = FB_VMODE_YWRAP + FB_SYNC_VERT_HIGH_ACT | FB_SYNC_COMP_HIGH_ACT, FB_VMODE_NONINTERLACED }, =20 /* @@ -511,7 +511,7 @@ static struct fb_videomode atafb_modedb[] __initdata = =3D { { /* 896x608, 31 kHz, 60 Hz (Falcon High) */ "falh", 60, 896, 608, 32000, 18, 42, 31, 1, 96,3, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP + 0, FB_VMODE_NONINTERLACED }, }; =20 --=20 2.25.1 From nobody Sat Apr 18 19:08:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA6B1CCA47B for ; Mon, 11 Jul 2022 15:50:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231133AbiGKPun (ORCPT ); Mon, 11 Jul 2022 11:50:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbiGKPul (ORCPT ); Mon, 11 Jul 2022 11:50:41 -0400 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FCB95A467 for ; Mon, 11 Jul 2022 08:50:39 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by xavier.telenet-ops.be with bizsmtp id trqd2700e4C55Sk01rqd4B; Mon, 11 Jul 2022 17:50:38 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAvgD-0036wz-AP; Mon, 11 Jul 2022 17:50:37 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oAvgC-006shN-T7; Mon, 11 Jul 2022 17:50:36 +0200 From: Geert Uytterhoeven To: Helge Deller Cc: Michael Schmitz , Jonathan Corbet , linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 03/10] video: fbdev: atari: Fix inverse handling Date: Mon, 11 Jul 2022 17:50:27 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Currently, the "inverse" option does not do anything, as it just sets a flag, which is further unused. Fix this by calling fb_invert_cmaps() instead, like other drivers do. As this only affects the console colormap, this does not affect X. Update the documentation to match the actual behavior. Signed-off-by: Geert Uytterhoeven Tested-by: Michael Schmitz --- Documentation/m68k/kernel-options.rst | 4 ++-- drivers/video/fbdev/atafb.c | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Documentation/m68k/kernel-options.rst b/Documentation/m68k/ker= nel-options.rst index cabd9419740d5ada..2008a20b43295bd5 100644 --- a/Documentation/m68k/kernel-options.rst +++ b/Documentation/m68k/kernel-options.rst @@ -367,8 +367,8 @@ activated by a "external:" sub-option. 4.1.2) inverse -------------- =20 -Invert the display. This affects both, text (consoles) and graphics -(X) display. Usually, the background is chosen to be black. With this +Invert the display. This affects only text consoles. +Usually, the background is chosen to be black. With this option, you can make the background white. =20 4.1.3) font diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index 172ef547ff6f4883..39c3b860a797d4bc 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -236,8 +236,6 @@ static int *MV300_reg =3D MV300_reg_8bit; #endif /* ATAFB_EXT */ =20 =20 -static int inverse; - /* * struct fb_ops { * * open/release and usage marking @@ -2971,7 +2969,7 @@ static int __init atafb_setup(char *options) default_par =3D temp; mode_option =3D this_opt; } else if (!strcmp(this_opt, "inverse")) - inverse =3D 1; + fb_invert_cmaps(); else if (!strncmp(this_opt, "hwscroll_", 9)) { hwscroll =3D simple_strtoul(this_opt + 9, NULL, 10); if (hwscroll < 0) --=20 2.25.1 From nobody Sat Apr 18 19:08:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3ABF8C433EF for ; Mon, 11 Jul 2022 15:50:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231359AbiGKPux (ORCPT ); Mon, 11 Jul 2022 11:50:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230455AbiGKPun (ORCPT ); Mon, 11 Jul 2022 11:50:43 -0400 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1B076EAC for ; Mon, 11 Jul 2022 08:50:39 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by xavier.telenet-ops.be with bizsmtp id trqe2700d4C55Sk01rqe4f; Mon, 11 Jul 2022 17:50:38 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAvgD-0036x0-N6; Mon, 11 Jul 2022 17:50:37 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oAvgC-006shU-Tl; Mon, 11 Jul 2022 17:50:36 +0200 From: Geert Uytterhoeven To: Helge Deller Cc: Michael Schmitz , Jonathan Corbet , linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 04/10] video: fbdev: atari: Fix ext_setcolreg() Date: Mon, 11 Jul 2022 17:50:28 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The red, green, and blue color values are 16-bit, while the external graphics hardware registers are 8-bit. Add the missing conversion from 16-bit to 8-bit. Signed-off-by: Geert Uytterhoeven Tested-by: Michael Schmitz --- Untested due to lack of hardware. --- drivers/video/fbdev/atafb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index 39c3b860a797d4bc..a36cd8f1f4200dd5 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -2206,6 +2206,10 @@ static int ext_setcolreg(unsigned int regno, unsigne= d int red, if (regno > 255) return 1; =20 + red >>=3D 8; + green >>=3D 8; + blue >>=3D 8; + switch (external_card_type) { case IS_VGA: OUTB(0x3c8, regno); --=20 2.25.1 From nobody Sat Apr 18 19:08:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87501C43334 for ; Mon, 11 Jul 2022 15:51:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230463AbiGKPvQ (ORCPT ); Mon, 11 Jul 2022 11:51:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231251AbiGKPut (ORCPT ); Mon, 11 Jul 2022 11:50:49 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A72F77A4A for ; Mon, 11 Jul 2022 08:50:40 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by baptiste.telenet-ops.be with bizsmtp id trqe270064C55Sk01rqeeU; Mon, 11 Jul 2022 17:50:38 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAvgD-0036x1-Ny; Mon, 11 Jul 2022 17:50:37 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oAvgC-006shc-UU; Mon, 11 Jul 2022 17:50:36 +0200 From: Geert Uytterhoeven To: Helge Deller Cc: Michael Schmitz , Jonathan Corbet , linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 05/10] video: fbdev: atari: Remove unneeded casts from void * Date: Mon, 11 Jul 2022 17:50:29 +0200 Message-Id: <6347fe3212d34d6b50634ee967c0a4a2127610a8.1657554353.git.geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" There is no need to cast fb_info.par to "struct atafb_par *", as the former has type "void *". Remove the casts, as they make it impossible to validate types. Signed-off-by: Geert Uytterhoeven Tested-by: Michael Schmitz --- drivers/video/fbdev/atafb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index a36cd8f1f4200dd5..f20535ea3e549384 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -1639,7 +1639,7 @@ static irqreturn_t falcon_vbl_switcher(int irq, void = *dummy) static int falcon_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { - struct atafb_par *par =3D (struct atafb_par *)info->par; + struct atafb_par *par =3D info->par; =20 int xoffset; int bpp =3D info->var.bits_per_pixel; @@ -2263,7 +2263,7 @@ static void set_screen_base(void *s_base) =20 static int pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { - struct atafb_par *par =3D (struct atafb_par *)info->par; + struct atafb_par *par =3D info->par; =20 if (!fbhw->set_screen_base || (!ATARIHW_PRESENT(EXTD_SHIFTER) && var->xoffset)) @@ -2432,7 +2432,7 @@ atafb_pan_display(struct fb_var_screeninfo *var, stru= ct fb_info *info) =20 static void atafb_fillrect(struct fb_info *info, const struct fb_fillrect = *rect) { - struct atafb_par *par =3D (struct atafb_par *)info->par; + struct atafb_par *par =3D info->par; int x2, y2; u32 width, height; =20 @@ -2475,7 +2475,7 @@ static void atafb_fillrect(struct fb_info *info, cons= t struct fb_fillrect *rect) =20 static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea = *area) { - struct atafb_par *par =3D (struct atafb_par *)info->par; + struct atafb_par *par =3D info->par; int x2, y2; u32 dx, dy, sx, sy, width, height; int rev_copy =3D 0; @@ -2529,7 +2529,7 @@ static void atafb_copyarea(struct fb_info *info, cons= t struct fb_copyarea *area) =20 static void atafb_imageblit(struct fb_info *info, const struct fb_image *i= mage) { - struct atafb_par *par =3D (struct atafb_par *)info->par; + struct atafb_par *par =3D info->par; int x2, y2; unsigned long *dst; int dst_idx; @@ -2672,7 +2672,7 @@ static int atafb_check_var(struct fb_var_screeninfo *= var, struct fb_info *info) * hw par just decoded */ static int atafb_set_par(struct fb_info *info) { - struct atafb_par *par =3D (struct atafb_par *)info->par; + struct atafb_par *par =3D info->par; =20 /* Decode wanted screen parameters */ fbhw->decode_var(&info->var, par); --=20 2.25.1 From nobody Sat Apr 18 19:08:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E15FC433EF for ; Mon, 11 Jul 2022 15:56:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231130AbiGKP4Y (ORCPT ); Mon, 11 Jul 2022 11:56:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230358AbiGKP4W (ORCPT ); Mon, 11 Jul 2022 11:56:22 -0400 X-Greylist: delayed 338 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 11 Jul 2022 08:56:21 PDT Received: from gauss.telenet-ops.be (gauss.telenet-ops.be [IPv6:2a02:1800:120:4::f00:11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 855D42B270 for ; Mon, 11 Jul 2022 08:56:21 -0700 (PDT) Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by gauss.telenet-ops.be (Postfix) with ESMTPS id 4LhSyl2lCnz4x3QD for ; Mon, 11 Jul 2022 17:50:39 +0200 (CEST) Received: from ramsan.of.borg ([84.195.186.194]) by xavier.telenet-ops.be with bizsmtp id trqf270054C55Sk01rqf58; Mon, 11 Jul 2022 17:50:39 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAvgE-0036x2-H5; Mon, 11 Jul 2022 17:50:38 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oAvgC-006shk-Vj; Mon, 11 Jul 2022 17:50:36 +0200 From: Geert Uytterhoeven To: Helge Deller Cc: Michael Schmitz , Jonathan Corbet , linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 06/10] video: fbdev: atari: Remove unneeded casts to void * Date: Mon, 11 Jul 2022 17:50:30 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Arbitrary pointers can be passed to functions accepting "void *" without casting. Remove the casts, as they make it impossible to validate types. Signed-off-by: Geert Uytterhoeven Tested-by: Michael Schmitz --- drivers/video/fbdev/atafb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index f20535ea3e549384..fbc333d5615df5d5 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -2599,14 +2599,14 @@ atafb_ioctl(struct fb_info *info, unsigned int cmd,= unsigned long arg) switch (cmd) { #ifdef FBCMD_GET_CURRENTPAR case FBCMD_GET_CURRENTPAR: - if (copy_to_user((void *)arg, (void *)¤t_par, + if (copy_to_user((void *)arg, ¤t_par, sizeof(struct atafb_par))) return -EFAULT; return 0; #endif #ifdef FBCMD_SET_CURRENTPAR case FBCMD_SET_CURRENTPAR: - if (copy_from_user((void *)¤t_par, (void *)arg, + if (copy_from_user(¤t_par, (void *)arg, sizeof(struct atafb_par))) return -EFAULT; ata_set_par(¤t_par); --=20 2.25.1 From nobody Sat Apr 18 19:08:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BD9EC433EF for ; Mon, 11 Jul 2022 15:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229968AbiGKPvT (ORCPT ); Mon, 11 Jul 2022 11:51:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231515AbiGKPu7 (ORCPT ); Mon, 11 Jul 2022 11:50:59 -0400 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A695877A4D for ; Mon, 11 Jul 2022 08:50:40 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by andre.telenet-ops.be with bizsmtp id trqe2700R4C55Sk01rqe5a; Mon, 11 Jul 2022 17:50:38 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAvgE-0036x3-2b; Mon, 11 Jul 2022 17:50:38 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oAvgD-006shq-13; Mon, 11 Jul 2022 17:50:37 +0200 From: Geert Uytterhoeven To: Helge Deller Cc: Michael Schmitz , Jonathan Corbet , linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 07/10] video: fbdev: atari: Fix TT High video mode vertical refresh Date: Mon, 11 Jul 2022 17:50:31 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The vertical refresh rate for the TT High video mode (1280x960) is wrong. Fortunately this field is not really used. Signed-off-by: Geert Uytterhoeven Tested-by: Michael Schmitz --- drivers/video/fbdev/atafb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index fbc333d5615df5d5..528478f6f30857ef 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -484,7 +484,7 @@ static struct fb_videomode atafb_modedb[] __initdata = =3D { 0, FB_VMODE_NONINTERLACED }, { /* 1280x960, 72 kHz, 72 Hz (TT high) */ - "tt-high", 57, 1280, 960, 7760, 260, 60, 36, 4, 192, 4, + "tt-high", 72, 1280, 960, 7760, 260, 60, 36, 4, 192, 4, 0, FB_VMODE_NONINTERLACED }, =20 --=20 2.25.1 From nobody Sat Apr 18 19:08:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EEB4CCA47B for ; Mon, 11 Jul 2022 15:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231733AbiGKPvH (ORCPT ); Mon, 11 Jul 2022 11:51:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbiGKPun (ORCPT ); Mon, 11 Jul 2022 11:50:43 -0400 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52D617748E for ; Mon, 11 Jul 2022 08:50:40 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by xavier.telenet-ops.be with bizsmtp id trqe270124C55Sk01rqe4s; Mon, 11 Jul 2022 17:50:38 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAvgD-0036xD-Vl; Mon, 11 Jul 2022 17:50:37 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oAvgD-006shx-2d; Mon, 11 Jul 2022 17:50:37 +0200 From: Geert Uytterhoeven To: Helge Deller Cc: Michael Schmitz , Jonathan Corbet , linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 08/10] video: fbdev: atari: Fix VGA modes Date: Mon, 11 Jul 2022 17:50:32 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The pixclock values in the vga and vga70 modes are wrong, as they should use the 25.175 MHz clock instead of the 32 MHz clock. Swap the left and right margins to match f25.{right,left} (struct pixel_clock declares them in a different order), and update the hsync lengths to match what the driver programs by default. Correct the (wrong) floating-point vrefresh value for the vga mode. Signed-off-by: Geert Uytterhoeven Tested-by: Michael Schmitz --- drivers/video/fbdev/atafb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index 528478f6f30857ef..46a00e0ad5e785ac 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -494,11 +494,11 @@ static struct fb_videomode atafb_modedb[] __initdata = =3D { =20 { /* 640x480, 31 kHz, 60 Hz (VGA) */ - "vga", 63.5, 640, 480, 32000, 18, 42, 31, 11, 96, 3, + "vga", 60, 640, 480, 39721, 42, 18, 31, 11, 100, 3, 0, FB_VMODE_NONINTERLACED }, { /* 640x400, 31 kHz, 70 Hz (VGA) */ - "vga70", 70, 640, 400, 32000, 18, 42, 31, 11, 96, 3, + "vga70", 70, 640, 400, 39721, 42, 18, 31, 11, 100, 3, FB_SYNC_VERT_HIGH_ACT | FB_SYNC_COMP_HIGH_ACT, FB_VMODE_NONINTERLACED }, =20 --=20 2.25.1 From nobody Sat Apr 18 19:08:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11413C433EF for ; Mon, 11 Jul 2022 15:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231825AbiGKPvW (ORCPT ); Mon, 11 Jul 2022 11:51:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231531AbiGKPu7 (ORCPT ); Mon, 11 Jul 2022 11:50:59 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6D0777A58 for ; Mon, 11 Jul 2022 08:50:40 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by baptiste.telenet-ops.be with bizsmtp id trqe2700s4C55Sk01rqeem; Mon, 11 Jul 2022 17:50:38 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAvgE-0036xE-7d; Mon, 11 Jul 2022 17:50:38 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oAvgD-006si5-4H; Mon, 11 Jul 2022 17:50:37 +0200 From: Geert Uytterhoeven To: Helge Deller Cc: Michael Schmitz , Jonathan Corbet , linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 09/10] video: fbdev: atari: Remove unused definitions and variables Date: Mon, 11 Jul 2022 17:50:33 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Several definitions and variables are unused. Some variables are set but further unused. Remove them. Signed-off-by: Geert Uytterhoeven Tested-by: Michael Schmitz --- drivers/video/fbdev/atafb.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index 46a00e0ad5e785ac..e8b178e732e2c785 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -1070,8 +1070,6 @@ static int falcon_decode_var(struct fb_var_screeninfo= *var, xstretch =3D 2; /* Double pixel width only for hicolor */ /* Default values are used for vert./hor. timing if no pixelclock given.= */ if (var->pixclock =3D=3D 0) { - int linesize; - /* Choose master pixelclock depending on hor. timing */ plen =3D 1 * xstretch; if ((plen * xres + f25.right + f25.hsync + f25.left) * @@ -1090,7 +1088,6 @@ static int falcon_decode_var(struct fb_var_screeninfo= *var, left_margin =3D pclock->left / plen; right_margin =3D pclock->right / plen; hsync_len =3D pclock->hsync / plen; - linesize =3D left_margin + xres + right_margin + hsync_len; upper_margin =3D 31; lower_margin =3D 11; vsync_len =3D 3; @@ -2419,17 +2416,6 @@ atafb_pan_display(struct fb_var_screeninfo *var, str= uct fb_info *info) * generic drawing routines; imageblit needs updating for image depth > 1 */ =20 -#if BITS_PER_LONG =3D=3D 32 -#define BYTES_PER_LONG 4 -#define SHIFT_PER_LONG 5 -#elif BITS_PER_LONG =3D=3D 64 -#define BYTES_PER_LONG 8 -#define SHIFT_PER_LONG 6 -#else -#define Please update me -#endif - - static void atafb_fillrect(struct fb_info *info, const struct fb_fillrect = *rect) { struct atafb_par *par =3D info->par; @@ -2531,8 +2517,6 @@ static void atafb_imageblit(struct fb_info *info, con= st struct fb_image *image) { struct atafb_par *par =3D info->par; int x2, y2; - unsigned long *dst; - int dst_idx; const char *src; u32 dx, dy, width, height, pitch; =20 @@ -2559,10 +2543,6 @@ static void atafb_imageblit(struct fb_info *info, co= nst struct fb_image *image) =20 if (image->depth =3D=3D 1) { // used for font data - dst =3D (unsigned long *) - ((unsigned long)info->screen_base & ~(BYTES_PER_LONG - 1)); - dst_idx =3D ((unsigned long)info->screen_base & (BYTES_PER_LONG - 1)) * = 8; - dst_idx +=3D dy * par->next_line * 8 + dx; src =3D image->data; pitch =3D (image->width + 7) / 8; while (height--) { --=20 2.25.1 From nobody Sat Apr 18 19:08:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3117CCCA48A for ; Mon, 11 Jul 2022 15:50:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231168AbiGKPuq (ORCPT ); Mon, 11 Jul 2022 11:50:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbiGKPum (ORCPT ); Mon, 11 Jul 2022 11:50:42 -0400 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6BA777A53 for ; Mon, 11 Jul 2022 08:50:40 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by andre.telenet-ops.be with bizsmtp id trqe2700J4C55Sk01rqe5Y; Mon, 11 Jul 2022 17:50:38 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAvgD-0036xI-Rt; Mon, 11 Jul 2022 17:50:37 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oAvgD-006siC-6A; Mon, 11 Jul 2022 17:50:37 +0200 From: Geert Uytterhoeven To: Helge Deller Cc: Michael Schmitz , Jonathan Corbet , linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 10/10] [RFC] video: fbdev: atari: Remove backward bug-compatibility Date: Mon, 11 Jul 2022 17:50:34 +0200 Message-Id: <52d52566a80bfd00acdcfc28a24799d3fbf638f6.1657554353.git.geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As of v2.1.0, falcon_decode_var() contains a quirk to fix a rounding error, as explained by G=C3=BCnther Kelleter on Fri, 30 Aug 1996: This diff removes the now obsolete Falcon video option "pwrsave", and fixes a rounding error that is triggered by the resolution switching X server (those who use the pixel clock value 39722 in their /etc/fb.modes should change it to 39721). However, this causes the modified video mode returned by falcon_decode_var() to not match the video mode returned by falcon_encode_var(). Fix this by dropping the quirk. Unfortunately /etc/fb.modes in fbset was never updated, so the "640x480-60" mode still contains the wrong pixclock. Hence this change may introduce a regression. Signed-off-by: Geert Uytterhoeven Tested-by: Michael Schmitz --- Any comments? --- drivers/video/fbdev/atafb.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index e8b178e732e2c785..2bc4089865e60ac2 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -1008,10 +1008,6 @@ static int falcon_decode_var(struct fb_var_screeninf= o *var, else if (yres_virtual < yres) yres_virtual =3D yres; =20 - /* backward bug-compatibility */ - if (var->pixclock > 1) - var->pixclock -=3D 1; - par->hw.falcon.line_width =3D bpp * xres / 16; par->hw.falcon.line_offset =3D bpp * (xres_virtual - xres) / 16; =20 --=20 2.25.1