From: Chandan Uddaraju <chandanu@codeaurora.org>
To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org
Cc: jeykumar@quicinc.com, dri-devel@lists.freedesktop.org,
hoegsberg@google.com, Chandan Uddaraju <chandanu@codeaurora.org>
Subject: [DPU PATCH v2 1/2] drm/msm/dsi: adjust dsi timing for dual dsi mode
Date: Mon, 16 Apr 2018 17:40:13 -0700 [thread overview]
Message-ID: <1523925614-28337-2-git-send-email-chandanu@codeaurora.org> (raw)
In-Reply-To: <1523925614-28337-1-git-send-email-chandanu@codeaurora.org>
For dual dsi mode, the horizontal timing needs
to be divided by half since both the dsi controllers
will be driving this panel. Adjust the pixel clock and
DSI timing accordingly.
Changes in V2:
--Removed Change-Id from the commit text tags.
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
---
drivers/gpu/drm/msm/dsi/dsi.h | 1 +
drivers/gpu/drm/msm/dsi/dsi_host.c | 17 +++++++++++++++++
drivers/gpu/drm/msm/dsi/dsi_manager.c | 15 +++++++++++++++
3 files changed, 33 insertions(+)
diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
index 70d9a9a..4131b47 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.h
+++ b/drivers/gpu/drm/msm/dsi/dsi.h
@@ -161,6 +161,7 @@ void msm_dsi_host_cmd_xfer_commit(struct mipi_dsi_host *host,
u32 dma_base, u32 len);
int msm_dsi_host_enable(struct mipi_dsi_host *host);
int msm_dsi_host_disable(struct mipi_dsi_host *host);
+void msm_dsi_host_adjust_timing_config(struct mipi_dsi_host *host);
int msm_dsi_host_power_on(struct mipi_dsi_host *host,
struct msm_dsi_phy_shared_timings *phy_shared_timings);
int msm_dsi_host_power_off(struct mipi_dsi_host *host);
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 7a03a94..66a21cb 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -2237,6 +2237,23 @@ static void msm_dsi_sfpb_config(struct msm_dsi_host *msm_host, bool enable)
SFPB_GPREG_MASTER_PORT_EN(en));
}
+void msm_dsi_host_adjust_timing_config(struct mipi_dsi_host *host)
+{
+ struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
+ struct drm_display_mode *mode = NULL;
+
+ mode = msm_host->mode;
+
+ mutex_lock(&msm_host->dev_mutex);
+ mode->htotal >>= 1;
+ mode->hdisplay >>= 1;
+ mode->hsync_start >>= 1;
+ mode->hsync_end >>= 1;
+
+ mode->clock >>= 1;
+ mutex_unlock(&msm_host->dev_mutex);
+}
+
int msm_dsi_host_power_on(struct mipi_dsi_host *host,
struct msm_dsi_phy_shared_timings *phy_shared_timings)
{
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index 4cb1cb6..8ef1c3d 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -627,6 +627,21 @@ static void dsi_mgr_bridge_mode_set(struct drm_bridge *bridge,
msm_dsi_host_set_display_mode(host, adjusted_mode);
if (is_dual_dsi && other_dsi)
msm_dsi_host_set_display_mode(other_dsi->host, adjusted_mode);
+
+ /*
+ * For dual DSI mode, the current DRM mode has
+ * the complete width of the panel. Since, the complete
+ * panel is driven by two DSI controllers, the
+ * horizontal timings and the pixel clock have to be
+ * split between the two dsi controllers. Adjust the
+ * DSI host timing structures accordingly.
+ */
+ if (is_dual_dsi) {
+ msm_dsi_host_adjust_timing_config(host);
+ if (other_dsi)
+ msm_dsi_host_adjust_timing_config(other_dsi->host);
+ }
+
}
static const struct drm_connector_funcs dsi_mgr_connector_funcs = {
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-04-17 0:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-17 0:40 [DPU PATCH v2 0/2] Connector virtualization for Dual-DSI Chandan Uddaraju
2018-04-17 0:40 ` Chandan Uddaraju [this message]
2018-04-17 20:28 ` [DPU PATCH v2 1/2] drm/msm/dsi: adjust dsi timing for dual dsi mode Sean Paul
2018-04-18 21:51 ` chandanu-sgV2jX0FEOL9JmXXK+q4OQ
[not found] ` <1523925614-28337-1-git-send-email-chandanu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-04-17 0:40 ` [DPU PATCH v2 2/2] drm/msm/dsi: Use one connector for dual DSI mode Chandan Uddaraju
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=1523925614-28337-2-git-send-email-chandanu@codeaurora.org \
--to=chandanu@codeaurora.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=hoegsberg@google.com \
--cc=jeykumar@quicinc.com \
--cc=linux-arm-msm@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).