From: Sibi S <sibis@codeaurora.org>
To: architt@codeaurora.org, robdclark@gmail.com
Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
Sibi S <sibis@codeaurora.org>,
dri-devel@lists.freedesktop.org
Subject: [PATCH 5/5] drm/msm/dsi: replace version checks for commmand broadcast
Date: Mon, 12 Mar 2018 18:53:14 +0530 [thread overview]
Message-ID: <1520860994-23334-6-git-send-email-sibis@codeaurora.org> (raw)
In-Reply-To: <1520860994-23334-1-git-send-email-sibis@codeaurora.org>
Replace version checks for commmand broadcast with the helper
functions bound to cfg_handler for DSI v6G 1.x and DSI 6G v2.0+
controllers
Signed-off-by: Sibi S <sibis@codeaurora.org>
---
drivers/gpu/drm/msm/dsi/dsi_cfg.c | 6 ++++++
drivers/gpu/drm/msm/dsi/dsi_cfg.h | 2 ++
drivers/gpu/drm/msm/dsi/dsi_host.c | 16 +++-------------
3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
index dcdfb1b..6ec28d1 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
@@ -145,6 +145,8 @@
.tx_buf_put = NULL,
.dma_base_get = dsi_dma_base_get_v2,
.calc_clk_rate = dsi_calc_clk_rate_v2,
+ .xfer = msm_dsi_manager_cmd_xfer,
+ .xfer_trigger = msm_dsi_manager_cmd_xfer_trigger,
};
const static struct msm_dsi_host_cfg_ops msm_dsi_6g_host_ops = {
@@ -156,6 +158,8 @@
.tx_buf_put = dsi_tx_buf_put_6g,
.dma_base_get = dsi_dma_base_get_6g,
.calc_clk_rate = dsi_calc_clk_rate_6g,
+ .xfer = msm_dsi_manager_cmd_xfer,
+ .xfer_trigger = msm_dsi_manager_cmd_xfer_trigger,
};
const static struct msm_dsi_host_cfg_ops msm_dsi_6g_v2_host_ops = {
@@ -167,6 +171,8 @@
.tx_buf_put = dsi_tx_buf_put_6g,
.dma_base_get = dsi_dma_base_get_6g,
.calc_clk_rate = dsi_calc_clk_rate_6g,
+ .xfer = msm_dsi_manager_cmd_xfer_6g_v2,
+ .xfer_trigger = msm_dsi_manager_cmd_xfer_trigger_6g_v2,
};
static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] = {
diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
index a795a06..145251e 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
@@ -49,6 +49,8 @@ struct msm_dsi_host_cfg_ops {
void (*tx_buf_put)(struct msm_dsi_host *msm_host);
int (*dma_base_get)(struct msm_dsi_host *msm_host, uint64_t *iova);
int (*calc_clk_rate)(struct msm_dsi_host *msm_host);
+ bool (*xfer_trigger)(int id, u32 dma_base, u32 len);
+ int (*xfer)(int id, const struct mipi_dsi_msg *msg);
};
struct msm_dsi_cfg_handler {
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index bd61cad..240ecb8 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -1251,13 +1251,8 @@ static int dsi_cmd_dma_tx(struct msm_dsi_host *msm_host, int len)
reinit_completion(&msm_host->dma_comp);
dsi_wait4video_eng_busy(msm_host);
- if ((cfg_hnd->major == MSM_DSI_VER_MAJOR_6G) &&
- (cfg_hnd->minor < MSM_DSI_6G_VER_MINOR_V2_2_1))
- triggered = msm_dsi_manager_cmd_xfer_trigger(msm_host->id,
- dma_base, len);
- else
- triggered = msm_dsi_manager_cmd_xfer_trigger_6g_v2(
- msm_host->id, dma_base, len);
+ triggered = cfg_hnd->ops->xfer_trigger(msm_host->id,
+ dma_base, len);
if (triggered) {
ret = wait_for_completion_timeout(&msm_host->dma_comp,
@@ -1615,12 +1610,7 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host,
mutex_lock(&msm_host->cmd_mutex);
- if (((cfg_hnd->major == MSM_DSI_VER_MAJOR_6G) &&
- (cfg_hnd->minor < MSM_DSI_6G_VER_MINOR_V2_2_1)) ||
- (cfg_hnd->major == MSM_DSI_VER_MAJOR_V2))
- ret = msm_dsi_manager_cmd_xfer(msm_host->id, msg);
- else
- ret = msm_dsi_manager_cmd_xfer_6g_v2(msm_host->id, msg);
+ ret = cfg_hnd->ops->xfer(msm_host->id, msg);
mutex_unlock(&msm_host->cmd_mutex);
--
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
prev parent reply other threads:[~2018-03-12 13:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-12 13:23 [PATCH 0/5] Cleanup excessive DSI host controller version checks Sibi S
2018-03-12 13:23 ` [PATCH 1/5] drm/msm/dsi: add dsi host helper functions support Sibi S
2018-03-12 13:23 ` [PATCH 2/5] drm/msm/dsi: add implementation for helper functions Sibi S
[not found] ` <1520860994-23334-3-git-send-email-sibis-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-03-12 15:13 ` Jordan Crouse
[not found] ` <20180312151352.GA28808-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
2018-03-13 6:57 ` Sibi S
2018-03-13 5:19 ` Archit Taneja
[not found] ` <1091cdf6-7322-17ad-f156-c65cfe7df87a-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-03-13 7:01 ` Sibi S
2018-03-12 13:23 ` [PATCH 3/5] drm/msm/dsi: replace version checks with " Sibi S
[not found] ` <1520860994-23334-4-git-send-email-sibis-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-03-13 5:20 ` Archit Taneja
2018-03-12 13:23 ` [PATCH 4/5] drm/msm/dsi: implement 6G v2.0+ DSI command broadcast Sibi S
[not found] ` <1520860994-23334-5-git-send-email-sibis-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-03-13 5:30 ` Archit Taneja
2018-03-12 13:23 ` Sibi S [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=1520860994-23334-6-git-send-email-sibis@codeaurora.org \
--to=sibis@codeaurora.org \
--cc=architt@codeaurora.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@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 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).