disp: msm: dp: use dp_msm_sim for dp-mst simulation

Revert changes in dp mst topology manager and use dp_msm_sim bridge
at aux layer to implement dp-mst simulation.

Change-Id: I863649f901ac918f65c9078e6a2f1b6931d19e3a
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Karim Henain <khenain@codeaurora.org>
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
このコミットが含まれているのは:
Xiaowen Wu
2019-11-05 16:02:32 -05:00
committed by Sudarsan Ramesh
コミット 467443d7e3
6個のファイルの変更116行の追加546行の削除

ファイルの表示

@@ -15,6 +15,7 @@
#include "dp_display.h"
#include "dp_pll.h"
#include "dp_hpd.h"
#include "dp_mst_sim_helper.h"
#define DEBUG_NAME "drm_dp"
@@ -45,8 +46,73 @@ struct dp_debug_private {
struct dp_pll *pll;
struct dp_display *display;
struct mutex lock;
struct dp_aux_bridge *sim_bridge;
};
static int dp_debug_sim_hpd_cb(void *arg, bool hpd, bool hpd_irq)
{
struct dp_debug_private *debug = arg;
if (hpd_irq)
return debug->hpd->simulate_attention(debug->hpd, 0);
else
return debug->hpd->simulate_connect(debug->hpd, hpd);
}
static int dp_debug_configure_mst_bridge(struct dp_debug_private *debug)
{
struct device_node *bridge_node;
struct dp_mst_sim_port *ports;
int i, ret;
static const struct dp_mst_sim_port output_port = {
false, false, true, 3, false, 0x12,
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
0, 0, 2520, 2520, NULL, 0
};
if (!debug->sim_bridge) {
bridge_node = of_parse_phandle(debug->dev->of_node,
"qcom,dp-aux-bridge-sim", 0);
if (!bridge_node)
return 0;
debug->sim_bridge = of_dp_aux_find_bridge(bridge_node);
}
if (!debug->sim_bridge)
return -EINVAL;
if (debug->sim_bridge->register_hpd) {
ret = debug->sim_bridge->register_hpd(debug->sim_bridge,
dp_debug_sim_hpd_cb, debug);
if (ret)
return ret;
}
if (!debug->dp_debug.mst_port_cnt || !debug->sim_bridge->mst_ctx)
return 0;
ports = kcalloc(debug->dp_debug.mst_port_cnt,
sizeof(*ports), GFP_KERNEL);
if (!ports)
return -ENOMEM;
for (i = 0; i < debug->dp_debug.mst_port_cnt; i++) {
memcpy(&ports[i], &output_port, sizeof(*ports));
ports[i].peer_guid[0] = i;
ports[i].edid = debug->edid;
ports[i].edid_size = debug->edid_size;
}
ret = dp_mst_sim_update(debug->sim_bridge->mst_ctx,
debug->dp_debug.mst_port_cnt, ports);
kfree(ports);
return ret;
}
static int dp_debug_get_edid_buf(struct dp_debug_private *debug)
{
int rc = 0;
@@ -133,7 +199,8 @@ static ssize_t dp_debug_write_edid(struct file *file,
debug->aux->set_sim_mode(debug->aux,
debug->dp_debug.sim_mode,
debug->edid, debug->dpcd);
debug->edid, debug->dpcd,
debug->sim_bridge);
}
}
@@ -167,6 +234,9 @@ bail:
*/
DP_INFO("[%s]\n", edid ? "SET" : "CLEAR");
if (dp_debug_configure_mst_bridge(debug))
DP_ERR("failed to config mst bridge\n");
mutex_unlock(&debug->lock);
return rc;
}
@@ -830,10 +900,13 @@ static ssize_t dp_debug_mst_sideband_mode_write(struct file *file,
return -EINVAL;
}
debug->parser->has_mst_sideband = mst_sideband_mode ? true : false;
debug->dp_debug.mst_port_cnt = mst_port_cnt;
DP_DEBUG("mst_sideband_mode: %d port_cnt:%d\n",
mst_sideband_mode, mst_port_cnt);
if (dp_debug_configure_mst_bridge(debug))
DP_ERR("failed to config mst bridge\n");
return count;
}
@@ -1636,9 +1709,13 @@ static void dp_debug_set_sim_mode(struct dp_debug_private *debug, bool sim)
return;
}
if (dp_debug_configure_mst_bridge(debug))
DP_ERR("failed to config mst bridge\n");
debug->dp_debug.mst_hpd_sim = true;
debug->dp_debug.sim_mode = true;
debug->aux->set_sim_mode(debug->aux, true,
debug->edid, debug->dpcd);
debug->edid, debug->dpcd, debug->sim_bridge);
debug->ctrl->set_sim_mode(debug->ctrl, true);
} else {
if (debug->hotplug) {
@@ -1649,9 +1726,10 @@ static void dp_debug_set_sim_mode(struct dp_debug_private *debug, bool sim)
debug->aux->abort(debug->aux, true);
debug->ctrl->abort(debug->ctrl, true);
debug->aux->set_sim_mode(debug->aux, false, NULL, NULL);
debug->aux->set_sim_mode(debug->aux, false, NULL, NULL, NULL);
debug->ctrl->set_sim_mode(debug->ctrl, false);
debug->dp_debug.sim_mode = false;
debug->dp_debug.mst_hpd_sim = false;
debug->panel->set_edid(debug->panel, 0, 0);
if (debug->edid) {