From patchwork Tue Jan 20 23:17:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1699 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=1768951234; bh=37kEozS83s7+0UN0uHV/qKZMrNS+tp7xWcnXbEXsj/w=; 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=VMCx4Tz8EMJdTXKiWSihowj1zS3UcEMGNmZImnB/M6zbq2Z/qR7OJGNo0i7W0Waf8 WH+0K8elahsH3ZjHSbIB/wZw+ReDiqz6G0Z/IGAVkLhGS1/RnM/yN9y9eOpO0zEtR6 VSgMEPy4TinsirV5vObCdwwaUwmZ+AMaFB6OIiTs+/WSq/MkSHPLXt45H1ddNBg4hN oNG7uMbh0Ea2YLUMhLVG2MNhi6oCHXIVBhYYJwhj8wSYUH6Ak2dil9HxcjsvUHJoFP pShLsfQabpEwx/b/8vtvYXj/C4qP53CgzAzOhjjdQducqhYAY0mO9ub8EJ52ec013/ YgOCepJ1PJU4Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CABE86959F for ; Tue, 20 Jan 2026 16:20:34 -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 Py-FcwOJ0nJO for ; Tue, 20 Jan 2026 16:20:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951234; bh=37kEozS83s7+0UN0uHV/qKZMrNS+tp7xWcnXbEXsj/w=; 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=VMCx4Tz8EMJdTXKiWSihowj1zS3UcEMGNmZImnB/M6zbq2Z/qR7OJGNo0i7W0Waf8 WH+0K8elahsH3ZjHSbIB/wZw+ReDiqz6G0Z/IGAVkLhGS1/RnM/yN9y9eOpO0zEtR6 VSgMEPy4TinsirV5vObCdwwaUwmZ+AMaFB6OIiTs+/WSq/MkSHPLXt45H1ddNBg4hN oNG7uMbh0Ea2YLUMhLVG2MNhi6oCHXIVBhYYJwhj8wSYUH6Ak2dil9HxcjsvUHJoFP pShLsfQabpEwx/b/8vtvYXj/C4qP53CgzAzOhjjdQducqhYAY0mO9ub8EJ52ec013/ YgOCepJ1PJU4Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B8A3069597 for ; Tue, 20 Jan 2026 16:20:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951232; bh=8c48OIqxHOflB9NIm9EaOAo6DPT4kcChmgCnM9eSOdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FPS1UhJiV4wHIjTDE6mwaFqitA40JBOmkFaAJ1bgJ3ITsiHy01gkB+DIzQrCMTNgr VqUP7d3jvQ2leYCfP3PQLc9EQScIcday9dTJ3QLdF8Yum3Jb+FzQ+wwIruzJdi/tlj LOzYScCQlFSNMnJdt4iv2IX6NHlj5VG3yQHxGe5nAe2dfCI4RqlNem3hm3x6TIHRK9 vKdf8LnosLjuUV7mj0bMjkAyVA2ZypCXTBk++kh4mS/dJZHSxz8qo/5pxxBa0P+jDP KC6LhB6mLnKWdEX97/xwGCxUUR8Z+jbQbIIZl/NtxPdDFY+pNOaLue0ivMZMNZVqKa xODLbsjCubecQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 850676959D; Tue, 20 Jan 2026 16:20: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 10026) with ESMTP id 6TSn-0sP9SqO; Tue, 20 Jan 2026 16:20:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951228; bh=DbBWfAOUiid/ScAFMFxjht3B2ejR+7u3XF5h4w5U9Xk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cJ79d3BQqcE9YnTyf704AyafU8ouuEBf1dAlNANf/JvjqHGbZPAjaqneSa2MkwjA/ i7NkdC4UyfMaKkAK1SAlTrIEzp5KRwoCP6to/7CMIak1aA2ogyiZ6v6YduH2tJpu0f ceONnikwCHFZTeKsUN9ACTmXiAVl28KMVo1cV3G+juEMQypskcfbxiZzST8CPP/YJ1 qCbXuf0ccUEdA5giEzNEkoEotzkb7LFSoFpcWJd6o7qb4clD3XBTXfJWP4Z+0FOZgt t5TsWt2DMX6SdlBY4i7M7bAJV1+KvzaRgwWLr+EaYrDucZ+cU5BzgOUBCYQepImMwk NPofSF8Sfb/VA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AD79369597; Tue, 20 Jan 2026 16:20:27 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 20 Jan 2026 16:17:53 -0700 Message-ID: <20260120231814.2033069-27-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: BBG5U2U3PAKTYB7UWSSZUZI5UYOLLDKC X-Message-ID-Hash: BBG5U2U3PAKTYB7UWSSZUZI5UYOLLDKC 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 26/36] video: Pass context to console_set_font() 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_set_font() to take a context parameter so it can set font properties for a specific context. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- drivers/video/console_core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/video/console_core.c b/drivers/video/console_core.c index ff5d9f5964a..483639e65c4 100644 --- a/drivers/video/console_core.c +++ b/drivers/video/console_core.c @@ -18,14 +18,16 @@ * console_set_font() - prepare vidconsole for chosen font. * * @dev vidconsole device + * @ctx vidconsole context * @fontdata pointer to font data struct */ -static int console_set_font(struct udevice *dev, struct video_fontdata *fontdata) +static int console_set_font(struct udevice *dev, struct vidconsole_ctx *ctx, + struct video_fontdata *fontdata) { struct console_simple_priv *priv = dev_get_priv(dev); priv->fontdata = fontdata; - vidconsole_set_bitmap_font(dev, vidconsole_ctx(dev), fontdata); + vidconsole_set_bitmap_font(dev, ctx, fontdata); return 0; } @@ -304,7 +306,7 @@ int console_probe(struct udevice *dev) { int ret; - ret = console_set_font(dev, fonts); + ret = console_set_font(dev, vidconsole_ctx(dev), fonts); if (ret) return ret; @@ -373,13 +375,13 @@ int console_simple_select_font(struct udevice *dev, void *ctx, const char *name, if (!name) { if (fonts->name) - console_set_font(dev, fonts); + console_set_font(dev, ctx, fonts); return 0; } for (font = fonts; font->name; font++) { if (!strcmp(name, font->name)) { - console_set_font(dev, font); + console_set_font(dev, ctx, font); return 0; } };