From patchwork Sat Jan 17 00:56:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1559 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611512; bh=gM0MimxwUaUYQTEnJbWD7/hcIGC/6upl2ses7GqTX3Y=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=kwyaLzQuDFBj3kToqBF3JUDl0el/gAlf0qpLAb1WmUWi8ZtoNOqmMvF9+MfAnEulj afRIY8e3M0FnnTE0Ns3MHOZFHgnJTOHaGmMVgkVmv0dxAzWjqBn75k4aTuYIpi7sNB 1pUd8QbJbVBbGWwbWKcJCo5GsCUBR9xn8jHJdpu1+NNrVB/49OPZai4Afcz5BCB3Wc mI5NHXkEHbvF0ZHyJZ33EJLMBqbmaVnoYcMeBHeyMncZyIDTK2r/QoXtoAt+zkC88w GWHD6Gjnfn38fcWX3bvBp4zM0Fxsmlcem/s5ka5TBiqBp3DVIbjSo+C/RV61Fn9pre +OAmJ0pl8pmew== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A2560693E9 for ; Fri, 16 Jan 2026 17:58:32 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id yYyKvaz_6lBN for ; Fri, 16 Jan 2026 17:58:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611512; bh=gM0MimxwUaUYQTEnJbWD7/hcIGC/6upl2ses7GqTX3Y=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=kwyaLzQuDFBj3kToqBF3JUDl0el/gAlf0qpLAb1WmUWi8ZtoNOqmMvF9+MfAnEulj afRIY8e3M0FnnTE0Ns3MHOZFHgnJTOHaGmMVgkVmv0dxAzWjqBn75k4aTuYIpi7sNB 1pUd8QbJbVBbGWwbWKcJCo5GsCUBR9xn8jHJdpu1+NNrVB/49OPZai4Afcz5BCB3Wc mI5NHXkEHbvF0ZHyJZ33EJLMBqbmaVnoYcMeBHeyMncZyIDTK2r/QoXtoAt+zkC88w GWHD6Gjnfn38fcWX3bvBp4zM0Fxsmlcem/s5ka5TBiqBp3DVIbjSo+C/RV61Fn9pre +OAmJ0pl8pmew== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8F005693E0 for ; Fri, 16 Jan 2026 17:58:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611510; bh=WIARj7uR8j0nzQbTocXKiuxGV/mnvFs8PE6BrZE8MzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cI869zwcugtBWw4fergELGvOLHJm3k2RPo5hdVr8mZMIhjfLpBnKtyyJZktYOBRWD jhzse3CcgbuBHlOgP9CZ/+Ubq+aMxNEnhI/BUxjshYHISP51754tWsfuyXXWOgdj+1 Krrjma+S9pCRcEJ1/MnKhTpTtK410jnofTKnee3pw2ZWUncoKNzF0/lg+7JPTHNBR/ mpxg96mYZLsa6nUj7PSsGc9zqlSXB7YG5+sqeUJ1IfTJHmQ1Z8AXS2EoYy1wpRkqRW RWBTBo6TpUwuvDpfF73Dfu5b9+yjS5vSLpuf8gxgUMsjyGEjgaQai/lS8gRoDUyVuV PHIW5CjvnAc7w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B07A1693D7; Fri, 16 Jan 2026 17:58:30 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id CLTh0l2G9l0K; Fri, 16 Jan 2026 17:58:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611506; bh=h7vFWhBEKc6esA2L+e8d1Q4xf4uZ5MHxhyRnxZ6xK8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VRxXzuUuBgXRkwsBP5RCfjahTW3yvoQ1sj5Hf6EEVe42W66SQ8llWCm9wTCvyIq/D 0an7MIyLkuuFAfQRLumL4gJFzxtc1gSvBWHnOd1CGfrTQV+a+ReVht62n1M6om24qd GwAgJWrKk4ZVdtOHhUSSql57AQabfhI2LJGVsFANjmgpPhAj5nmt0Jr0Vc2co89scE saHhTSwPlDP+k69eO6WKzlkmEwEllLfnVqPbA7o/qDN3xGp8NClFU9pxLEDO+gLlZz FtoMVO5cL6hhSlFzrRxjtR9Dt5SaI8vt6/DCmpQg1Ra68CiiC81yHiJeJQq8JGU5VB INQtAo5aq/ong== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 642A7693B1; Fri, 16 Jan 2026 17:58:26 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 16 Jan 2026 17:56:55 -0700 Message-ID: <20260117005702.1684841-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260117005702.1684841-1-sjg@u-boot.org> References: <20260117005702.1684841-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5JGY4WXJNM3LHLEVZD2F6WWC5YW5MAT5 X-Message-ID-Hash: 5JGY4WXJNM3LHLEVZD2F6WWC5YW5MAT5 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 17/18] video: normal: Remove console_store struct List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The console_store struct only saved a few fields from vidconsole_ctx. Since console_ctx contains vidconsole_ctx, save/restore the entire console_ctx directly instead. This is simpler and consistent with the truetype driver approach. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- drivers/video/console_normal.c | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c index 4854e953e58..fa9d496ef86 100644 --- a/drivers/video/console_normal.c +++ b/drivers/video/console_normal.c @@ -24,12 +24,6 @@ struct console_ctx { struct vidconsole_ctx com; }; -struct console_store { - int xpos_frac; - int ypos; - int cli_index; -}; - static int console_set_row(struct udevice *dev, uint row, int clr) { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); @@ -149,10 +143,8 @@ static __maybe_unused int console_get_cursor_info(struct udevice *dev) static __maybe_unused int normal_entry_save(struct udevice *dev, struct abuf *buf) { - struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); - struct vidconsole_ctx *ctx = vidconsole_ctx_from_priv(vc_priv); - struct console_store store; - const uint size = sizeof(store); + struct console_ctx *ctx = vidconsole_ctx(dev); + const uint size = sizeof(*ctx); if (xpl_phase() <= PHASE_SPL) return -ENOSYS; @@ -160,10 +152,7 @@ static __maybe_unused int normal_entry_save(struct udevice *dev, if (!abuf_realloc(buf, size)) return log_msg_ret("sav", -ENOMEM); - store.xpos_frac = ctx->xcur_frac; - store.ypos = ctx->ycur; - store.cli_index = ctx->cli_index; - memcpy(abuf_data(buf), &store, size); + memcpy(abuf_data(buf), ctx, size); return 0; } @@ -171,18 +160,12 @@ static __maybe_unused int normal_entry_save(struct udevice *dev, static __maybe_unused int normal_entry_restore(struct udevice *dev, struct abuf *buf) { - struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); - struct vidconsole_ctx *ctx = vidconsole_ctx_from_priv(vc_priv); - struct console_store store; + struct console_ctx *ctx = vidconsole_ctx(dev); if (xpl_phase() <= PHASE_SPL) return -ENOSYS; - memcpy(&store, abuf_data(buf), sizeof(store)); - - ctx->xcur_frac = store.xpos_frac; - ctx->ycur = store.ypos; - ctx->cli_index = store.cli_index; + memcpy(ctx, abuf_data(buf), sizeof(*ctx)); return 0; }