From patchwork Wed Jul 12 08:59:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiri Slaby \(SUSE\)" X-Patchwork-Id: 702064 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 1FB21EB64D9 for ; Wed, 12 Jul 2023 09:01:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233070AbjGLJBf (ORCPT ); Wed, 12 Jul 2023 05:01:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231796AbjGLJBI (ORCPT ); Wed, 12 Jul 2023 05:01:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 208C5269A; Wed, 12 Jul 2023 01:59:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 92541616E6; Wed, 12 Jul 2023 08:59:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 699AAC433CA; Wed, 12 Jul 2023 08:59:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689152388; bh=ZrJHzT2K9435cGUOZjdcu1RL4XkwF5n9Ynfmc/OI09Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kHMz1RajGGyT8QAgPhNYUibwugiKRyBupzLguqjKvMqzVnEj4uap14DzDwsl7xEhk IhNjzK7h+yaZuqJGS75WXsePAnLedFsRFi6LtzkWK2BeYhGHdq2DXuEaeulC+TmBZ8 Tf1KHe1DXobmTlW965juIlOyZFmBmtMlSC03TxK2wWGMMMPUGDEGFImqFb1s/hd4zQ xp8RhOiPyJqjQeRnPKbedtQA/4/r/PiQsPKsLjSb88pZTiQtOLCVeOx9+GSOiVJWBv 7PHaMMAYgdTDuUGMMOu6m1Vv/E2RUJE5xGeNJCjMOB7Xr3pnRu995sZWDCBSu80iRU P8LR9M37ACinA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Helge Deller , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 1/7] vgacon: switch vgacon_scrolldelta() and vgacon_restore_screen() Date: Wed, 12 Jul 2023 10:59:36 +0200 Message-ID: <20230712085942.5064-2-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712085942.5064-1-jirislaby@kernel.org> References: <20230712085942.5064-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Switch vgacon_scrolldelta() and vgacon_restore_screen() positions, so that the former is not needed to be forward-declared. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/console/vgacon.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index e25ba523892e..fbed2862c317 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -142,12 +142,6 @@ static inline void vga_set_mem_top(struct vc_data *c) write_vga(12, (c->vc_visible_origin - vga_vram_base) / 2); } -static void vgacon_restore_screen(struct vc_data *c) -{ - if (c->vc_origin != c->vc_visible_origin) - vgacon_scrolldelta(c, 0); -} - static void vgacon_scrolldelta(struct vc_data *c, int lines) { vc_scrolldelta_helper(c, lines, vga_rolled_over, (void *)vga_vram_base, @@ -155,6 +149,12 @@ static void vgacon_scrolldelta(struct vc_data *c, int lines) vga_set_mem_top(c); } +static void vgacon_restore_screen(struct vc_data *c) +{ + if (c->vc_origin != c->vc_visible_origin) + vgacon_scrolldelta(c, 0); +} + static const char *vgacon_startup(void) { const char *display_desc = NULL; From patchwork Wed Jul 12 08:59:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiri Slaby \(SUSE\)" X-Patchwork-Id: 703014 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 AAB6AEB64D9 for ; Wed, 12 Jul 2023 09:01:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233132AbjGLJBh (ORCPT ); Wed, 12 Jul 2023 05:01:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232251AbjGLJBK (ORCPT ); Wed, 12 Jul 2023 05:01:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02CEE1FC0; Wed, 12 Jul 2023 01:59:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 950D8616FC; Wed, 12 Jul 2023 08:59:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71BB7C433C7; Wed, 12 Jul 2023 08:59:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689152390; bh=q7X2H6wnJfjAIZzf5I1p+6g/psQfHm52+nWJPGyD/fU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nu1RxwCLBGO1JbcwAvLaNexfSyoJuJQTwytsebBBUQNtoZIrMa0JJ9THxO+5vu2pa v/Qdd39gZJsfTAcB6gh+j8xjRMf4PPC1cBH5sqdF1GPJeJVBNNEqHLIrR+8w7bfPMP qGGHe1VPNlc8Fxs154PJUn7aXn8XF5RO6/Z/InMu6BvVmMbZaw/31qvSAXSu2EM/Bh H/yfbco6KIN0OWDp3mafTUz8YG1pFPDU7ch2jwPKDHmpRa9k9MkB8jThlAyKki0ey3 W6oG93UIOXTHajb2c6TgDN/bdF41XeiiCxZElLJceQFgmiYQtF0N8AUTII+DqzMsTQ BEwQi/CHTa3VA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Helge Deller , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 2/7] vgacon: remove unneeded forward declarations Date: Wed, 12 Jul 2023 10:59:37 +0200 Message-ID: <20230712085942.5064-3-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712085942.5064-1-jirislaby@kernel.org> References: <20230712085942.5064-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Most of the forward declarations in vgacon are not needed. Drop them. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/console/vgacon.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index fbed2862c317..a34cdfcc10c2 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -65,16 +65,8 @@ static struct vgastate vgastate; * Interface used by the world */ -static const char *vgacon_startup(void); -static void vgacon_init(struct vc_data *c, int init); -static void vgacon_deinit(struct vc_data *c); -static void vgacon_cursor(struct vc_data *c, int mode); -static int vgacon_switch(struct vc_data *c); -static int vgacon_blank(struct vc_data *c, int blank, int mode_switch); -static void vgacon_scrolldelta(struct vc_data *c, int lines); static int vgacon_set_origin(struct vc_data *c); -static void vgacon_save_screen(struct vc_data *c); -static void vgacon_invert_region(struct vc_data *c, u16 * p, int count); + static struct uni_pagedict *vgacon_uni_pagedir; static int vgacon_refcount; From patchwork Wed Jul 12 08:59:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiri Slaby \(SUSE\)" X-Patchwork-Id: 702063 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 DD0BEEB64DD for ; Wed, 12 Jul 2023 09:01:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233159AbjGLJBz (ORCPT ); Wed, 12 Jul 2023 05:01:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233129AbjGLJBL (ORCPT ); Wed, 12 Jul 2023 05:01:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DC7D1986; Wed, 12 Jul 2023 01:59:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9F097615AE; Wed, 12 Jul 2023 08:59:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7850CC433CA; Wed, 12 Jul 2023 08:59:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689152392; bh=y3hv9WFGlNw1n+L3OTmMN+6+YqGwW/2IDAh5UD/0MEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qe5T2rMBOLg417NRLdwwzjsIGBMzX/k6o/ISyoMrX0uLuuXnO1SomP2eRgYhc6uH4 mGzNYeYi5EJjI7C5MipUa7iJuurwPLtEVR7w91m365rcsTQeegPZ8KJqNdJTGA/fbG doUUbkkLHEkb8lUGUBqxEUtuoqZR4es5Co1g1NICBOp/Sn5KoNwRPSTzoVlq1MFi/e UEe+hbkfsEptDpv6o8PSVjFsRVFQ+gDpkQx05EuC9w9O5zU4ZGA23gkY33+vFK3OUX ANyC+mZV8ABYZD+hr9GF4Y164fLwbDJwiy+stWRJc3JY56ID316t9iBux8/69R36M6 uESumahRtoC8g== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Helge Deller , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 3/7] vgacon: remove unused xpos from vgacon_set_cursor_size() Date: Wed, 12 Jul 2023 10:59:38 +0200 Message-ID: <20230712085942.5064-4-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712085942.5064-1-jirislaby@kernel.org> References: <20230712085942.5064-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org xpos is unused, remove it. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/console/vgacon.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index a34cdfcc10c2..7cb15851ea56 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -437,7 +437,7 @@ static void vgacon_invert_region(struct vc_data *c, u16 * p, int count) } } -static void vgacon_set_cursor_size(int xpos, int from, int to) +static void vgacon_set_cursor_size(int from, int to) { unsigned long flags; int curs, cure; @@ -479,9 +479,9 @@ static void vgacon_cursor(struct vc_data *c, int mode) case CM_ERASE: write_vga(14, (c->vc_pos - vga_vram_base) / 2); if (vga_video_type >= VIDEO_TYPE_VGAC) - vgacon_set_cursor_size(c->state.x, 31, 30); + vgacon_set_cursor_size(31, 30); else - vgacon_set_cursor_size(c->state.x, 31, 31); + vgacon_set_cursor_size(31, 31); break; case CM_MOVE: @@ -489,8 +489,7 @@ static void vgacon_cursor(struct vc_data *c, int mode) write_vga(14, (c->vc_pos - vga_vram_base) / 2); switch (CUR_SIZE(c->vc_cursor_type)) { case CUR_UNDERLINE: - vgacon_set_cursor_size(c->state.x, - c->vc_cell_height - + vgacon_set_cursor_size(c->vc_cell_height - (c->vc_cell_height < 10 ? 2 : 3), c->vc_cell_height - @@ -498,35 +497,31 @@ static void vgacon_cursor(struct vc_data *c, int mode) 10 ? 1 : 2)); break; case CUR_TWO_THIRDS: - vgacon_set_cursor_size(c->state.x, - c->vc_cell_height / 3, + vgacon_set_cursor_size(c->vc_cell_height / 3, c->vc_cell_height - (c->vc_cell_height < 10 ? 1 : 2)); break; case CUR_LOWER_THIRD: - vgacon_set_cursor_size(c->state.x, - (c->vc_cell_height * 2) / 3, + vgacon_set_cursor_size((c->vc_cell_height * 2) / 3, c->vc_cell_height - (c->vc_cell_height < 10 ? 1 : 2)); break; case CUR_LOWER_HALF: - vgacon_set_cursor_size(c->state.x, - c->vc_cell_height / 2, + vgacon_set_cursor_size(c->vc_cell_height / 2, c->vc_cell_height - (c->vc_cell_height < 10 ? 1 : 2)); break; case CUR_NONE: if (vga_video_type >= VIDEO_TYPE_VGAC) - vgacon_set_cursor_size(c->state.x, 31, 30); + vgacon_set_cursor_size(31, 30); else - vgacon_set_cursor_size(c->state.x, 31, 31); + vgacon_set_cursor_size(31, 31); break; default: - vgacon_set_cursor_size(c->state.x, 1, - c->vc_cell_height); + vgacon_set_cursor_size(1, c->vc_cell_height); break; } break; From patchwork Wed Jul 12 08:59:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiri Slaby \(SUSE\)" X-Patchwork-Id: 703013 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 56A81C0015E for ; Wed, 12 Jul 2023 09:01:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233163AbjGLJB4 (ORCPT ); Wed, 12 Jul 2023 05:01:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232487AbjGLJBL (ORCPT ); Wed, 12 Jul 2023 05:01:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14F451BFB; Wed, 12 Jul 2023 01:59:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A6D24616E6; Wed, 12 Jul 2023 08:59:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E6DBC433C9; Wed, 12 Jul 2023 08:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689152394; bh=BR+iCpSuQ7vxUhB+UPskQqo1D8fyS+p3rbke57h/srY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=koAZdbFhYit8+IZ+/sRyA0ny8Ba4SKLjFvY3BBuxstMtA/AsdoJZJ6Pjrr6IdRc9S Q4ZDSiDq12k8y1EjsHEA3nHJaNHxSRlSMpqkkpyceqFYmU+4MMt2y0iQBNsoYLenYZ nMqrdNFAYDH7199G/Z9c6owb80OAR5qI+T2D74HnAzwUc1f7ZNtIzoOZeAMwDc32VB hTyCX2R7tDYpBvMfmhQ3b4VHFeoKvasKZSmyNYEF6XDvCbb/Tk8cGX9x+Xn5/K77Iq CZcV6wTzt3WVjpHsgTJJkW8IOpEQv/JxMuxJysuffxhSffvDhZKXAClzW+S0DKaFMo kfcugQulRuodg== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Helge Deller , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 4/7] vgacon: let vgacon_doresize() return void Date: Wed, 12 Jul 2023 10:59:39 +0200 Message-ID: <20230712085942.5064-5-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712085942.5064-1-jirislaby@kernel.org> References: <20230712085942.5064-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org The return value is neither used, nor vgacon_doresize() returns an error. So change the reurn type to void. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/console/vgacon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 7cb15851ea56..07f6b97d9b81 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -528,7 +528,7 @@ static void vgacon_cursor(struct vc_data *c, int mode) } } -static int vgacon_doresize(struct vc_data *c, +static void vgacon_doresize(struct vc_data *c, unsigned int width, unsigned int height) { unsigned long flags; @@ -587,7 +587,6 @@ static int vgacon_doresize(struct vc_data *c, } raw_spin_unlock_irqrestore(&vga_lock, flags); - return 0; } static int vgacon_switch(struct vc_data *c) From patchwork Wed Jul 12 08:59:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiri Slaby \(SUSE\)" X-Patchwork-Id: 702062 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 86DFAC001E0 for ; Wed, 12 Jul 2023 09:01:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232358AbjGLJB4 (ORCPT ); Wed, 12 Jul 2023 05:01:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232797AbjGLJBM (ORCPT ); Wed, 12 Jul 2023 05:01:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22B0A1FC7; Wed, 12 Jul 2023 01:59:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ABD6461692; Wed, 12 Jul 2023 08:59:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84C65C433C8; Wed, 12 Jul 2023 08:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689152396; bh=WoUf830Zm0iN5qyrpb30ESZNjMmnQje4FUkAR6uGtdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=trQ08FqHOyD5Z1cgklZi4TfvnqReS13ncg5YYAwZCaLOlEeXiPBI/XYXff7S365oX /2SZOkku7ilhfoTmX2UqYDvC/9UuoyjeBjvnb6PYvZzJXv5WLMEc7cOvF8Pn/vJVgh J7gxKWBGqIYMb/7RmI2WQD1VYwU3uIs2NJcs9z668EqLeTA1mg/TqbTiubaDjdXlGw zbZ8Nxo0dzz+NrEZIfdmH4h8kvUqlB7E5ZMBK4bsGXmn8QBCLOogmmNt2SL3thCMnd cEHXKDTi4+2lJyLnx5XAzySUNeCfSjOKv56/kkdLX+9LSHeYk18p6ZWFlEScHz2pOE xL8gvvM15Pydw== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Helge Deller , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 5/7] vgacon: cache vc_cell_height in vgacon_cursor() Date: Wed, 12 Jul 2023 10:59:40 +0200 Message-ID: <20230712085942.5064-6-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712085942.5064-1-jirislaby@kernel.org> References: <20230712085942.5064-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org There are many places c->vc_cell_height is used in the code of vgacon_cursor(). Caching the value to a local variable makes the code much easier to follow. Signed-off-by: Jiri Slaby (SUSE) Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/console/vgacon.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 07f6b97d9b81..7ad047bcae17 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -470,11 +470,15 @@ static void vgacon_set_cursor_size(int from, int to) static void vgacon_cursor(struct vc_data *c, int mode) { + unsigned int c_height; + if (c->vc_mode != KD_TEXT) return; vgacon_restore_screen(c); + c_height = c->vc_cell_height; + switch (mode) { case CM_ERASE: write_vga(14, (c->vc_pos - vga_vram_base) / 2); @@ -489,30 +493,22 @@ static void vgacon_cursor(struct vc_data *c, int mode) write_vga(14, (c->vc_pos - vga_vram_base) / 2); switch (CUR_SIZE(c->vc_cursor_type)) { case CUR_UNDERLINE: - vgacon_set_cursor_size(c->vc_cell_height - - (c->vc_cell_height < - 10 ? 2 : 3), - c->vc_cell_height - - (c->vc_cell_height < - 10 ? 1 : 2)); + vgacon_set_cursor_size(c_height - + (c_height < 10 ? 2 : 3), + c_height - + (c_height < 10 ? 1 : 2)); break; case CUR_TWO_THIRDS: - vgacon_set_cursor_size(c->vc_cell_height / 3, - c->vc_cell_height - - (c->vc_cell_height < - 10 ? 1 : 2)); + vgacon_set_cursor_size(c_height / 3, c_height - + (c_height < 10 ? 1 : 2)); break; case CUR_LOWER_THIRD: - vgacon_set_cursor_size((c->vc_cell_height * 2) / 3, - c->vc_cell_height - - (c->vc_cell_height < - 10 ? 1 : 2)); + vgacon_set_cursor_size(c_height * 2 / 3, c_height - + (c_height < 10 ? 1 : 2)); break; case CUR_LOWER_HALF: - vgacon_set_cursor_size(c->vc_cell_height / 2, - c->vc_cell_height - - (c->vc_cell_height < - 10 ? 1 : 2)); + vgacon_set_cursor_size(c_height / 2, c_height - + (c_height < 10 ? 1 : 2)); break; case CUR_NONE: if (vga_video_type >= VIDEO_TYPE_VGAC) @@ -521,7 +517,7 @@ static void vgacon_cursor(struct vc_data *c, int mode) vgacon_set_cursor_size(31, 31); break; default: - vgacon_set_cursor_size(1, c->vc_cell_height); + vgacon_set_cursor_size(1, c_height); break; } break; From patchwork Wed Jul 12 08:59:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiri Slaby \(SUSE\)" X-Patchwork-Id: 703012 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 C6A63C001DD for ; Wed, 12 Jul 2023 09:02:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233182AbjGLJB7 (ORCPT ); Wed, 12 Jul 2023 05:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232864AbjGLJBN (ORCPT ); Wed, 12 Jul 2023 05:01:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7874F1FD0; Wed, 12 Jul 2023 01:59:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 16BE76136E; Wed, 12 Jul 2023 08:59:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B1D4C433CA; Wed, 12 Jul 2023 08:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689152398; bh=dHPCHVX5jXhsmqWKcupWpEroamx0nsRcT9eKa1LG5Bc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hOdp4UoljHDbg7qHuVn4uvkr4vwOWaps7m1PG47MUZEhpkvgm9ERVX3CrkdZUZTwh 7d0FyFG7Rr6vV9j+p1rfaiZNuKrflYY4Z0apHC1MXmyzh07FlV4pc/KQPkOEdCF56h C8LietlB8P6r2lzOnyHNpHNn6Lxy+TEB0SgrwShCI64tqK1gfUG8LuMlfKfs5J8HyK F5/OKUfkTi/WIJPaTJPpwrvMI0rt3ttZ0XfmhLqBiSs2Y2KRsLt+f3LWGV1iwswr5u xvGMx7mKof29qlzUxEbDdQQuWot3XsMNCrHVqj8pSFgT4ByLBoOGIAXdhujT5ak3EA y2SX1/1ver5QA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 6/7] sticon: make sticon_set_def_font() void and remove op parameter Date: Wed, 12 Jul 2023 10:59:41 +0200 Message-ID: <20230712085942.5064-7-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712085942.5064-1-jirislaby@kernel.org> References: <20230712085942.5064-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org sticon_set_def_font() always returns 0, so make it void. And remove an unused 'op' parameter. Signed-off-by: Jiri Slaby (SUSE) Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/console/sticon.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c index d11cfd2d68b5..992a4fa431aa 100644 --- a/drivers/video/console/sticon.c +++ b/drivers/video/console/sticon.c @@ -156,7 +156,7 @@ static bool sticon_scroll(struct vc_data *conp, unsigned int t, return false; } -static int sticon_set_def_font(int unit, struct console_font *op) +static void sticon_set_def_font(int unit) { if (font_data[unit] != STI_DEF_FONT) { if (--FNTREFCOUNT(font_data[unit]) == 0) { @@ -165,8 +165,6 @@ static int sticon_set_def_font(int unit, struct console_font *op) } font_data[unit] = STI_DEF_FONT; } - - return 0; } static int sticon_set_font(struct vc_data *vc, struct console_font *op, @@ -246,7 +244,7 @@ static int sticon_set_font(struct vc_data *vc, struct console_font *op, vc->vc_video_erase_char, font_data[vc->vc_num]); /* delete old font in case it is a user font */ - sticon_set_def_font(unit, NULL); + sticon_set_def_font(unit); FNTREFCOUNT(cooked_font)++; font_data[unit] = cooked_font; @@ -264,7 +262,9 @@ static int sticon_set_font(struct vc_data *vc, struct console_font *op, static int sticon_font_default(struct vc_data *vc, struct console_font *op, char *name) { - return sticon_set_def_font(vc->vc_num, op); + sticon_set_def_font(vc->vc_num); + + return 0; } static int sticon_font_set(struct vc_data *vc, struct console_font *font, @@ -297,7 +297,7 @@ static void sticon_deinit(struct vc_data *c) /* free memory used by user font */ for (i = 0; i < MAX_NR_CONSOLES; i++) - sticon_set_def_font(i, NULL); + sticon_set_def_font(i); } static void sticon_clear(struct vc_data *conp, int sy, int sx, int height, From patchwork Wed Jul 12 08:59:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiri Slaby \(SUSE\)" X-Patchwork-Id: 702061 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 414C8C0015E for ; Wed, 12 Jul 2023 09:02:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231475AbjGLJCA (ORCPT ); Wed, 12 Jul 2023 05:02:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231975AbjGLJBQ (ORCPT ); Wed, 12 Jul 2023 05:01:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B42B11FD7; Wed, 12 Jul 2023 02:00:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 49194616E6; Wed, 12 Jul 2023 09:00:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9915C433C8; Wed, 12 Jul 2023 08:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689152400; bh=mNSmd92ZbJuvcNP8ky3SAI3dF+kkSfKu6xhDOjjQyVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BIErQfDNd6hkpyWfmBW4uEcGcSNLp/ChKU7PdzP7y7na/eUC9caCwHHtotfeZnMWQ dYaHnwx3flEeWuqvNVylpyw2wL34YQacPH7yB/8iWZQhKx9n03V2gOzcrBGfPW6nGy 9tHgH+dQIfFO/FyYCyhlERdElrfmhgPWPB6vglfz+WCDU6a9FcKnODZR0O66G4QZdD 3MvHDvSa75tXCPjgd4fOeB4R0/4ys9yE6HvMNWuxuWNdIjJXUwVRy+LPFFq7iNOwMR 91vYJDGDOXKt0TlnW2yewBZFKyGRFZ+pvwp3lYM+OK65Icb0M/ymv6PlCj9FzqgCT8 YPh7cgAwKWuhw== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Daniel Vetter , Helge Deller , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 7/7] fbcon: remove unused display (p) from fbcon_redraw() Date: Wed, 12 Jul 2023 10:59:42 +0200 Message-ID: <20230712085942.5064-8-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712085942.5064-1-jirislaby@kernel.org> References: <20230712085942.5064-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org The parameter is unused. Signed-off-by: Jiri Slaby (SUSE) Cc: Daniel Vetter Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/fbdev/core/fbcon.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index c6c9d040bdec..887fad44e7ec 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -1612,8 +1612,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info, } } -static void fbcon_redraw(struct vc_data *vc, struct fbcon_display *p, - int line, int count, int offset) +static void fbcon_redraw(struct vc_data *vc, int line, int count, int offset) { unsigned short *d = (unsigned short *) (vc->vc_origin + vc->vc_size_row * line); @@ -1827,7 +1826,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b, case SCROLL_REDRAW: redraw_up: - fbcon_redraw(vc, p, t, b - t - count, + fbcon_redraw(vc, t, b - t - count, count * vc->vc_cols); fbcon_clear(vc, b - count, 0, count, vc->vc_cols); scr_memsetw((unsigned short *) (vc->vc_origin + @@ -1913,7 +1912,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b, case SCROLL_REDRAW: redraw_down: - fbcon_redraw(vc, p, b - 1, b - t - count, + fbcon_redraw(vc, b - 1, b - t - count, -count * vc->vc_cols); fbcon_clear(vc, t, 0, count, vc->vc_cols); scr_memsetw((unsigned short *) (vc->vc_origin +