Re: [PATCH RFC v4 02/13] efi: bgrt: export the BGRT table and image size

From: Jani Nikula

Date: Fri Oct 02 2026 - 05:40:28 EST


On Thu, 01 Oct 2026, Màxim Pedraza Padilla <maximpedraza@xxxxxxxxx> wrote:
> The DRM splash client reads the boot graphics the firmware left behind
> through bgrt_tab and bgrt_image_size. Built as part of drm_client_lib,
> which can be a module, it then fails to link:
>
> ERROR: modpost: drivers/gpu/drm/clients/drm_client_lib.ko: symbol 'bgrt_tab' undefined!
> ERROR: modpost: drivers/gpu/drm/clients/drm_client_lib.ko: symbol 'bgrt_image_size' undefined!
>
> Export both. They are filled in once, early in boot, and only read
> after that.
>
> Reported-by: Mario Limonciello <mario.limonciello@xxxxxxx>
> Closes: https://lore.kernel.org/dri-devel/5d7067de-97b7-4232-9cf6-e4b978696482@xxxxxxx/
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Màxim Pedraza Padilla <maximpedraza@xxxxxxxxx>
> ---
> drivers/firmware/efi/efi-bgrt.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/firmware/efi/efi-bgrt.c b/drivers/firmware/efi/efi-bgrt.c
> index 1da451582812..746a8fb3a337 100644
> --- a/drivers/firmware/efi/efi-bgrt.c
> +++ b/drivers/firmware/efi/efi-bgrt.c
> @@ -17,7 +17,10 @@
> #include <linux/efi-bgrt.h>
>
> struct acpi_table_bgrt bgrt_tab;
> +EXPORT_SYMBOL_GPL(bgrt_tab);
> +
> size_t bgrt_image_size;
> +EXPORT_SYMBOL_GPL(bgrt_image_size);

Data is not an interface.

If these will be used more, perhaps it would be better to wrap access to
them in functions? I think most of the time it will help with
maintenance.

And you can add stubs for CONFIG_ACPI_BGRT=n where they belong,
i.e. include/linux/efi-bgrt.h instead of drm_splash.c like in patch 11
of this series.


BR,
Jani.


>
> struct bmp_header {
> u16 id;

--
Jani Nikula, Intel