mirror of
https://github.com/torvalds/linux.git
synced 2026-04-19 23:34:00 -04:00
In the EFI config table, rename LINUX_EFI_SCREEN_INFO_TABLE_GUID to LINUX_EFI_PRIMARY_DISPLAY_TABLE_GUID. Read sysfb_primary_display from the entry. In addition to the screen_info, the entry now also contains EDID information. In libstub, replace struct screen_info with struct sysfb_display_info from the kernel's sysfb_primary_display and rename functions accordingly. Transfer it to the runtime kernel using the kernel's global state or the LINUX_EFI_PRIMARY_DISPLAY_TABLE_GUID config-table entry. With CONFIG_FIRMWARE_EDID=y, libstub now transfers the GOP device's EDID information to the kernel. If CONFIG_FIRMWARE_EDID=n, EDID information is disabled. Make the Kconfig symbol CONFIG_FIRMWARE_EDID available with EFI. Setting the value to 'n' disables EDID support. Also rename screen_info.c to primary_display.c and adapt the contained comment according to the changes. Link: https://lore.kernel.org/all/20251126160854.553077-8-tzimmermann@suse.de/ Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> [ardb: depend on EFI_GENERIC_STUB not EFI, fix conflicts after dropping the preceding patch from the series] Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
57 lines
1.4 KiB
C
57 lines
1.4 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <linux/efi.h>
|
|
#include <linux/sysfb.h>
|
|
|
|
#include <asm/efi.h>
|
|
|
|
#include "efistub.h"
|
|
|
|
/*
|
|
* There are two ways of populating the core kernel's sysfb_primary_display
|
|
* via the stub:
|
|
*
|
|
* - using a configuration table, which relies on the EFI init code to
|
|
* locate the table and copy the contents; or
|
|
*
|
|
* - by linking directly to the core kernel's copy of the global symbol.
|
|
*
|
|
* The latter is preferred because it makes the EFIFB earlycon available very
|
|
* early, but it only works if the EFI stub is part of the core kernel image
|
|
* itself. The zboot decompressor can only use the configuration table
|
|
* approach.
|
|
*/
|
|
|
|
static efi_guid_t primary_display_guid = LINUX_EFI_PRIMARY_DISPLAY_TABLE_GUID;
|
|
|
|
struct sysfb_display_info *__alloc_primary_display(void)
|
|
{
|
|
struct sysfb_display_info *dpy;
|
|
efi_status_t status;
|
|
|
|
status = efi_bs_call(allocate_pool, EFI_ACPI_RECLAIM_MEMORY,
|
|
sizeof(*dpy), (void **)&dpy);
|
|
|
|
if (status != EFI_SUCCESS)
|
|
return NULL;
|
|
|
|
memset(dpy, 0, sizeof(*dpy));
|
|
|
|
status = efi_bs_call(install_configuration_table,
|
|
&primary_display_guid, dpy);
|
|
if (status == EFI_SUCCESS)
|
|
return dpy;
|
|
|
|
efi_bs_call(free_pool, dpy);
|
|
return NULL;
|
|
}
|
|
|
|
void free_primary_display(struct sysfb_display_info *dpy)
|
|
{
|
|
if (!dpy)
|
|
return;
|
|
|
|
efi_bs_call(install_configuration_table, &primary_display_guid, NULL);
|
|
efi_bs_call(free_pool, dpy);
|
|
}
|