Skip to content

Commit 6a7ff13

Browse files
vsyrjalarodrigovivi
authored andcommitted
drm/i915: Fix VBT DSI DVO port handling
Turns out modern (icl+) VBTs still declare their DSI ports as MIPI-A and MIPI-C despite the PHYs now being A and B. Remap appropriately to allow the panels declared as MIPI-C to work. Cc: [email protected] Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8016 Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]> (cherry picked from commit 118b5c1) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 44e4c56 commit 6a7ff13

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

drivers/gpu/drm/i915/display/intel_bios.c

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,6 +2466,22 @@ static enum port dvo_port_to_port(struct drm_i915_private *i915,
24662466
dvo_port);
24672467
}
24682468

2469+
static enum port
2470+
dsi_dvo_port_to_port(struct drm_i915_private *i915, u8 dvo_port)
2471+
{
2472+
switch (dvo_port) {
2473+
case DVO_PORT_MIPIA:
2474+
return PORT_A;
2475+
case DVO_PORT_MIPIC:
2476+
if (DISPLAY_VER(i915) >= 11)
2477+
return PORT_B;
2478+
else
2479+
return PORT_C;
2480+
default:
2481+
return PORT_NONE;
2482+
}
2483+
}
2484+
24692485
static int parse_bdb_230_dp_max_link_rate(const int vbt_max_link_rate)
24702486
{
24712487
switch (vbt_max_link_rate) {
@@ -3414,19 +3430,16 @@ bool intel_bios_is_dsi_present(struct drm_i915_private *i915,
34143430

34153431
dvo_port = child->dvo_port;
34163432

3417-
if (dvo_port == DVO_PORT_MIPIA ||
3418-
(dvo_port == DVO_PORT_MIPIB && DISPLAY_VER(i915) >= 11) ||
3419-
(dvo_port == DVO_PORT_MIPIC && DISPLAY_VER(i915) < 11)) {
3420-
if (port)
3421-
*port = dvo_port - DVO_PORT_MIPIA;
3422-
return true;
3423-
} else if (dvo_port == DVO_PORT_MIPIB ||
3424-
dvo_port == DVO_PORT_MIPIC ||
3425-
dvo_port == DVO_PORT_MIPID) {
3433+
if (dsi_dvo_port_to_port(i915, dvo_port) == PORT_NONE) {
34263434
drm_dbg_kms(&i915->drm,
34273435
"VBT has unsupported DSI port %c\n",
34283436
port_name(dvo_port - DVO_PORT_MIPIA));
3437+
continue;
34293438
}
3439+
3440+
if (port)
3441+
*port = dsi_dvo_port_to_port(i915, dvo_port);
3442+
return true;
34303443
}
34313444

34323445
return false;
@@ -3511,7 +3524,7 @@ bool intel_bios_get_dsc_params(struct intel_encoder *encoder,
35113524
if (!(child->device_type & DEVICE_TYPE_MIPI_OUTPUT))
35123525
continue;
35133526

3514-
if (child->dvo_port - DVO_PORT_MIPIA == encoder->port) {
3527+
if (dsi_dvo_port_to_port(i915, child->dvo_port) == encoder->port) {
35153528
if (!devdata->dsc)
35163529
return false;
35173530

0 commit comments

Comments
 (0)