Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57fd3ed4 authored by Govinda Rajulu Chenna's avatar Govinda Rajulu Chenna Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dp: delay the mst bridge init until mst_init



Cache the bridge initialization request from kms driver
and initialize the mst bridge using the cached information
only for the mst supported targets.

CRs-Fixed: 2337676
Change-Id: I8c5dbdb5a67a0066c918527bb81ddd453732331a
Signed-off-by: default avatarGovinda Rajulu Chenna <gchenna@codeaurora.org>
parent 87ecda7a
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -2230,10 +2230,7 @@ int dp_display_get_num_of_displays(void)

int dp_display_get_num_of_streams(void)
{
	if (g_dp_display->is_mst_supported)
	return DP_STREAM_MAX;

	return 0;
}

static int dp_display_remove(struct platform_device *pdev)
+24 −3
Original line number Diff line number Diff line
@@ -123,9 +123,15 @@ struct dp_mst_private {
	struct mutex mst_lock;
};

struct dp_mst_encoder_info_cache {
	u8 cnt;
	struct drm_encoder *mst_enc[MAX_DP_MST_DRM_BRIDGES];
};

#define to_dp_mst_bridge(x)     container_of((x), struct dp_mst_bridge, base)

struct dp_mst_private dp_mst;
struct dp_mst_encoder_info_cache dp_mst_enc_cache;

/* DRM DP MST Framework simulator OPs */

@@ -883,8 +889,16 @@ int dp_mst_drm_bridge_init(void *data, struct drm_encoder *encoder)
	int i;

	if (!mst || !mst->mst_initialized) {
		pr_err("mst not initialized\n");
		return -ENODEV;
		if (dp_mst_enc_cache.cnt >= MAX_DP_MST_DRM_BRIDGES) {
			pr_info("exceeding max bridge cnt %d\n",
					dp_mst_enc_cache.cnt);
			return 0;
		}

		dp_mst_enc_cache.mst_enc[dp_mst_enc_cache.cnt] = encoder;
		dp_mst_enc_cache.cnt++;
		pr_info("mst not initialized. cache encoder information\n");
		return 0;
	}

	for (i = 0; i < MAX_DP_MST_DRM_BRIDGES; i++) {
@@ -1452,7 +1466,7 @@ int dp_mst_init(struct dp_display *dp_display)
{
	struct drm_device *dev;
	int conn_base_id = 0;
	int ret;
	int ret, i;
	struct dp_mst_drm_install_info install_info;

	memset(&dp_mst, 0, sizeof(dp_mst));
@@ -1499,6 +1513,13 @@ int dp_mst_init(struct dp_display *dp_display)

	dp_mst.mst_initialized = true;

	/* create drm_bridges for cached mst encoders and clear cache */
	for (i = 0; i < dp_mst_enc_cache.cnt; i++) {
		ret = dp_mst_drm_bridge_init(dp_display,
				dp_mst_enc_cache.mst_enc[i]);
	}
	memset(&dp_mst_enc_cache, 0, sizeof(dp_mst_enc_cache));

	DP_MST_DEBUG("dp drm mst topology manager init completed\n");

	return ret;