summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMayank Chopra <makchopra@codeaurora.org>2013-06-12 15:58:04 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:18:42 -0700
commitbd5dfd27d4033fb10793f670d0d01b68897b98e4 (patch)
tree837fc576a4e196b63ba92f082c144a5077b913e1 /drivers
parent46a045d1e46384f929f365221092cd501b46e0a5 (diff)
msm: mdss: Restrict SMP buffer reservation
Given two line latency buffer requirement for performance, in some cases, three or more SMP blocks get reserved. This happens typically for the usecases involving higher resolution layers (e.g. 1080P). For these usecases required number of SMP blocks exceed total number of SMP blocks available, thus causing SMP reservation failures. These failures are often encountered in 8x26 target as it has in total, only seven SMP blocks available. Restrict SMP buffer reservation to two SMP blocks, based on an optionable device tree property, to be able to support most of the usecases. This restriction is not applicable to horizontal flip cases where two line latency buffer reservation is necessary. Change-Id: I7d57568b4b2710df0142bbc16749e56a9b492dfe Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/fbdev/msm/mdss.h1
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp.c10
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_pipe.c5
3 files changed, 14 insertions, 2 deletions
diff --git a/drivers/video/fbdev/msm/mdss.h b/drivers/video/fbdev/msm/mdss.h
index 2ac6a2aef07f..c8a4c3064c41 100644
--- a/drivers/video/fbdev/msm/mdss.h
+++ b/drivers/video/fbdev/msm/mdss.h
@@ -89,6 +89,7 @@ struct mdss_data_type {
u32 smp_mb_cnt;
u32 smp_mb_size;
+ u32 smp_mb_per_pipe;
u32 rot_block_size;
diff --git a/drivers/video/fbdev/msm/mdss_mdp.c b/drivers/video/fbdev/msm/mdss_mdp.c
index 2b6f6f441e30..9400ecf69d92 100644
--- a/drivers/video/fbdev/msm/mdss_mdp.c
+++ b/drivers/video/fbdev/msm/mdss_mdp.c
@@ -1514,10 +1514,16 @@ static int mdss_mdp_parse_dt_smp(struct platform_device *pdev)
rc = mdss_mdp_smp_setup(mdata, data[0], data[1]);
- if (rc)
+ if (rc) {
pr_err("unable to setup smp data\n");
+ return rc;
+ }
- return rc;
+ rc = of_property_read_u32(pdev->dev.of_node,
+ "qcom,mdss-smp-mb-per-pipe", data);
+ mdata->smp_mb_per_pipe = (!rc ? data[0] : 0);
+
+ return 0;
}
static int mdss_mdp_parse_dt_misc(struct platform_device *pdev)
diff --git a/drivers/video/fbdev/msm/mdss_mdp_pipe.c b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
index c033781a8d5d..d1e5e64f6a82 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_pipe.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
@@ -193,6 +193,11 @@ int mdss_mdp_smp_reserve(struct mdss_mdp_pipe *pipe)
if (mdata->mdp_rev == MDSS_MDP_HW_REV_100)
num_blks = roundup_pow_of_two(num_blks);
+
+ if (mdata->smp_mb_per_pipe &&
+ (num_blks > mdata->smp_mb_per_pipe) &&
+ !(pipe->flags & MDP_FLIP_LR))
+ num_blks = mdata->smp_mb_per_pipe;
}
pr_debug("reserving %d mmb for pnum=%d plane=%d\n",