soc/mediatek/common/display: Add force max swing quirk

A 'quirks' variable is added for panels that require special handling
in the display driver due to sensitivity to the eDP signal quality. The
display driver can then handle the special requests accordingly.

On Navi, the swing level needs to be increased to 3 (500mV) for the
ATNA40HQ01-0 panel to resolve a flickering issue.

BRANCH=rauru
BUG=b:392040003
TEST=check edp training pass and show log:
[INFO ]  fw_config match found: OLED_WQXGA_PLUS=PRESENT
...
[INFO ]  update_swing_preemphasis: Force swing setting to 3 (500 mV)

Signed-off-by: Bincai Liu <bincai.liu@mediatek.corp-partner.google.com>
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Change-Id: Ifa8c45050f61d3dff1fa7aed8fa8e435391a6f3a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86999
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
Yidi Lin 2025-03-27 12:52:56 +08:00
commit 4ae6fd792a
4 changed files with 19 additions and 1 deletions

View file

@ -56,6 +56,13 @@ __weak int mtk_dsi_init(u32 mode_flags, u32 format, u32 lanes,
return -1;
}
static void process_panel_quirks(struct mtk_dp *mtk_dp,
struct panel_description *panel)
{
if (panel->quirks & PANEL_QUIRK_FORCE_MAX_SWING)
mtk_dp->force_max_swing = true;
}
int mtk_display_init(void)
{
struct edid edid = {0};
@ -80,6 +87,7 @@ int mtk_display_init(void)
panel->power_on();
mtk_ddp_init();
process_panel_quirks(&mtk_edp, panel);
if (panel->disp_path == DISP_PATH_EDP) {
mdelay(200);

View file

@ -212,6 +212,7 @@ struct mtk_dp {
bool dsc_enable;
bool enabled;
bool powered;
bool force_max_swing;
};
int mtk_edp_init(struct mtk_dp *mtk_dp, struct edid *edid);

View file

@ -12,6 +12,8 @@ enum disp_path_sel {
DISP_PATH_MIPI,
};
#define PANEL_QUIRK_FORCE_MAX_SWING BIT(0)
struct panel_description {
const char *name;
void (*configure_backlight)(void);
@ -21,6 +23,7 @@ struct panel_description {
enum lb_fb_orientation orientation;
enum disp_path_sel disp_path;
bool pwm_ctrl_gpio;
uint32_t quirks;
};
int mtk_display_init(void);

View file

@ -61,7 +61,13 @@ static void update_swing_preemphasis(struct mtk_dp *mtk_dp, u8 lane_count,
int shift = lane % 2 ? DP_ADJUST_VOLTAGE_SWING_LANE1_SHIFT : 0;
u8 swing_value = dpcd_adjust_req[index] >> shift;
swing_val[lane] = swing_value & DP_ADJUST_VOLTAGE_SWING_LANE0_MASK;
if (mtk_dp->force_max_swing) {
swing_val[lane] = DPTX_SWING3;
printk(BIOS_INFO, "%s: Force swing setting to %u (500 mV)\n",
__func__, swing_val[lane]);
} else {
swing_val[lane] = swing_value & DP_ADJUST_VOLTAGE_SWING_LANE0_MASK;
}
preemphasis[lane] = swing_value & DP_ADJUST_PRE_EMPHASIS_LANE0_MASK;
preemphasis[lane] >>= DP_ADJUST_PRE_EMPHASIS_LANE0_SHIFT;
val = swing_val[lane] << DP_TRAIN_VOLTAGE_SWING_SHIFT |