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

Commit 045eeb21 authored by Benjamin Chan's avatar Benjamin Chan Committed by Narendra Muppalla
Browse files

msm: sde: Correct bandwidth for TP10 and P010 in SDE rotator



Bandwidth calculation for TP10 and P010 needs special adjustment because
both formats does not fall into the normal 8bit sample size. Current
calculation for TP10 and P010 will have lower bandwidth request than
expected value and will affect rotation performace.

CRs-Fixed: 2003069
Change-Id: Iafce4f2b70a16b46311f3ee2a29e286d3cbb5340
Signed-off-by: default avatarBenjamin Chan <bkchan@codeaurora.org>
Signed-off-by: default avatarNarendra Muppalla <NarendraM@codeaurora.org>
parent 1b94f950
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -1137,10 +1137,16 @@ static u32 sde_rotator_calc_buf_bw(struct sde_mdp_format_params *fmt,
	u32 bw;
	u32 bw;


	bw = width * height * frame_rate;
	bw = width * height * frame_rate;
	if (fmt->chroma_sample == SDE_MDP_CHROMA_420)

	if (sde_mdp_is_tp10_format(fmt))
		bw *= 2;
	else if (sde_mdp_is_p010_format(fmt))
		bw *= 3;
	else if (fmt->chroma_sample == SDE_MDP_CHROMA_420)
		bw = (bw * 3) / 2;
		bw = (bw * 3) / 2;
	else
	else
		bw *= fmt->bpp;
		bw *= fmt->bpp;
	SDEROT_EVTLOG(bw, width, height, frame_rate, fmt->format);
	return bw;
	return bw;
}
}


+27 −3
Original line number Original line Diff line number Diff line
/* Copyright (c) 2012, 2015-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2015-2017, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -124,10 +124,34 @@ static inline bool sde_mdp_is_linear_format(struct sde_mdp_format_params *fmt)
	return fmt && (fmt->frame_format == SDE_MDP_FMT_LINEAR);
	return fmt && (fmt->frame_format == SDE_MDP_FMT_LINEAR);
}
}


static inline bool sde_mdp_is_nv12_format(struct sde_mdp_format_params *fmt)
{
	return fmt && (fmt->fetch_planes == SDE_MDP_PLANE_PSEUDO_PLANAR) &&
			(fmt->chroma_sample == SDE_MDP_CHROMA_420);
}

static inline bool sde_mdp_is_nv12_8b_format(struct sde_mdp_format_params *fmt)
{
	return fmt && sde_mdp_is_nv12_format(fmt) &&
			(fmt->pixel_mode == SDE_MDP_PIXEL_NORMAL);
}

static inline bool sde_mdp_is_nv12_10b_format(struct sde_mdp_format_params *fmt)
{
	return fmt && sde_mdp_is_nv12_format(fmt) &&
			(fmt->pixel_mode == SDE_MDP_PIXEL_10BIT);
}

static inline bool sde_mdp_is_tp10_format(struct sde_mdp_format_params *fmt)
static inline bool sde_mdp_is_tp10_format(struct sde_mdp_format_params *fmt)
{
{
	return fmt && ((fmt->format == SDE_PIX_FMT_Y_CBCR_H2V2_TP10_UBWC) ||
	return fmt && sde_mdp_is_nv12_10b_format(fmt) &&
			(fmt->format == SDE_PIX_FMT_Y_CBCR_H2V2_TP10));
			fmt->unpack_tight;
}

static inline bool sde_mdp_is_p010_format(struct sde_mdp_format_params *fmt)
{
	return fmt && sde_mdp_is_nv12_10b_format(fmt) &&
			!fmt->unpack_tight;
}
}


static inline bool sde_mdp_is_yuv_format(struct sde_mdp_format_params *fmt)
static inline bool sde_mdp_is_yuv_format(struct sde_mdp_format_params *fmt)