From 3bb21d12c2d5f591a230288b372cccf51dfbb5f5 Mon Sep 17 00:00:00 2001 From: Sudarsan Ramesh Date: Thu, 1 Apr 2021 12:28:44 -0400 Subject: [PATCH] disp: msm: dp: pass correct vdo value to the simulate_attention cb In DPSIM, while calling the hpd callback from dp_sim_host_hpd_irq, the hpd argument is passed in as false. In the hpd callback, both the hpd_irq and hpd arguments need to be encoded into the vdo parameter. Currently, MST DPSIM testcases are broken because this is not implemented properly. This change sets the hpd argument to true in the hpd_irq callback, and encodes the hpd and hpd_irq parameter in the vdo object before passing it to the simulate_attention callback. Change-Id: I07155716699aad8554b6e08b446139bcd0d7fa74 Signed-off-by: Sudarsan Ramesh --- msm/dp/dp_debug.c | 13 ++++++++++--- msm/dp/dp_mst_sim.c | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/msm/dp/dp_debug.c b/msm/dp/dp_debug.c index 22842351b7..9bc7542596 100644 --- a/msm/dp/dp_debug.c +++ b/msm/dp/dp_debug.c @@ -54,11 +54,18 @@ struct dp_debug_private { static int dp_debug_sim_hpd_cb(void *arg, bool hpd, bool hpd_irq) { struct dp_debug_private *debug = arg; + int vdo = 0; - if (hpd_irq) - return debug->hpd->simulate_attention(debug->hpd, 0); - else + if (hpd_irq) { + vdo |= BIT(7); + + if (hpd) + vdo |= BIT(8); + + return debug->hpd->simulate_attention(debug->hpd, vdo); + } else { return debug->hpd->simulate_connect(debug->hpd, hpd); + } } static int dp_debug_attach_sim_bridge(struct dp_debug_private *debug) diff --git a/msm/dp/dp_mst_sim.c b/msm/dp/dp_mst_sim.c index c9f56d4906..c358ae7ffa 100644 --- a/msm/dp/dp_mst_sim.c +++ b/msm/dp/dp_mst_sim.c @@ -341,7 +341,7 @@ static void dp_sim_host_hpd_irq(void *host_dev) struct dp_sim_device *sim_dev = host_dev; if (sim_dev->hpd_cb) - sim_dev->hpd_cb(sim_dev->host_dev, false, true); + sim_dev->hpd_cb(sim_dev->host_dev, true, true); } int dp_sim_set_sim_mode(struct dp_aux_bridge *bridge, u32 sim_mode)