summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDhaval Patel <pdhaval@codeaurora.org>2015-02-16 15:41:23 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:38:09 -0700
commit06511bea72ad71030ec47b9e5c4aa18471ecc98d (patch)
tree1ce67d6765ded172d545c2ceb7909e6b1affd994
parentdd24186a13972cfbee10b994d6568a4c680bd2e0 (diff)
Revert "msm: mdss: store UBWC plane info in UBWC buffer format"
This reverts commit 37eb5c3f566e8fe554815b45e58b1992730f3e38. Storing UBWC planes in UBWC buffer format configures the wrong stride for meta planes and bitstream planes. It also tries to set the buffer address on each data_check call. This sets invalid Y bitstream address. Change-Id: I8e91f25a22ed9db278d7a334c4732d709566a32a Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_util.c64
1 files changed, 31 insertions, 33 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_util.c b/drivers/video/fbdev/msm/mdss_mdp_util.c
index 05351c86ec9e..179308e1d54c 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_util.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_util.c
@@ -343,27 +343,26 @@ static int mdss_mdp_get_ubwc_plane_size(struct mdss_mdp_format_params *fmt,
}
if (fmt->format == MDP_Y_CBCR_H2V2_UBWC) {
- int cf = COLOR_FMT_NV12_UBWC;
ps->num_planes = 4;
- /* Y meta data stride and plane size */
- ps->ystride[0] = VENUS_Y_META_STRIDE(cf, width);
- ps->plane_size[0] = ALIGN(ps->ystride[0] *
- VENUS_Y_META_SCANLINES(cf, height), 4096);
-
/* Y bitstream stride and plane size */
- ps->ystride[1] = VENUS_Y_STRIDE(cf, width);
- ps->plane_size[1] = ALIGN(ps->ystride[1] *
- VENUS_Y_SCANLINES(cf, height), 4096);
+ ps->ystride[0] = ALIGN(width, 128);
+ ps->plane_size[0] = ALIGN(ps->ystride[0] * ALIGN(height, 32),
+ 4096);
- /* CbCr meta data stride and plane size */
- ps->ystride[2] = VENUS_UV_META_STRIDE(cf, width);
+ /* CbCr bitstream stride and plane size */
+ ps->ystride[1] = ALIGN(width, 64);
+ ps->plane_size[1] = ALIGN(ps->ystride[1] * ALIGN(height, 32),
+ 4096);
+
+ /* Y meta data stride and plane size */
+ ps->ystride[2] = ALIGN(DIV_ROUND_UP(width, 32), 64);
ps->plane_size[2] = ALIGN(ps->ystride[2] *
- VENUS_UV_META_SCANLINES(cf, height), 4096);
+ ALIGN(DIV_ROUND_UP(height, 8), 16), 4096);
- /* CbCr bitstream stride and plane size */
- ps->ystride[3] = VENUS_UV_STRIDE(cf, width);
+ /* CbCr meta data stride and plane size */
+ ps->ystride[3] = ALIGN(DIV_ROUND_UP(width, 16), 64);
ps->plane_size[3] = ALIGN(ps->ystride[3] *
- VENUS_UV_SCANLINES(cf, height), 4096);
+ ALIGN(DIV_ROUND_UP(height, 8), 16), 4096);
} else if (fmt->format == MDP_RGBA_8888_UBWC ||
fmt->format == MDP_RGB_565_UBWC) {
@@ -371,16 +370,15 @@ static int mdss_mdp_get_ubwc_plane_size(struct mdss_mdp_format_params *fmt,
? 64 : 128;
ps->num_planes = 2;
- /* RGB meta data stride and plane size */
- ps->ystride[0] = ALIGN(DIV_ROUND_UP(width, 16), 64);
- ps->plane_size[0] = ALIGN(ps->ystride[0] *
- ALIGN(DIV_ROUND_UP(height, 4), 16), 4096);
-
/* RGB bitstream stride and plane size */
- ps->ystride[1] = ALIGN(width, stride_alignment);
- ps->plane_size[1] = ALIGN(4 * ps->ystride[1] *
+ ps->ystride[0] = ALIGN(width, stride_alignment);
+ ps->plane_size[0] = ALIGN(4 * ps->ystride[0] *
ALIGN(height, 16), 4096);
+ /* RGB meta data stride and plane size */
+ ps->ystride[2] = ALIGN(DIV_ROUND_UP(width, 16), 64);
+ ps->plane_size[2] = ALIGN(ps->ystride[2] *
+ ALIGN(DIV_ROUND_UP(height, 4), 16), 4096);
} else {
pr_err("%s: UBWC format not supported for fmt:%d\n",
__func__, fmt->format);
@@ -536,10 +534,10 @@ static int mdss_mdp_ubwc_data_check(struct mdss_mdp_data *data,
/* | Y meta | ** | Y bitstream | */
/* | data | ** | plane | */
/* ------------------- ** -------------------- */
- /* | Y bitstream | ** | CbCr bitstream | */
+ /* | CbCr meta | ** | CbCr bitstream | */
/* | data | ** | plane | */
/* ------------------- ** -------------------- */
- /* | CbCr meta | ** | Y meta | */
+ /* | Y bitstream | ** | Y meta | */
/* | data | ** | plane | */
/* ------------------- ** -------------------- */
/* | CbCr bitstream | ** | CbCr meta | */
@@ -548,22 +546,22 @@ static int mdss_mdp_ubwc_data_check(struct mdss_mdp_data *data,
/************************************************/
/* configure Y bitstream plane */
- data->p[0].addr = base_addr + ps->plane_size[0];
- data->p[0].len = ps->plane_size[1];
+ data->p[0].addr = base_addr + ps->plane_size[2];
+ data->p[0].len = ps->plane_size[0];
/* configure CbCr bitstream plane */
data->p[1].addr = base_addr + ps->plane_size[0]
+ ps->plane_size[1] + ps->plane_size[2];
- data->p[1].len = ps->plane_size[3];
+ data->p[1].len = ps->plane_size[1];
/* configure Y metadata plane */
data->p[2].addr = base_addr;
- data->p[2].len = ps->plane_size[0];
+ data->p[2].len = ps->plane_size[2];
/* configure CbCr metadata plane */
data->p[3].addr = base_addr + ps->plane_size[0]
- + ps->plane_size[1];
- data->p[3].len = ps->plane_size[2];
+ + ps->plane_size[2];
+ data->p[3].len = ps->plane_size[3];
} else {
/************************************************/
/* UBWC ** */
@@ -583,12 +581,12 @@ static int mdss_mdp_ubwc_data_check(struct mdss_mdp_data *data,
/************************************************/
/* configure RGB bitstream plane */
- data->p[0].addr = base_addr + ps->plane_size[0];
- data->p[0].len = ps->plane_size[1];
+ data->p[0].addr = base_addr + ps->plane_size[2];
+ data->p[0].len = ps->plane_size[0];
/* configure RGB metadata plane */
data->p[2].addr = base_addr;
- data->p[2].len = ps->plane_size[0];
+ data->p[2].len = ps->plane_size[2];
}
data->num_planes = ps->num_planes;
end: