[PATCH] drm/msm/dp: write the Qualcomm source OUI before eDP link bring-up

From: Jens Glathe via B4 Relay

Date: Sat Dec 05 2026 - 04:55:36 EST


From: Jens Glathe <jens.glathe@xxxxxxxxxxxxxxxxxxxxxx>

Some eDP panels, e.g. the Samsung ATNA40CT01 OLED on the Lenovo IdeaPad
Slim 5x, only accept DPCD backlight writes once the source has identified
itself through DP_SOURCE_OUI. The UEFI GOP writes the Qualcomm OUI
(8c:fd:f0) on a cold boot, but the panel forgets it when its supply rail
is switched off, e.g. across s2idle. The panel then ignores the backlight
brightness writes and stays stuck at maximum brightness after resume.

Write the OUI for eDP sinks from msm_dp_display_prepare_link(), right
after the PHY is up and AUX is usable and before link training, which is
also where the panel has already been prepared by the panel bridge's
pre_enable and the backlight is not enabled yet. Like i915 does for the
Intel OUI, read DP_SOURCE_OUI first and only write it if the read failed
or the value differs, to avoid clearing any sink state by accident.

Use drm_dp_dpcd_write_data() to check the transfer size as well as the
return code.

Root cause found by Stewings, who diffed the panel's DPCD between a cold
boot and a resume from s2idle [1].

[1]: https://github.com/jglathe/linux_ms_dev_kit/issues/102

Assisted-by: Grok Bot
Signed-off-by: Jens Glathe <jens.glathe@xxxxxxxxxxxxxxxxxxxxxx>
---
drivers/gpu/drm/msm/dp/dp_display.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index 29032fb61443e..d4bf60e7cec2e 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -628,6 +628,32 @@ static int msm_dp_display_set_mode(struct msm_dp *msm_dp_display,
return 0;
}

+/**
+ * msm_dp_display_write_source_oui() - tell an eDP sink who the source is
+ * @dp: main display data structure
+ *
+ * Some eDP panels only honour their vendor specific DPCD backlight controls
+ * once the source has identified itself via DP_SOURCE_OUI, and forget the OUI
+ * whenever the panel is power cycled. Write it before the link is brought up,
+ * like i915 does, but leave it alone if the sink already has the value we
+ * want, so that no sink state is cleared by accident.
+ */
+static void msm_dp_display_write_source_oui(struct msm_dp_display_private *dp)
+{
+ /* Not const: drm_dp_dpcd_write_data() takes a non-const buffer */
+ u8 qcom_oui[] = { 0x8c, 0xfd, 0xf0 };
+ u8 buf[sizeof(qcom_oui)] = {};
+
+ if (drm_dp_dpcd_read_data(dp->aux, DP_SOURCE_OUI, buf, sizeof(buf)) < 0)
+ drm_dbg_dp(dp->drm_dev, "failed to read the source OUI\n");
+
+ if (!memcmp(buf, qcom_oui, sizeof(qcom_oui)))
+ return;
+
+ if (drm_dp_dpcd_write_data(dp->aux, DP_SOURCE_OUI, qcom_oui, sizeof(qcom_oui)) < 0)
+ drm_dbg_dp(dp->drm_dev, "failed to write the source OUI\n");
+}
+
static int msm_dp_display_prepare_link(struct msm_dp_display_private *dp)
{
struct msm_dp *msm_dp_display = &dp->msm_dp_display;
@@ -653,6 +679,9 @@ static int msm_dp_display_prepare_link(struct msm_dp_display_private *dp)
force_link_train = true;
}

+ if (msm_dp_display->is_edp)
+ msm_dp_display_write_source_oui(dp);
+
rc = msm_dp_ctrl_on_link(dp->ctrl, dp->panel);
if (rc) {
DRM_ERROR("Failed link training (rc=%d)\n", rc);

---
base-commit: dca2f1b25860f8caa0406f858e76a3a21671a012
change-id: 20261205-dp_send_qcom_oui-9196943eafa3

Best regards,
--
Jens Glathe <jens.glathe@xxxxxxxxxxxxxxxxxxxxxx>