drivers/firmware/efi/sysfb_efi.c
Source file repositories/reference/linux-study-clean/drivers/firmware/efi/sysfb_efi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/efi/sysfb_efi.c- Extension
.c- Size
- 14400 bytes
- Lines
- 441
- Domain
- Driver Families
- Bucket
- drivers/firmware
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/dmi.hlinux/err.hlinux/efi.hlinux/init.hlinux/kernel.hlinux/mm.hlinux/of_address.hlinux/pci.hlinux/platform_device.hlinux/screen_info.hlinux/sysfb.hvideo/vga.h
Detected Declarations
struct efifb_mode_fixupfunction efifb_setup_from_dmifunction efifb_set_systemfunction for_each_pci_devfunction efifb_set_system_callbackfunction efifb_swap_width_heightfunction efifb_check_and_swap_width_heightfunction efifb_overlaps_pci_rangefunction for_each_node_by_typefunction efifb_add_linksfunction sysfb_apply_efi_quirksfunction sysfb_set_efifb_fwnode
Annotated Snippet
struct efifb_mode_fixup {
unsigned int width;
unsigned int height;
unsigned int linelength;
};
static int __init
efifb_check_and_swap_width_height(const struct dmi_system_id *id)
{
const struct efifb_mode_fixup *data = id->driver_data;
struct screen_info *si = &sysfb_primary_display.screen;
if (data->width == si->lfb_width && data->height == si->lfb_height) {
swap(si->lfb_width, si->lfb_height);
si->lfb_linelength = data->linelength;
si->lfb_size = data->linelength * data->width;
}
return 1;
}
static const struct efifb_mode_fixup efifb_steamdeck_mode_fixup __initconst = {
.width = 1280,
.height = 800,
.linelength = 3328,
};
/*
* Some devices have a portrait LCD but advertise a landscape resolution (and
* pitch). We simply swap width and height for these devices so that we can
* correctly deal with some of them coming with multiple resolutions.
*/
static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = {
{
/*
* Lenovo MIIX310-10ICR, only some batches have the troublesome
* 800x1280 portrait screen. Luckily the portrait version has
* its own BIOS version, so we match on that.
*/
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "MIIX 310-10ICR"),
DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1HCN44WW"),
},
.callback = efifb_swap_width_height,
},
{
/* Lenovo MIIX 320-10ICR with 800x1280 portrait screen */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION,
"Lenovo MIIX 320-10ICR"),
},
.callback = efifb_swap_width_height,
},
{
/* Lenovo D330 with 800x1280 or 1200x1920 portrait screen */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION,
"Lenovo ideapad D330-10IGM"),
},
.callback = efifb_swap_width_height,
},
{
/*
* Lenovo IdeaPad Duet 3 10IGL5 and 10IGL5-LTE with
* 1200x1920 portrait screen
*/
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
/* Non exact match to also match the LTE version */
DMI_MATCH(DMI_PRODUCT_VERSION, "IdeaPad Duet 3 10IGL5"),
},
.callback = efifb_swap_width_height,
},
{
/* Lenovo Yoga Book X91F / X91L */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
/* Non exact match to match F + L versions */
DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"),
},
.callback = efifb_swap_width_height,
},
{
/* Valve Steam Deck (Jupiter) */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Valve"),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Jupiter"),
Annotation
- Immediate include surface: `linux/dmi.h`, `linux/err.h`, `linux/efi.h`, `linux/init.h`, `linux/kernel.h`, `linux/mm.h`, `linux/of_address.h`, `linux/pci.h`.
- Detected declarations: `struct efifb_mode_fixup`, `function efifb_setup_from_dmi`, `function efifb_set_system`, `function for_each_pci_dev`, `function efifb_set_system_callback`, `function efifb_swap_width_height`, `function efifb_check_and_swap_width_height`, `function efifb_overlaps_pci_range`, `function for_each_node_by_type`, `function efifb_add_links`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.