From: Max Pedraza <maximpedraza@gmail.com>
To: Helge Deller <deller@gmx.de>
Cc: "Geert Uytterhoeven" <geert@linux-m68k.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Maxime Ripard" <mripard@kernel.org>,
"Uwe Kleine-König" <ukleinek@kernel.org>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
"Max Pedraza" <maximpedraza@gmail.com>
Subject: [PATCH v2 0/6] Boot logo supplied by the device tree
Date: Wed, 5 Aug 2026 00:56:11 +0200 [thread overview]
Message-ID: <20260804225617.264861-1-maximpedraza@gmail.com> (raw)
This series lets the logo be described by the device tree instead: a node
compatible with "linux,boot-logo-clut224" under /chosen supplies the image in
the same paletted format the built-in CLUT224 logos already use, and the kernel
prefers it over the built-in ones when it is present and enabled. If the
node is absent or disabled, nothing changes.
The image can come from the node itself (patches 1-2) or from a reserved
memory region the bootloader filled in (patches 4-5), because the image and
its placement are independent axes of variation. One board sold to several
customers wants several device trees differing in the logo. One customer
with several products built on that board, with different panels, wants the
same logo placed differently on each: there the image belongs in a shared
binary and only the placement belongs in the device tree. Patch 3 adds that
placement.
We have been carrying a cruder version of this downstream on an AM335x
product since 2020, across a handful of board revisions, and it has removed
a real maintenance burden for us. This is an attempt to find out whether
something along these lines is wanted upstream, and if so in what shape --
hence RFC.
The v1 discussion turned on the obvious objection, that a bitmap is not
hardware and the device tree is not where it belongs. Geert pointed out that
configuration which is not hardware description goes under /chosen, and that
Open Firmware, which the device tree descends from, already carried a boot
logo in that spirit as the oem-logo variable under /options. The node has
moved to /chosen accordingly, which is also where simple-framebuffer nodes
live, for the same reason: they describe what firmware handed over rather
than what the hardware is.
Patches 4 and 5 are separable; the series is useful without them if the
reserved memory path is thought to be one mechanism too many.
Not included, though it exists in our downstream version: a hook in
drm_fb_helper so the logo is drawn when CONFIG_FRAMEBUFFER_CONSOLE is
disabled, which is the common case for a product that only wants a splash
screen. Today fb_show_logo() is reached from fbcon alone. That is a DRM
question rather than an fbdev one and deserves a separate posting.
Notes on the binding:
- The palette size is derived from the length of the "clut" property
instead of being a separate property, so it cannot disagree with the
palette actually supplied.
- "data" holds plain palette indices. The 32 entry offset the frame
buffer layer reserves for the console is an implementation detail and
is applied by the kernel.
- "logo-position" and "logo-offset" are spelled with the prefix because
plain "position" and "offset" are already used elsewhere in the tree
with an incompatible type, which dtschema rejects.
- "logo-centered" overlaps with the existing fb_center_logo, but it is
per device tree rather than per fbcon command line, and it composes
with "logo-offset". That combination is what panels with a partially
visible area need, where the usable region is not the centre of the
mode; the hardware this came from is an 800x480 panel of which only the
bottom 320 rows are visible.
- The reserved memory path takes a "memory-region" phandle rather than a
bare address. The reservation is what makes the memory safe to read at
all, and it is what gives the kernel a size to bounds check against.
The byte arrays are not written by hand: patch 6 adds ppmtodtlogo, a host
tool along the lines of the existing pnmtologo -- plain C, no dependencies,
no quantization of its own -- that turns a PPM image into the node or into
the memory region blob. It is what produced everything tested below.
Testing: build tested for arm with CONFIG_LOGO_DT_CLUT224 both enabled and
disabled, W=1 clean, checkpatch --strict clean, dt_binding_check clean. The
schema was also checked against deliberately malformed nodes, including
supplying both image sources at once and neither.
Boot tested under qemu-system-arm -M versatilepb with PL111 and fbcon, at
16bpp, both ways round. A 160x120 logo placed with "logo-centered" plus a
"logo-offset" of <0 120> lands at exactly the expected coordinates, and every
pixel matches the source image once the source is truncated to RGB565.
Supplying the same image through a reserved region instead produces a screen
whose logo area is identical. Blobs with a bad magic, a geometry larger than
the reservation and an out of range pixel are each rejected with a warning
and fall back to the built-in logo, with no crash.
That boot test earned its keep: the first version of patch 3 drew the logo
correctly and then had it erased, because fb_prepare_logo() still reserved
only the logo's own height while the logo itself had been moved further
down. Nothing in the build or the static checks catches that.
Also boot tested on real hardware with this exact tree: an AM335x board
(tilcdc) with an 800x480 panel, running the master this series is based on.
The product logo comes up where expected both ways, carried in the device
tree and taken from a bootloader-loaded reserved memory region, with the node
under /chosen and nothing reported in either case. That system
builds without CONFIG_FRAMEBUFFER_CONSOLE, so the drawing there goes through
the separate drm_fb_helper hook mentioned above as not included; the parsing,
validation and placement exercised are those of this series.
Changes since v1:
- Rebased onto Linus' master; v1 was based on the v6.19.14 stable release
and did not apply anywhere useful. Sorry for the noise.
- The node moved under /chosen, per Geert's observation that this is where
non-hardware configuration belongs. The binding and the tool follow.
- The binding notes that a product logo is normally covered by trademark or
copyright of its owner and that such a device tree is expected to be kept
with the product, after Ulrich raised the licensing angle.
- Dropped the second binding example: with the node under /chosen both
examples define /chosen/logo and dtc merges them, which then fails the
oneOf. The reserved memory form is documented on the property itself.
Max Pedraza (6):
dt-bindings: display: add a device tree supplied boot logo
video: logo: allow the boot logo to come from the device tree
fbdev: honour the device tree boot logo placement properties
dt-bindings: display: allow the boot logo in a reserved memory region
video: logo: allow the boot logo to come from a reserved memory region
video: logo: add ppmtodtlogo host tool
.../display/linux,boot-logo-clut224.yaml | 152 +++++++
MAINTAINERS | 1 +
drivers/video/fbdev/core/fb_logo.c | 174 ++++++++
drivers/video/logo/Kconfig | 13 +
drivers/video/logo/Makefile | 6 +-
drivers/video/logo/logo.c | 256 +++++++++++
drivers/video/logo/ppmtodtlogo.c | 402 ++++++++++++++++++
7 files changed, 1003 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/display/linux,boot-logo-clut224.yaml
create mode 100644 drivers/video/logo/ppmtodtlogo.c
--
2.39.5
next reply other threads:[~2026-08-04 20:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 22:56 Max Pedraza [this message]
2026-08-04 22:56 ` [PATCH v2 1/6] dt-bindings: display: add a device tree supplied boot logo Max Pedraza
2026-08-04 21:01 ` sashiko-bot
[not found] ` <204c2805-346d-4935-8e2e-1538b79ea995@gmx.de>
2026-08-05 0:15 ` Màxim Pedraza Padilla
2026-08-05 0:36 ` Rob Herring (Arm)
2026-08-06 1:20 ` Màxim Pedraza Padilla
2026-08-04 22:56 ` [PATCH v2 2/6] video: logo: allow the boot logo to come from the device tree Max Pedraza
2026-08-04 21:09 ` sashiko-bot
2026-08-04 22:56 ` [PATCH v2 3/6] fbdev: honour the device tree boot logo placement properties Max Pedraza
2026-08-04 21:07 ` sashiko-bot
2026-08-04 22:56 ` [PATCH v2 4/6] dt-bindings: display: allow the boot logo in a reserved memory region Max Pedraza
2026-08-04 21:08 ` sashiko-bot
2026-08-04 22:56 ` [PATCH v2 5/6] video: logo: allow the boot logo to come from " Max Pedraza
2026-08-04 22:56 ` [PATCH v2 6/6] video: logo: add ppmtodtlogo host tool Max Pedraza
2026-08-05 14:09 ` [PATCH v2 0/6] Boot logo supplied by the device tree Rob Herring
2026-08-06 1:29 ` Màxim Pedraza Padilla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804225617.264861-1-maximpedraza@gmail.com \
--to=maximpedraza@gmail.com \
--cc=conor+dt@kernel.org \
--cc=deller@gmx.de \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
--cc=krzk+dt@kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=robh@kernel.org \
--cc=tzimmermann@suse.de \
--cc=ukleinek@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox