From 0f1ae4ae5f15a6b322448f39b93768b62a9bbfe0 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Thu, 4 Dec 2025 19:16:08 -0600 Subject: [PATCH] drivers/gfx/generic: Add support for non-VGA devices Add support for non-VGA devices (e.g., Intel IPU) in the generic graphics driver by: - Adding DOD_NONVGA bit definition per ACPI spec 6.5 table B-2 - Adding non_vga_device boolean field to device config structure - Increasing device array size from 6 to 7 to accommodate IPU - Updating ACPI _DOD generation to use DOD_NONVGA flag for non-VGA devices instead of DOD_FW_DETECT This allows proper ACPI enumeration of non-VGA devices whose power is related to the VGA device, such as Intel Image Processing Units. TEST=tested with rest of patch train on screebo, redrix, and others. Change-Id: I60472e1232959fe407f63b4b8e6bffba995e7f79 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/90516 Reviewed-by: Felix Singer Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Alicja Michalska --- src/drivers/gfx/generic/chip.h | 7 +++++-- src/drivers/gfx/generic/generic.c | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/drivers/gfx/generic/chip.h b/src/drivers/gfx/generic/chip.h index 2710367a3c..3c8a776370 100644 --- a/src/drivers/gfx/generic/chip.h +++ b/src/drivers/gfx/generic/chip.h @@ -8,6 +8,7 @@ /* ACPI spec 6.5 table B-2, Display Output Device */ #define DOD_FW_DETECT BIT(16) /* Platform boot firmware can detect the device. */ +#define DOD_NONVGA BIT(17) /* Non-VGA device whose power is related to the VGA device */ #define DOD_DID_STD BIT(31) /* DID Scheme: Use standard bit-field definitions */ enum display_type { other = 0, @@ -53,6 +54,8 @@ struct drivers_gfx_generic_device_config { /* Physical location of connection point */ bool use_pld; struct acpi_pld pld; + /* Non-VGA device (e.g. Intel IPU) */ + bool non_vga_device; }; /* Config for an ACPI video device defined in Appendix A of the ACPI spec */ @@ -65,8 +68,8 @@ struct drivers_gfx_generic_config { /* The number of output devices defined */ int device_count; /* Config for output devices */ - /* 1 DDIA + 1 DDIB + max 4 TCP = up to 6 GFX devices */ - struct drivers_gfx_generic_device_config device[6]; + /* 1 DDIA + 1 DDIB + max 4 TCP + IPU = up to 7 (6 GFX + 1 non-GFX) devices */ + struct drivers_gfx_generic_device_config device[7]; }; #endif /* __DRIVERS_GFX_GENERIC_CHIP_H__ */ diff --git a/src/drivers/gfx/generic/generic.c b/src/drivers/gfx/generic/generic.c index 01129313a0..51384f6e27 100644 --- a/src/drivers/gfx/generic/generic.c +++ b/src/drivers/gfx/generic/generic.c @@ -120,7 +120,10 @@ static void gfx_fill_ssdt_generator(const struct device *dev) /* Though not strictly necessary, set the display index and port attachment to the device index, to ensure uniqueness */ config->device[i].addr = (config->device[i].type << 8) | (i << 4) | (i); - acpigen_write_dword(DOD_DID_STD | DOD_FW_DETECT | config->device[i].addr); + if (config->device[i].non_vga_device) + acpigen_write_dword(DOD_DID_STD | DOD_NONVGA | config->device[i].addr); + else + acpigen_write_dword(DOD_DID_STD | DOD_FW_DETECT | config->device[i].addr); } acpigen_pop_len(); /* End Package. */ acpigen_pop_len(); /* End Method. */