All of lore.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <architt@codeaurora.org>
To: dri-devel@lists.freedesktop.org, robdclark@gmail.com
Cc: linux-arm-msm@vger.kernel.org
Subject: [PATCH 5/5] drm/msm/mdp4: Initialize DSI encoders
Date: Wed, 18 Nov 2015 18:40:49 +0530	[thread overview]
Message-ID: <1447852249-7652-6-git-send-email-architt@codeaurora.org> (raw)
In-Reply-To: <1447852249-7652-1-git-send-email-architt@codeaurora.org>

Create DSI encoders during modeset_init. The 2 encoders should ideally be
one command mode and one video mode DSI encoder respectively, but we don't
support command mode yet. We just create 2 of the same because the dsi
driver expects it, we end up using only the first one.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
---
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 37 ++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
index ddfcc51..5a8e3d6 100644
--- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
+++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
@@ -279,6 +279,8 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms,
 	struct drm_encoder *encoder;
 	struct drm_connector *connector;
 	struct device_node *panel_node;
+	struct drm_encoder *dsi_encs[MSM_DSI_ENCODER_NUM];
+	int i, dsi_id;
 	int ret;
 
 	switch (intf_type) {
@@ -334,12 +336,41 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms,
 		priv->encoders[priv->num_encoders++] = encoder;
 
 		break;
+	case DRM_MODE_ENCODER_DSI:
+		/* only DSI1 supported for now */
+		dsi_id = 0;
+
+		if (!priv->dsi[dsi_id])
+			break;
+
+		for (i = 0; i < MSM_DSI_ENCODER_NUM; i++) {
+			dsi_encs[i] = mdp4_dsi_encoder_init(dev);
+			if (IS_ERR(dsi_encs[i])) {
+				ret = PTR_ERR(dsi_encs[i]);
+				dev_err(dev->dev,
+					"failed to construct DSI encoder: %d\n",
+					ret);
+				return ret;
+			}
+
+			/* TODO: Add DMA_S later? */
+			dsi_encs[i]->possible_crtcs = 1 << DMA_P;
+			priv->encoders[priv->num_encoders++] = dsi_encs[i];
+		}
+
+		ret = msm_dsi_modeset_init(priv->dsi[dsi_id], dev, dsi_encs);
+		if (ret) {
+			dev_err(dev->dev, "failed to initialize DSI: %d\n",
+				ret);
+			return ret;
+		}
+
+		break;
 	default:
 		dev_err(dev->dev, "Invalid or unsupported interface\n");
 		return -EINVAL;
 	}
 
-
 	return 0;
 }
 
@@ -364,6 +395,7 @@ static int modeset_init(struct mdp4_kms *mdp4_kms)
 	};
 	static const int mdp4_intfs[] = {
 		DRM_MODE_ENCODER_LVDS,
+		DRM_MODE_ENCODER_DSI,
 		DRM_MODE_ENCODER_TMDS,
 	};
 
@@ -404,6 +436,9 @@ static int modeset_init(struct mdp4_kms *mdp4_kms)
 	 * we currently set up two relatively fixed paths:
 	 *
 	 * LCDC/LVDS path: RGB1 -> DMA_P -> LCDC -> LVDS
+	 *			or
+	 * DSI path: RGB1 -> DMA_P -> DSI1 -> DSI Panel
+	 *
 	 * DTV/HDMI path: RGB2 -> DMA_E -> DTV -> HDMI
 	 */
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2015-11-18 13:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 13:10 [PATCH 0/5] drm/msm: DSI support on MDP4 Archit Taneja
2015-11-18 13:10 ` [PATCH 1/5] drm/msm/mdp4: Clean up modeset_init Archit Taneja
2015-11-18 13:10 ` [PATCH 2/5] drm/msm/mdp4: Initialize LCDC encoder even if panel driver isn't available Archit Taneja
2015-11-18 13:10 ` [PATCH 3/5] drm/msm/dsi: Add a mdp4 encoder for DSI Archit Taneja
2015-11-18 13:10 ` [PATCH 4/5] drm/msm/mdp4: Call custom round_pixclk helper only if the encoder type is TMDS Archit Taneja
2015-11-18 13:10 ` Archit Taneja [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447852249-7652-6-git-send-email-architt@codeaurora.org \
    --to=architt@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robdclark@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.