disp: msm: dp: update mst connector in debugfs data on replug

The debugfs api for mst control is a multi stage process where the
connector id is selected using the mst_con_id node, which is then
used on other commands such as edid_modes_mst for mode switch.
During mode switch control, the mode is set using the current id
for a display and then the switch is initiated through an unplug
and replug. But on an unplug the connector is destroyed and a new
id is assinged for that display on the subsequent plug. This
change detects this scenario and updates the cached connector id
with the id from the newly created connector.

Change-Id: Ib51566ac9e334d4a0b145b6ae549c59c537cb0cd
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
This commit is contained in:
Rajkumar Subbiah
2020-07-23 12:56:35 -04:00
committed by Gerrit - the friendly Code Review server
父節點 65534be8da
當前提交 d767013a10
共有 3 個文件被更改,包括 55 次插入6 次删除

查看文件

@@ -507,13 +507,24 @@ static ssize_t dp_debug_write_mst_con_id(struct file *file,
}
mutex_unlock(&debug->dp_debug.dp_mst_connector_list.lock);
if (!in_list)
if (!in_list && status != connector_status_connected) {
DP_ERR("invalid connector id %u\n", con_id);
else if (status != connector_status_unknown) {
debug->dp_debug.mst_hpd_sim = true;
debug->hpd->simulate_attention(debug->hpd, vdo);
goto end;
}
if (status == connector_status_unknown)
goto end;
debug->dp_debug.mst_hpd_sim = true;
if (status == connector_status_connected) {
DP_INFO("plug mst connector\n", con_id, status);
debug->dp_debug.mst_sim_add_con = true;
} else {
DP_INFO("unplug mst connector %d\n", con_id, status);
}
debug->hpd->simulate_attention(debug->hpd, vdo);
goto end;
clear:
DP_DEBUG("clearing mst_con_id\n");
@@ -2362,6 +2373,20 @@ static void dp_debug_abort(struct dp_debug *dp_debug)
mutex_unlock(&debug->lock);
}
static void dp_debug_set_mst_con(struct dp_debug *dp_debug, int con_id)
{
struct dp_debug_private *debug;
if (!dp_debug)
return;
debug = container_of(dp_debug, struct dp_debug_private, dp_debug);
mutex_lock(&debug->lock);
debug->mst_con_id = con_id;
mutex_unlock(&debug->lock);
DP_INFO("Selecting mst connector %d\n", con_id);
}
struct dp_debug *dp_debug_get(struct dp_debug_in *in)
{
int rc = 0;
@@ -2409,6 +2434,7 @@ struct dp_debug *dp_debug_get(struct dp_debug_in *in)
debug->aux->access_lock = &debug->lock;
dp_debug->get_edid = dp_debug_get_edid;
dp_debug->abort = dp_debug_abort;
dp_debug->set_mst_con = dp_debug_set_mst_con;
INIT_LIST_HEAD(&dp_debug->dp_mst_connector_list.list);