Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6106fc7b authored by Ramkumar Radhakrishnan's avatar Ramkumar Radhakrishnan Committed by Animesh Kishore
Browse files

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: default avatarRamkumar Radhakrishnan <ramkumar@codeaurora.org>
parent 65ca63e7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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)
{
@@ -451,13 +452,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);