summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuogee Hsieh <khsieh@codeaurora.org>2014-11-06 15:09:50 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:37:14 -0700
commit02ce0808d3b9facccefdecf400089b1c0cd6b3ba (patch)
treeb5c873db63d04c3fd1d547e277e9908d8de6ca9b
parent475788307f7af6027626a90d07bfe5189da8ad12 (diff)
msm: mdss: un map dsi transmit buffer properly
DSi tx buffer is mapped to iommu memory if iommu attached. Therefore it needs to be iommu un mapped at end of transmission. CRs-Fixed: 752164 Change-Id: I2d3edad78c0cd859b5c31b5e2c6d66e5148ccf5f Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi.h3
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi_host.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi.h b/drivers/video/fbdev/msm/mdss_dsi.h
index 2fd9c5b4b13e..22eac8623751 100644
--- a/drivers/video/fbdev/msm/mdss_dsi.h
+++ b/drivers/video/fbdev/msm/mdss_dsi.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -334,6 +334,7 @@ struct mdss_dsi_ctrl_pdata {
int bklt_max;
int new_fps;
int pwm_enabled;
+ bool dmap_iommu_map;
bool panel_bias_vreg;
bool dsi_irq_line;
atomic_t te_irq_ready;
diff --git a/drivers/video/fbdev/msm/mdss_dsi_host.c b/drivers/video/fbdev/msm/mdss_dsi_host.c
index 75f0c430962d..c70b21695c44 100644
--- a/drivers/video/fbdev/msm/mdss_dsi_host.c
+++ b/drivers/video/fbdev/msm/mdss_dsi_host.c
@@ -1528,6 +1528,7 @@ static int mdss_dsi_cmd_dma_tx(struct mdss_dsi_ctrl_pdata *ctrl,
pr_err("unable to map dma memory to iommu(%d)\n", ret);
return -ENOMEM;
}
+ ctrl->dmap_iommu_map = true;
} else {
ctrl->dma_addr = tp->dmap;
}
@@ -1568,19 +1569,21 @@ static int mdss_dsi_cmd_dma_tx(struct mdss_dsi_ctrl_pdata *ctrl,
ret = tp->len;
if (mctrl && mctrl->dma_addr) {
- if (ctrl->mdss_util->iommu_attached()) {
+ if (mctrl->dmap_iommu_map) {
msm_iommu_unmap_contig_buffer(mctrl->dma_addr,
- ctrl->mdss_util->get_iommu_domain(domain),
+ mctrl->mdss_util->get_iommu_domain(domain),
0, mctrl->dma_size);
+ mctrl->dmap_iommu_map = false;
}
mctrl->dma_addr = 0;
mctrl->dma_size = 0;
}
- if (ctrl->mdss_util->iommu_attached()) {
+ if (ctrl->dmap_iommu_map) {
msm_iommu_unmap_contig_buffer(ctrl->dma_addr,
ctrl->mdss_util->get_iommu_domain(domain),
0, ctrl->dma_size);
+ ctrl->dmap_iommu_map = false;
}
ctrl->dma_addr = 0;