drivers/intel/fsp2_0: Enable panel-orientation aware bitmap rotation

Implement logo bitmap rotation within fsp_convert_bmp_to_gop_blt() to
support devices with portrait-oriented displays. The rotation is driven
by the panel framebuffer orientation, allowing the logo to be displayed
correctly regardless of physical panel orientation.

This resolves issues where the logo was displayed incorrectly on
portrait-oriented displays.

Additionally, discard the display orientation change if the LID is
closed aka built-in display is not active. This will ensure that
display orientation is proper when extended display is attached w/o
any display rotation.

BUG=b:396580135
TEST=Verified BMP logo display in landscape mode on a portrait panel
with rotation enabled. Also verified portrait logo display in landscape
mode with rotation enabled.

Change-Id: I110bd67331f01e523c227e1a4bdb0484f0157a60
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86850
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Subrata Banik 2025-03-14 01:34:50 +05:30 committed by Matt DeVillier
commit e64a5c4d49
5 changed files with 262 additions and 25 deletions

View file

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <assert.h>
#include <boot/coreboot_tables.h>
#include <bootmode.h>
#include <bootsplash.h>
#include <console/console.h>
@ -1376,10 +1377,25 @@ __weak void mainboard_silicon_init_params(FSP_S_CONFIG *s_cfg)
/* Handle FSP logo params */
void soc_load_logo(FSPS_UPD *supd)
{
struct soc_intel_common_config *config = chip_get_common_soc_structure();
FSP_S_CONFIG *s_cfg = &supd->FspsConfig;
/*
* Adjusts panel orientation for external display when the lid is closed.
*
* When the lid is closed (LidStatus == 0), indicating the onboard display is inactive,
* this function forces the panel orientation to normal. This ensures proper display
* on an external monitor, as rotated orientations are typically not suitable in
* such state.
*/
if (s_cfg->LidStatus == 0)
config->panel_orientation = LB_FB_ORIENTATION_NORMAL;
fsp_convert_bmp_to_gop_blt(&supd->FspsConfig.LogoPtr,
&supd->FspsConfig.LogoSize,
&supd->FspsConfig.BltBufferAddress,
&supd->FspsConfig.BltBufferSize,
&supd->FspsConfig.LogoPixelHeight,
&supd->FspsConfig.LogoPixelWidth);
&supd->FspsConfig.LogoPixelWidth,
config->panel_orientation);
}

View file

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <assert.h>
#include <boot/coreboot_tables.h>
#include <bootmode.h>
#include <bootsplash.h>
#include <cbfs.h>
@ -869,10 +870,25 @@ __weak void mainboard_silicon_init_params(FSP_S_CONFIG *s_cfg)
/* Handle FSP logo params */
void soc_load_logo(FSPS_UPD *supd)
{
struct soc_intel_common_config *config = chip_get_common_soc_structure();
FSP_S_CONFIG *s_cfg = &supd->FspsConfig;
/*
* Adjusts panel orientation for external display when the lid is closed.
*
* When the lid is closed (LidStatus == 0), indicating the onboard display is inactive,
* this function forces the panel orientation to normal. This ensures proper display
* on an external monitor, as rotated orientations are typically not suitable in
* such state.
*/
if (s_cfg->LidStatus == 0)
config->panel_orientation = LB_FB_ORIENTATION_NORMAL;
fsp_convert_bmp_to_gop_blt(&supd->FspsConfig.LogoPtr,
&supd->FspsConfig.LogoSize,
&supd->FspsConfig.BltBufferAddress,
&supd->FspsConfig.BltBufferSize,
&supd->FspsConfig.LogoPixelHeight,
&supd->FspsConfig.LogoPixelWidth);
&supd->FspsConfig.LogoPixelWidth,
config->panel_orientation);
}

View file

@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <boot/coreboot_tables.h>
#include <bootmode.h>
#include <cpu/intel/microcode.h>
#include <fsp/api.h>
@ -785,10 +786,24 @@ void soc_load_logo(FSPS_UPD *supd)
{
efi_uintn_t logo, blt_size;
uint32_t logo_size;
struct soc_intel_common_config *config = chip_get_common_soc_structure();
FSP_S_CONFIG *s_cfg = &supd->FspsConfig;
/*
* Adjusts panel orientation for external display when the lid is closed.
*
* When the lid is closed (LidStatus == 0), indicating the onboard display is inactive,
* this function forces the panel orientation to normal. This ensures proper display
* on an external monitor, as rotated orientations are typically not suitable in
* such state.
*/
if (s_cfg->LidStatus == 0)
config->panel_orientation = LB_FB_ORIENTATION_NORMAL;
fsp_convert_bmp_to_gop_blt(&logo, &logo_size,
&supd->FspsConfig.BltBufferAddress,
&blt_size,
&supd->FspsConfig.LogoPixelHeight,
&supd->FspsConfig.LogoPixelWidth);
&supd->FspsConfig.LogoPixelWidth,
config->panel_orientation);
}