Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/56168 )
Change subject: drivers/intel/gma: Restructure Opregion version info code ......................................................................
drivers/intel/gma: Restructure Opregion version info code
Define a structure for opregion version information to align with spec/kernel.
BUG=b:190019970 BRANCH=None
Signed-off-by: Meera Ravindranath meera.ravindranath@intel.com Change-Id: I93a9f2df186002a4e38caa910f867bce0b97ac2b Reviewed-on: https://review.coreboot.org/c/coreboot/+/56168 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Furquan Shaikh furquan@google.com Reviewed-by: Maulik V Vaghela maulik.v.vaghela@intel.com Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/drivers/intel/gma/opregion.c M src/drivers/intel/gma/opregion.h 2 files changed, 15 insertions(+), 22 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Maulik V Vaghela: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/drivers/intel/gma/opregion.c b/src/drivers/intel/gma/opregion.c index 799c7fd..1385092 100644 --- a/src/drivers/intel/gma/opregion.c +++ b/src/drivers/intel/gma/opregion.c @@ -255,6 +255,12 @@ return CB_ERR; }
+/* Function to get the IGD Opregion version */ +static struct opregion_version opregion_get_version(void) +{ + return (struct opregion_version) { .major = 2, .minor = 0 }; +} + /* * Function to determine if we need to use extended VBT region to pass * VBT pointer. If VBT size > 6 KiB then we need to use extended VBT @@ -333,29 +339,12 @@
rdev_munmap(&rdev, vbt);
+ /* Get the opregion version information */ + opregion->header.opver = opregion_get_version(); + /* 8kb */ opregion->header.size = sizeof(igd_opregion_t) / 1024;
- /* - * Left-shift version field to accommodate Intel Windows driver quirk - * when not using a VBIOS. - * Required for Legacy boot + NGI, UEFI + NGI, and UEFI + GOP driver. - * - * Tested on: (platform, GPU, windows driver version) - * samsung/stumpy (SNB, GT2, 9.17.10.4459) - * google/link (IVB, GT2, 15.33.4653) - * google/wolf (HSW, GT1, 15.40.36.4703) - * google/panther (HSW, GT2, 15.40.36.4703) - * google/rikku (BDW, GT1, 15.40.36.4703) - * google/lulu (BDW, GT2, 15.40.36.4703) - * google/chell (SKL-Y, GT2, 15.45.21.4821) - * google/sentry (SKL-U, GT1, 15.45.21.4821) - * purism/librem13v2 (SKL-U, GT2, 15.45.21.4821) - * - * No adverse effects when using VBIOS or booting Linux. - */ - opregion->header.version = IGD_OPREGION_VERSION << 24; - // FIXME We just assume we're mobile for now opregion->header.mailboxes = MAILBOXES_MOBILE;
diff --git a/src/drivers/intel/gma/opregion.h b/src/drivers/intel/gma/opregion.h index 879017b..e363921 100644 --- a/src/drivers/intel/gma/opregion.h +++ b/src/drivers/intel/gma/opregion.h @@ -17,7 +17,12 @@ typedef struct { u8 signature[16]; /* Offset 0 OpRegion signature */ u32 size; /* Offset 16 OpRegion size */ - u32 version; /* Offset 20 OpRegion structure version */ + struct opregion_version { + u8 rsvd; + u8 revision; + u8 minor; + u8 major; + } opver; /* Offset 20 OpRegion version structure */ u8 sbios_version[32]; /* Offset 24 System BIOS build version */ u8 vbios_version[16]; /* Offset 56 Video BIOS build version */ u8 driver_version[16]; /* Offset 72 Graphic drvr build version */ @@ -29,7 +34,6 @@ } __packed opregion_header_t;
#define IGD_OPREGION_SIGNATURE "IntelGraphicsMem" -#define IGD_OPREGION_VERSION 2
#define IGD_MBOX1 (1 << 0) #define IGD_MBOX2 (1 << 1)