Эх сурвалжийг харах

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 <[email protected]>
Signed-off-by: Karim Henain <[email protected]>
Signed-off-by: Sudarsan Ramesh <[email protected]>
Xiaowen Wu 5 жил өмнө
parent
commit
52edf46bbd

+ 9 - 6
msm/dp/dp_display.c

@@ -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;
 
-	dp_display_mst_attention(dp);
+	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;

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 1136 - 96
msm/dp/dp_mst_sim.c


+ 12 - 1
msm/dp/dp_mst_sim_helper.c

@@ -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);

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно