From patchwork Sat Jan 17 00:56:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 103 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=1768611436; bh=WayXoTm66sp75Saf4xr5r9qANyLcs7uOt6JW4f5K7hQ=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=uT+GmsK3SseeRtOrbELEJUEt0oxE4fd2o3J8rygZrBOxL7wOD4QGRo/KrqWx3KUks vY36Ogq7uBJx5Ir/+6j1pcDCGlh79yQJ7mJ3LnK/1MNCrO2E/vuwXLfw2si43gJYyS /Es2j6noH8mn+80rDeqU6+7EYeplFZnpZjiOkjNVLl+/PFV2geAe9VpSQ5jpLgj0ys W4peiLw+OVYUQOopx2uGl0owUKw8XJedvNBQP9PmFpDGN80Ys4kEXVB/S1QQrlPhb/ RaHcicPXVtT9NNk5XsWcwL8Fgpggvs4ZThDR43ceF01LIG8yFmHj+JcrfHClEBPLgg DlOYX6MakHTJg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 226F5693E0 for ; Fri, 16 Jan 2026 17:57:16 -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 vu2cAC6E7cIH for ; Fri, 16 Jan 2026 17:57:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611436; bh=WayXoTm66sp75Saf4xr5r9qANyLcs7uOt6JW4f5K7hQ=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=uT+GmsK3SseeRtOrbELEJUEt0oxE4fd2o3J8rygZrBOxL7wOD4QGRo/KrqWx3KUks vY36Ogq7uBJx5Ir/+6j1pcDCGlh79yQJ7mJ3LnK/1MNCrO2E/vuwXLfw2si43gJYyS /Es2j6noH8mn+80rDeqU6+7EYeplFZnpZjiOkjNVLl+/PFV2geAe9VpSQ5jpLgj0ys W4peiLw+OVYUQOopx2uGl0owUKw8XJedvNBQP9PmFpDGN80Ys4kEXVB/S1QQrlPhb/ RaHcicPXVtT9NNk5XsWcwL8Fgpggvs4ZThDR43ceF01LIG8yFmHj+JcrfHClEBPLgg DlOYX6MakHTJg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0FE77693B1 for ; Fri, 16 Jan 2026 17:57:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611434; bh=LCNLNo5527YRFQaAp0qFcpYZXve8WGOIDVuc/lOYQ5A=; h=From:To:Cc:Subject:Date:From; b=kPqLb9DKJ7dOQKAwODgfWnU0odnY3qna/cPFItpZse9nz6RMcF2vMAc1PxdUPlGCD n4NN/OxAgCu/JuJzH9QQCP14SHRoCB+W7/YjBtrVFGENH3o/foGWOlRAC6+DbeOiJC VZsa9pCBAPXQsUGEcstF3mw+ItY786Spy/nCYxFzV9d479c+j31oH7Xn7skx0DjPd7 NykzJ91a/JnqlKPRkG+Q/LzgkU3E+VFntPTnuB9GSmRn8YUkqyv8ZWAUhZ3hRoHhUQ di3Jxg2/wMka6ThP8bab74RNmf0mJJnO61PyspuEjH1MfN/fDnf8FTCBWfijIwNTs1 QDzlbapgZap6w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 07069693B1; Fri, 16 Jan 2026 17:57:14 -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 08JRKcydI0jT; Fri, 16 Jan 2026 17:57:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611429; bh=yNyH3z1C4XuDD9H5khdWnDtXKTeSQoOnNZFwRdjGj5s=; h=From:To:Cc:Subject:Date:From; b=GMsk4fdI8U9Yn1i4IEJwfqjx+K3iypS7BZAK+7HMb9urGK/wiPnMY9ijzYggKiWca uBpRm5dzxf1OqnUDWfF7yPsJ64fbfEr2Z9Jlrdx1tlUGNXW5sUZnUSSSqrRE7Unkve 5uu7lw4eSZaZOtQC6oEPZjibPM3Fjt5DIpb4RU8zwvQtwXcyNsSABAk6i4wtshhepZ ncoABN4j3omaMYij6t3ixYGV6GLvhsBJ+3tJZ0WcI1+Taow4CTTV/T81hHgaO5rUb3 HxySN55BPDVOOHPes5J2BJ7wAoFtEkf6piSK6qrMIF2fhewgIWrdH7Udg/O4jTgn3U N4vCMQT7xo1Gg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B0FE169341; Fri, 16 Jan 2026 17:57:09 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 16 Jan 2026 17:56:38 -0700 Message-ID: <20260117005702.1684841-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: ZB5VWY4BSUSYHNYJGB3OVSOCATEUHC2T X-Message-ID-Hash: ZB5VWY4BSUSYHNYJGB3OVSOCATEUHC2T 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 00/18] Refactor vidconsole context for dynamic allocation 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 This series refactors the vidconsole subsystem to support dynamic context allocation. This is groundwork for allowing multiple independent contexts per vidconsole device, which will enable each expo textline to have its own context without needing save/restore logic. The main changes are: 1. Move fields from vidconsole_priv into vidconsole_ctx (patches 2-5) - curs, xstart_frac, tab_width_frac, xsize_frac - This consolidates per-context state into a single structure 2. Add infrastructure for dynamic context allocation (patches 8-10) - Add vidconsole_uc_plat with ctx_size for per-driver context sizes - Implement vidconsole_ctx_new/dispose for context lifecycle - Allocate vidconsole_ctx dynamically using ctx_size 3. Clean up truetype driver (patches 1, 11-12) - Rename vc_ctx to com for consistency - Remove embedded ctx from console_tt_priv - Use consistent ctx/com pattern throughout 4. Move truetype-specific fields to console_tt_ctx (patches 13-14) - cur_met, cur_fontdata now in console_tt_ctx - These are per-context rather than per-device 5. Simplify save/restore (patches 15-17) - Remove redundant store.cur field - Remove console_tt_store and console_store structs - Save/restore entire context directly 6. Add tests (patch 18) - Add dm_test_video_entry_save() for bitmap fonts - Add dm_test_video_entry_save_tt() for truetype fonts The next step (not in this series) is to add a ctx parameter to driver methods like putc_xy(), allowing callers to specify which context to use. This will enable expo textlines to each maintain their own cursor position and state. Simon Glass (18): video: truetype: Rename vc_ctx to com video: Move curs into vidconsole_ctx video: Move xstart_frac into vidconsole_ctx video: Move tab_width_frac into vidconsole_ctx video: Move xsize_frac into vidconsole_ctx video: Use vidconsole_ctx_from_priv() in expo_test video: Update cli_index_adjust() to use vidconsole_ctx video: Add vidconsole_uc_plat for per-device platform data video: Set ctx_size in console_truetype driver video: Allocate vidconsole_ctx dynamically using ctx_size video: truetype: Remove ctx from console_tt_priv video: truetype: Use consistent ctx/com pattern video: Move cur_met to console_tt_ctx video: Move cur_fontdata to console_tt_ctx video: truetype: Remove redundant store.cur field video: truetype: Remove console_tt_store struct video: normal: Remove console_store struct video: Add test for entry save/restore board/atmel/common/video_display.c | 4 +- boot/expo_test.c | 12 +- drivers/video/console_core.c | 8 +- drivers/video/console_normal.c | 29 +--- drivers/video/console_rotate.c | 6 +- drivers/video/console_truetype.c | 221 ++++++++++++----------------- drivers/video/vidconsole-uclass.c | 73 ++++++---- include/video_console.h | 50 ++++--- test/dm/video.c | 70 ++++++++- 9 files changed, 260 insertions(+), 213 deletions(-)