summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/msm
diff options
context:
space:
mode:
authorAdrian Salido-Moreno <adrianm@codeaurora.org>2013-05-29 14:09:59 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:17:33 -0700
commit5c68ca11bbd32b678243152085dbaa8e7fa4f6dd (patch)
tree029819f7c87135243ed8ac4cc6c661ae71c875d1 /drivers/video/fbdev/msm
parentaa249d992084d87c147dd9dbac37729be3b0417f (diff)
msm: mdss: fix SMP allocation size when using BWC
When using Bandwidth Compression, the size for Shared Memory Pool blocks allocation is calculated within helper function mdss_mdp_get_rau_strides and includes the lines to be fetched in RAU, there is no need to again account for these while reserving SMP blocks. Also this function should not include the meta data within RAU, this is only used to decompress the stream from memory but is dropped when storing stream in SMP. CRs-Fixed: 492113 Change-Id: I188736994b9038f74d13dc587d16a7b9445a7fbe Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev/msm')
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_pipe.c3
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_util.c13
2 files changed, 11 insertions, 5 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_pipe.c b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
index 4f9ab8102d2f..51ab2b69ec9f 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_pipe.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
@@ -163,9 +163,10 @@ int mdss_mdp_smp_reserve(struct mdss_mdp_pipe *pipe)
return rc;
}
+ nlines = pipe->bwc_mode ? 1 : 2;
+
mutex_lock(&mdss_mdp_smp_lock);
for (i = 0; i < ps.num_planes; i++) {
- nlines = pipe->bwc_mode ? ps.rau_h[i] : 2;
num_blks = DIV_ROUND_UP(nlines * ps.ystride[i], SMP_MB_SIZE);
if (mdata->mdp_rev == MDSS_MDP_HW_REV_100)
diff --git a/drivers/video/fbdev/msm/mdss_mdp_util.c b/drivers/video/fbdev/msm/mdss_mdp_util.c
index 299b51f44444..eaad685fbd3d 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_util.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_util.c
@@ -235,7 +235,6 @@ int mdss_mdp_get_rau_strides(u32 w, u32 h,
struct mdss_mdp_format_params *fmt,
struct mdss_mdp_plane_sizes *ps)
{
- u32 stride_off;
if (fmt->is_yuv) {
ps->rau_cnt = DIV_ROUND_UP(w, 64);
ps->ystride[0] = 64 * 4;
@@ -259,9 +258,8 @@ int mdss_mdp_get_rau_strides(u32 w, u32 h,
return -EINVAL;
}
- stride_off = DIV_ROUND_UP(ps->rau_cnt, 8);
- ps->ystride[0] = ps->ystride[0] * ps->rau_cnt + stride_off;
- ps->ystride[1] = ps->ystride[1] * ps->rau_cnt + stride_off;
+ ps->ystride[0] *= ps->rau_cnt;
+ ps->ystride[1] *= ps->rau_cnt;
ps->num_planes = 2;
return 0;
@@ -287,9 +285,16 @@ int mdss_mdp_get_plane_sizes(u32 format, u32 w, u32 h,
memset(ps, 0, sizeof(struct mdss_mdp_plane_sizes));
if (bwc_mode) {
+ u32 meta_size;
+
rc = mdss_mdp_get_rau_strides(w, h, fmt, ps);
if (rc)
return rc;
+
+ meta_size = DIV_ROUND_UP(ps->rau_cnt, 8);
+ ps->ystride[0] += meta_size;
+ ps->ystride[1] += meta_size;
+
ystride0_off = DIV_ROUND_UP(h, ps->rau_h[0]);
ystride1_off = DIV_ROUND_UP(h, ps->rau_h[1]);
ps->plane_size[0] = (ps->ystride[0] * ystride0_off) +