disp: msm: dp: add dpcd/edid support to dp aux simulator

Add dpcd/edid support to dp aux simulator to enable below features
as options:

  skip edid read
  skip link training
  skip dpcd read
  skip dpcd write
  skip hot plug
  skip sideband message

Also added debugfs support to update dpcd/edid and enable/disable
above features.

Change-Id: Ifa9153f2f00442f3cd5ee3db63fa93384ebc638f
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Karim Henain <khenain@codeaurora.org>
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
This commit is contained in:
Xiaowen Wu
2020-02-04 18:09:05 -05:00
committed by Sudarsan Ramesh
parent 5908171576
commit 52edf46bbd
3 changed files with 1190 additions and 117 deletions

View File

@@ -3182,14 +3182,18 @@ end:
return rc;
}
static int dp_display_bridge_mst_attention(void *dev, bool hpd, bool hpd_irq)
static int dp_display_bridge_internal_hpd(void *dev, bool hpd, bool hpd_irq)
{
struct dp_display_private *dp = dev;
struct drm_device *drm_dev = dp->dp_display.drm_dev;
if (!hpd_irq)
return -EINVAL;
if (!drm_dev || !drm_dev->mode_config.poll_enabled)
return -EBUSY;
if (hpd_irq)
dp_display_mst_attention(dp);
else
dp->hpd->simulate_connect(dp->hpd, hpd);
return 0;
}
@@ -3219,10 +3223,9 @@ static int dp_display_init_aux_bridge(struct dp_display_private *dp)
}
if (dp->aux_bridge->register_hpd &&
(dp->aux_bridge->flag & DP_AUX_BRIDGE_MST) &&
!(dp->aux_bridge->flag & DP_AUX_BRIDGE_HPD))
dp->aux_bridge->register_hpd(dp->aux_bridge,
dp_display_bridge_mst_attention, dp);
dp_display_bridge_internal_hpd, dp);
end:
return rc;

File diff suppressed because it is too large Load Diff

View File

@@ -848,6 +848,11 @@ static int dp_mst_sim_down_rep(struct dp_mst_sim_context *ctx,
int dp_mst_sim_transfer(void *mst_sim_context, struct drm_dp_aux_msg *msg)
{
struct dp_mst_sim_context *ctx = mst_sim_context;
if (!ctx || !ctx->port_num || !msg)
return -ENOENT;
if (msg->request == DP_AUX_NATIVE_WRITE) {
if (msg->address >= DP_SIDEBAND_MSG_DOWN_REQ_BASE &&
msg->address < DP_SIDEBAND_MSG_DOWN_REQ_BASE + 256)
@@ -877,7 +882,7 @@ int dp_mst_sim_update(void *mst_sim_context, u32 port_num,
int rc = 0;
u32 i;
if (port_num >= 15)
if (!ctx || port_num >= 15)
return -EINVAL;
mutex_lock(&ctx->session_lock);
@@ -930,6 +935,9 @@ int dp_mst_sim_create(const struct dp_mst_sim_cfg *cfg,
{
struct dp_mst_sim_context *ctx;
if (!cfg || !mst_sim_context)
return -EINVAL;
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
@@ -958,6 +966,9 @@ int dp_mst_sim_destroy(void *mst_sim_context)
struct dp_mst_sim_context *ctx = mst_sim_context;
u32 i;
if (!ctx)
return -EINVAL;
for (i = 0; i < ctx->port_num; i++)
kfree(ctx->ports[i].edid);
kfree(ctx->ports);