From fd0a891ee9ed0947123e893505bdfc8ada408ab9 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Thu, 19 Oct 2017 22:44:18 -0500 Subject: drv/intel/gma/opregion: fix opregion version for Windows Although Intel's current spec[1] shows the OpRegion structure version as being the top 16 bits of the field, Intel's Windows drivers require the OpRegion structure version to be in the top 8 bits of the field when not using a VGA BIOS (eg, NGI or GOP driver). As the Linux i915 driver only checks that the version is >= 2, there is no change in functionality there. This change effectively matches Intel's implementation in TianoCore, where the version is set to 0x0200 << 16. [1] https://01.org/sites/default/files/documentation/skl_opregion_rev0p5.pdf TEST: Boot Windows [8.1,10] in UEFI mode w/GOP graphics init and Legacy mode with libgfxinit, observe Intel GPU driver functional. Change-Id: Ic2903ee4829689ec4117aec93dce0b87cec6f313 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/22118 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/drivers/intel/gma/opregion.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/drivers/intel/gma/opregion.c b/src/drivers/intel/gma/opregion.c index 84bca9bd3a..b6d4e07790 100644 --- a/src/drivers/intel/gma/opregion.c +++ b/src/drivers/intel/gma/opregion.c @@ -260,7 +260,26 @@ intel_gma_init_igd_opregion(igd_opregion_t *opregion) /* 8kb */ opregion->header.size = sizeof(igd_opregion_t) / 1024; - opregion->header.version = IGD_OPREGION_VERSION; + + /* + * Left-shift version field to accomodate 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; -- cgit v1.2.3