Skip to content

Commit 45c2c8c

Browse files
ideakgregkh
authored andcommitted
drm/i915/lnl+/tc: Fix max lane count HW readout
commit c87514a upstream. On LNL+ for a disconnected sink the pin assignment value gets cleared by the HW/FW as soon as the sink gets disconnected, even if the PHY ownership got acquired already by the BIOS/driver (and hence the PHY itself is still connected and used by the display). During HW readout this can result in detecting the PHY's max lane count as 0 - matching the above cleared aka NONE pin assignment HW state. For a connected PHY the driver in general (outside of intel_tc.c) expects the max lane count value to be valid for the video mode enabled on the corresponding output (1, 2 or 4). Ensure this by setting the max lane count to 4 in this case. Note, that it doesn't matter if this lane count happened to be more than the max lane count with which the PHY got connected and enabled, since the only thing the driver can do with such an output - where the DP-alt sink is disconnected - is to disable the output. v2: Rebased on change reading out the pin configuration only if the PHY is connected. Cc: stable@vger.kernel.org # v6.8+ Reported-by: Charlton Lin <charlton.lin@intel.com> Tested-by: Khaled Almahallawy <khaled.almahallawy@intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://lore.kernel.org/r/20250811080152.906216-4-imre.deak@intel.com (cherry picked from commit 33cf70b) Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 68c3646 commit 45c2c8c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "intel_modeset_lock.h"
2323
#include "intel_tc.h"
2424

25+
#define DP_PIN_ASSIGNMENT_NONE 0x0
2526
#define DP_PIN_ASSIGNMENT_C 0x3
2627
#define DP_PIN_ASSIGNMENT_D 0x4
2728
#define DP_PIN_ASSIGNMENT_E 0x5
@@ -307,6 +308,8 @@ static int lnl_tc_port_get_max_lane_count(struct intel_digital_port *dig_port)
307308
REG_FIELD_GET(TCSS_DDI_STATUS_PIN_ASSIGNMENT_MASK, val);
308309

309310
switch (pin_assignment) {
311+
case DP_PIN_ASSIGNMENT_NONE:
312+
return 0;
310313
default:
311314
MISSING_CASE(pin_assignment);
312315
fallthrough;
@@ -1158,6 +1161,12 @@ static void xelpdp_tc_phy_get_hw_state(struct intel_tc_port *tc)
11581161
tc->lock_wakeref = tc_cold_block(tc);
11591162

11601163
read_pin_configuration(tc);
1164+
/*
1165+
* Set a valid lane count value for a DP-alt sink which got
1166+
* disconnected. The driver can only disable the output on this PHY.
1167+
*/
1168+
if (tc->max_lane_count == 0)
1169+
tc->max_lane_count = 4;
11611170
}
11621171

11631172
drm_WARN_ON(display->drm,

0 commit comments

Comments
 (0)