drivers/intel/fsp2_0: Pass orientation to fsp_report_framebuffer_info

Instead of always passing LB_FB_ORIENTATION_NORMAL, allow the chipsets
implementing the callback to pass in an orientation.

BUG=b:194967458
BRANCH=dedede

Change-Id: I4aacab9449930a75aca9d68bf30d019f86035405
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57647
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
diff --git a/src/drivers/intel/fsp2_0/graphics.c b/src/drivers/intel/fsp2_0/graphics.c
index ddf8f0b..b55696b 100644
--- a/src/drivers/intel/fsp2_0/graphics.c
+++ b/src/drivers/intel/fsp2_0/graphics.c
@@ -49,7 +49,8 @@
 };
 
 
-void fsp_report_framebuffer_info(const uintptr_t framebuffer_bar)
+void fsp_report_framebuffer_info(const uintptr_t framebuffer_bar,
+				 enum lb_fb_orientation orientation)
 {
 	size_t size;
 	const struct hob_graphics_info *ginfo;
@@ -94,7 +95,7 @@
 		.blue_mask_size      = fbinfo->blue.size,
 		.reserved_mask_pos   = fbinfo->rsvd.pos,
 		.reserved_mask_size  = fbinfo->rsvd.size,
-		.orientation         = LB_FB_ORIENTATION_NORMAL,
+		.orientation         = orientation,
 	};
 
 	fb_add_framebuffer_info_ex(&fb);
diff --git a/src/drivers/intel/fsp2_0/include/fsp/graphics.h b/src/drivers/intel/fsp2_0/include/fsp/graphics.h
index 2d81383..dfd7b4e 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/graphics.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/graphics.h
@@ -11,6 +11,7 @@
  * Must be called after PCI enumeration to make sure that the BAR
  * doesn't change any more.
  */
-void fsp_report_framebuffer_info(const uintptr_t framebuffer_bar);
+void fsp_report_framebuffer_info(const uintptr_t framebuffer_bar,
+				 enum lb_fb_orientation orientation);
 
 #endif /* _FSP2_0_GRAPHICS_H_ */
diff --git a/src/soc/amd/common/block/graphics/graphics.c b/src/soc/amd/common/block/graphics/graphics.c
index 79df626..3b60e26 100644
--- a/src/soc/amd/common/block/graphics/graphics.c
+++ b/src/soc/amd/common/block/graphics/graphics.c
@@ -2,6 +2,7 @@
 
 #include <acpi/acpi_device.h>
 #include <acpi/acpigen.h>
+#include <boot/coreboot_tables.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <console/console.h>
@@ -157,7 +158,7 @@
 		struct resource *res = probe_resource(dev, PCI_BASE_ADDRESS_0);
 
 		if (res && res->base)
-			fsp_report_framebuffer_info(res->base);
+			fsp_report_framebuffer_info(res->base, LB_FB_ORIENTATION_NORMAL);
 		else
 			printk(BIOS_ERR, "%s: Unable to find resource for %s\n",
 			       __func__, dev_path(dev));
diff --git a/src/soc/intel/common/block/graphics/graphics.c b/src/soc/intel/common/block/graphics/graphics.c
index 85b7124..d9daaaf 100644
--- a/src/soc/intel/common/block/graphics/graphics.c
+++ b/src/soc/intel/common/block/graphics/graphics.c
@@ -10,6 +10,7 @@
 #include <drivers/intel/gma/i915.h>
 #include <drivers/intel/gma/libgfxinit.h>
 #include <drivers/intel/gma/opregion.h>
+#include <intelblocks/cfg.h>
 #include <intelblocks/graphics.h>
 #include <fsp/graphics.h>
 #include <soc/pci_devs.h>
@@ -57,7 +58,9 @@
 	 * Kconfig to perform GFX initialization.
 	 */
 	if (CONFIG(RUN_FSP_GOP)) {
-		fsp_report_framebuffer_info(graphics_get_memory_base());
+		const struct soc_intel_common_config *config = chip_get_common_soc_structure();
+		fsp_report_framebuffer_info(graphics_get_memory_base(),
+					    config->panel_orientation);
 		return;
 	}