0040-nb-haswell-Disable-iGPU-when-dGPU-is-used.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From c6ce9c635e6576c86c546177c3d770dec2f3c9ae Mon Sep 17 00:00:00 2001
  2. From: Leah Rowe <info@minifree.org>
  3. Date: Fri, 23 Feb 2024 13:33:31 +0000
  4. Subject: [PATCH 1/1] nb/haswell: Disable iGPU when dGPU is used
  5. This is usually is handled by Haswell mrc.bin, disabling VGA
  6. decode on the iGPU when a dGPU is installed. However, Broadwell
  7. mrc.bin does not, so the iGPU and dGPU are both enabled.
  8. This patch disables legacy VGA cycles for iGPU, under such
  9. conditions. It has been tested on Broadwell mrc.bin when
  10. using a graphics card on Dell OptiPlex 9020 SFF (currently
  11. under review at this time of writing, submitted by Mate
  12. Kukri).
  13. This patch has also been tested when Haswell mrc.bin is used,
  14. and there are seemingly no breaking changes caused by it.
  15. Change-Id: I1df0a3aa42f8475b7741007bf3e28c2e089d916b
  16. Signed-off-by: Leah Rowe <info@minifree.org>
  17. Reviewed-on: https://review.coreboot.org/c/coreboot/+/80717
  18. Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
  19. Reviewed-by: Nico Huber <nico.h@gmx.de>
  20. ---
  21. src/northbridge/intel/haswell/gma.c | 7 +++++++
  22. 1 file changed, 7 insertions(+)
  23. diff --git a/src/northbridge/intel/haswell/gma.c b/src/northbridge/intel/haswell/gma.c
  24. index 6e6948b70f..48a0ba54c7 100644
  25. --- a/src/northbridge/intel/haswell/gma.c
  26. +++ b/src/northbridge/intel/haswell/gma.c
  27. @@ -461,12 +461,19 @@ static void gma_generate_ssdt(const struct device *dev)
  28. drivers_intel_gma_displays_ssdt_generate(&chip->gfx);
  29. }
  30. +static void gma_func0_disable(struct device *dev)
  31. +{
  32. + /* Disable VGA decode */
  33. + pci_or_config16(pcidev_on_root(0, 0), GGC, 1 << 1);
  34. +}
  35. +
  36. static struct device_operations gma_func0_ops = {
  37. .read_resources = pci_dev_read_resources,
  38. .set_resources = pci_dev_set_resources,
  39. .enable_resources = pci_dev_enable_resources,
  40. .init = gma_func0_init,
  41. .acpi_fill_ssdt = gma_generate_ssdt,
  42. + .vga_disable = gma_func0_disable,
  43. .ops_pci = &pci_dev_ops_pci,
  44. };
  45. --
  46. 2.39.2