From patchwork Tue Jan 20 23:17:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1696 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=1768951220; bh=U8EFa3iWw+VgnFyUdZMbRu0cBkiWB6604K52Y7i8QK8=; 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=B+GjM8shBL5QGh8moAa+dhb5T2Kwej4I68gvr3y0z8j7LATKxhO6le+KtbFJwmzF0 8YewTlTAiWeGcdgKHMbTYEYNdQc5Aau7TCdI2XHxkLBu7LRHrV7yOyy/dxqIM0s1fo XDCphDST9jNKXTfIQv1PIg3OXi7Mwj1306JMuGoz9sQcYFZxOVoE6Ups5wYaBhrSXo xhBwVAW+Yhc7zJ/VVcjXXttsoGQp/IhygJQvEZm0YHoOkU3WP9CvswCyo7j7HnfuHw rrmB0aI9DFDe+r1MbpE0tH3xIX6X2mGVrZmC9ExPEKLg++bvaed34F2dyrN7iLp3G6 6fvbJCCeqXtBQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 65456695A0 for ; Tue, 20 Jan 2026 16:20:20 -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 pCR0G-lBGeA8 for ; Tue, 20 Jan 2026 16:20:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951219; bh=U8EFa3iWw+VgnFyUdZMbRu0cBkiWB6604K52Y7i8QK8=; 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=mapK2VqJEwrK8zs3sq34pmk/+L7P37/OWYMMjy2Avvnp72M+6piJC581qDtYSSuZI gkpoLuzrnwf987YZNlGNDfoAx1QGbzyNPNJ86yb8WhrSIM9zdCTyWTffpK08KWfSu7 uFbQRFrmE6DFl9qdEUqqHO4vRXHODeDOOSxMNP0DHT6HLLXexiF4nYAhuVvphA8LEZ /1WJrpYIPSnjKTiM9SZeEzuMvf4xuMNcLBSnOtzq2BirUYErQRYhkyH5nTC10j+n9a rn2FV8CWS80m+2xn/IFy3A3lS1/Q/ZQC2Sfs24wBXfPmrAvzYZ09hfJ1fkbYOAWDD0 3WFAa6pa8xsmA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5EB76693E3 for ; Tue, 20 Jan 2026 16:20:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951217; bh=cr41DeUE3ykdhkVMMgUZfjdnelW1PtiwpYGl8pl50uE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e1F8l83KfHPu539u4FnM2BRF3xCBcNxn2Hy6rotkGkTT+c6pq28H5Yd4Ujj1NfcPd hGpE4hJ+SoMZh829O6Y/3EKBt4SDuozPveFS/edJ8jXTIxIPTkjFIDsZ7vDrg7Q+5a bVTzWluZioeU51sMjFfxIgtezjhnPrHG6M6qHFKhtbqTHj+Oh5Y0Ur1pzPWhIyGkEv M1IPCYi3wjSuk1GJ27m1dCCN3ON2shDOwcOR8jD+28EOktsfm/9H9CvZ51OToW0KFK 1xQbv8FFfHgrl68Lh1LDDLGyke+C2S4gDezEbb/kvt8kSk+CHDYJN7krbgBgsRtXeA J+e8cUfQGfG+w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 932AD693E3; Tue, 20 Jan 2026 16:20:17 -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 fQvQDTPcNeIh; Tue, 20 Jan 2026 16:20:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951217; bh=iwAQr/SL6gJbm0fQDRnYwwz/omYFIuGEXrVUtiUAP7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P6oK1RZXCznUPSn1RbdS4/Zx0CNDWBy/90SN0sKkaIukIlUosk5SxKXke4bobIjYH leYiYY5LH1oREZ2h6hhTtL1ib/NSyfznnZw99y9sOoamTzXiv/RptHqdqeebL5TOug SOg08bNVhHwHyQPcui65syqWSH70F0NTVn+PM9hI+aCNYSGs8z14uIkmiHqWdXiPmh Nq/ab5keMio6MRuiLIV+Zi4oQsO0q+Dpmsv7fUmcxZIdAE5H/fckvZG7sLhyV1uGLu sRbmBcaiRjtn5eOthR7o+7kdQA4OyyjNeXffFw+qLTF7pA45VAyp6I/7ognyllmaYA jWaUHud1SZKug== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 01EED6913F; Tue, 20 Jan 2026 16:20:16 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 20 Jan 2026 16:17:50 -0700 Message-ID: <20260120231814.2033069-24-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120231814.2033069-1-sjg@u-boot.org> References: <20260120231814.2033069-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: XHLSOIVUNW3TFXDO2UFVLF4HBBGS4UVK X-Message-ID-Hash: XHLSOIVUNW3TFXDO2UFVLF4HBBGS4UVK 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 23/36] video: Pass context to console_alloc_cursor() 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 Update console_alloc_cursor() to take a context parameter so it can allocate cursor memory for a specific context rather than always using the default. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- drivers/video/console_core.c | 7 ++----- drivers/video/console_truetype.c | 2 +- drivers/video/vidconsole_internal.h | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/video/console_core.c b/drivers/video/console_core.c index 5cb1b3fb2b7..dba47af4eb5 100644 --- a/drivers/video/console_core.c +++ b/drivers/video/console_core.c @@ -278,9 +278,8 @@ int cursor_hide(struct vidconsole_cursor *curs, struct video_priv *vid_priv, return 0; } -int console_alloc_cursor(struct udevice *dev) +int console_alloc_cursor(struct udevice *dev, struct vidconsole_ctx *ctx) { - struct vidconsole_ctx *ctx; struct vidconsole_cursor *curs; struct video_priv *vid_priv; struct udevice *vid; @@ -288,8 +287,6 @@ int console_alloc_cursor(struct udevice *dev) if (!CONFIG_IS_ENABLED(CURSOR) || xpl_phase() < PHASE_BOARD_R) return 0; - - ctx = vidconsole_ctx(dev); vid = dev_get_parent(dev); vid_priv = dev_get_uclass_priv(vid); curs = &ctx->curs; @@ -312,7 +309,7 @@ int console_probe(struct udevice *dev) return ret; if (CONFIG_IS_ENABLED(CURSOR) && xpl_phase() == PHASE_BOARD_R) { - ret = console_alloc_cursor(dev); + ret = console_alloc_cursor(dev, vidconsole_ctx(dev)); if (ret) return ret; } diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 4dd382055b2..9b835437031 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -1301,7 +1301,7 @@ static int console_truetype_probe(struct udevice *dev) debug("%s: ready\n", __func__); - ret = console_alloc_cursor(dev); + ret = console_alloc_cursor(dev, &ctx->com); if (ret) return ret; diff --git a/drivers/video/vidconsole_internal.h b/drivers/video/vidconsole_internal.h index e1e89f6524a..60ff7bed758 100644 --- a/drivers/video/vidconsole_internal.h +++ b/drivers/video/vidconsole_internal.h @@ -152,9 +152,10 @@ int cursor_hide(struct vidconsole_cursor *curs, struct video_priv *vid_priv, * Allocates memory for saving pixels under the cursor * * @dev: vidconsole device + * @ctx: vidconsole context * Return: 0 if success, -ENOMEM if allocation fails */ -int console_alloc_cursor(struct udevice *dev); +int console_alloc_cursor(struct udevice *dev, struct vidconsole_ctx *ctx); /** * console probe function.