summaryrefslogtreecommitdiff
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
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>
-rw-r--r--Documentation/devicetree/bindings/fb/mdss-mdp.txt6
-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
4 files changed, 20 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/fb/mdss-mdp.txt b/Documentation/devicetree/bindings/fb/mdss-mdp.txt
index 514160e21d0a..7093fb849638 100644
--- a/Documentation/devicetree/bindings/fb/mdss-mdp.txt
+++ b/Documentation/devicetree/bindings/fb/mdss-mdp.txt
@@ -126,6 +126,11 @@ Optional properties:
- qcom,mdss-has-wfd-blk: Boolean property to indicate the presence of dedicated
writeback wfd block in MDSS as opposed to writeback
block that is shared between rotator and wfd.
+- qcom,mdss-smp-mb-per-pipe: Maximum number of shared memory pool blocks
+ restricted for a source surface pipe. If this
+ property is not specified, no such restriction
+ would be applied.
+
Optional subnodes:
Child nodes representing the frame buffer virtual devices.
@@ -161,6 +166,7 @@ Example:
qcom,mdss-pipe-dma-fetch-id = <10 13>;
qcom,mdss-smp-data = <22 4096>;
qcom,mdss-rot-block-size = <64>;
+ qcom,mdss-smp-mb-per-pipe = <2>;
qcom,mdss-has-bwc;
qcom,mdss-has-decimation;
qcom,mdss-has-wfd-blk;
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",