summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm
diff options
context:
space:
mode:
authorArchit Taneja <architt@codeaurora.org>2015-11-18 12:28:28 (GMT)
committerRob Clark <robdclark@gmail.com>2015-12-14 15:39:53 (GMT)
commitaf6d0423dfe33ca3bb9a0d1f50eb165b087fd88e (patch)
tree5b9fa3b0d4d4bcb6d0ab81f04ca30fe3df26cbb6 /drivers/gpu/drm/msm
parent9696acbcbf4048cc2462834bb692200f44e50f29 (diff)
downloadlinux-af6d0423dfe33ca3bb9a0d1f50eb165b087fd88e.tar.xz
drm/msm/mdp4: Initialize DSI encoders
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> Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm')
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c37
1 files changed, 36 insertions, 1 deletions
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
*/