summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamkumar Radhakrishnan <ramkumar@codeaurora.org>2016-05-06 15:19:03 -0700
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-09 18:35:30 -0700
commite5617d8758aaf325832ff90977c82aea0fd0a33e (patch)
tree765608d8e15d36cb2a6ec0d8659ea194b5b74b2a
parent3f6bd88967d7af58d55a1003a85315411e9aea2a (diff)
msm: mdss: align yuv bitstream plane size and stride appropriately.
Add align function to align the values to non power of 2 and align yuv bitstream plane size and stride appropriately. Change-Id: I40695e9e7a99fe7c814d26fa7b5205370b7f9f64 CRs-Fixed: 997601 Signed-off-by: Ramkumar Radhakrishnan <ramkumar@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_util.c b/drivers/video/fbdev/msm/mdss_mdp_util.c
index 20bbfcedaad4..87a14c425af9 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_util.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_util.c
@@ -31,6 +31,7 @@
#include "mdss_panel.h"
#define PHY_ADDR_4G (1ULL<<32)
+#define ALIGN_UP(x, align) ((DIV_ROUND_UP((x), (align))) * (align))
void mdss_mdp_format_flag_removal(u32 *table, u32 num, u32 remove_bits)
{
@@ -453,13 +454,13 @@ static int mdss_mdp_get_ubwc_plane_size(struct mdss_mdp_format_params *fmt,
}
/* Y bitstream stride and plane size */
- ps->ystride[0] = ALIGN(width, y_stride_alignment);
+ ps->ystride[0] = ALIGN_UP(width, y_stride_alignment);
ps->ystride[0] = (ps->ystride[0] * y_bpp_numer) / y_bpp_denom;
ps->plane_size[0] = ALIGN(ps->ystride[0] *
ALIGN(height, y_height_alignment), 4096);
/* CbCr bitstream stride and plane size */
- ps->ystride[1] = ALIGN(width / 2, uv_stride_alignment);
+ ps->ystride[1] = ALIGN_UP(width / 2, uv_stride_alignment);
ps->ystride[1] = (ps->ystride[1] * uv_bpp_numer) / uv_bpp_denom;
ps->plane_size[1] = ALIGN(ps->ystride[1] *
ALIGN(height / 2, uv_height_alignment), 4096);