Contributors: 7
| Author |
Tokens |
Token Proportion |
Commits |
Commit Proportion |
| Ard Biesheuvel |
91 |
62.33% |
6 |
46.15% |
| Thomas Zimmermann |
24 |
16.44% |
2 |
15.38% |
| Qiang Ma |
11 |
7.53% |
1 |
7.69% |
| Mark Salter |
8 |
5.48% |
1 |
7.69% |
| Matt Fleming |
5 |
3.42% |
1 |
7.69% |
| Linus Torvalds |
4 |
2.74% |
1 |
7.69% |
| Arvind Sankar |
3 |
2.05% |
1 |
7.69% |
| Total |
146 |
|
13 |
|
// 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);
}