Commit cedb733d authored by Naseer Ahmed's avatar Naseer Ahmed

msm: rotator: Add proper checks for enabling Fast YUV

For rotator version 2.0 and above, there is support for fast
YUV which gives better rotator performance. However, there are
few constraints related to height under which fast YUV cannot be
enabled when 90 degree rotation is enabled. Make sure
to add proper checks before enabling fast YUV.

Change-Id: Iafd204a6e4ef09e1151d01d8fde35359b7c3b7a5
Signed-off-by: default avatarPadmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: default avatarNaseer Ahmed <naseer@codeaurora.org>
Bug: 19043183
parent d134b60b
......@@ -735,6 +735,7 @@ static int msm_rotator_get_plane_sizes(uint32_t format, uint32_t w, uint32_t h,
uint32_t fast_yuv_invalid_size_checker(unsigned char rot_mode,
uint32_t src_width,
uint32_t dst_width,
uint32_t src_height,
uint32_t dst_height,
uint32_t dstp0_ystride,
uint32_t is_planar420)
......@@ -749,6 +750,9 @@ uint32_t fast_yuv_invalid_size_checker(unsigned char rot_mode,
if (rot_mode & MDP_ROT_90) {
if ((src_height % 128) == 8)
return -EINVAL;
/* if rotation 90 degree on fast yuv
* rotator image input width has to be multiple of 8
* rotator image input height has to be multiple of 8
......@@ -801,9 +805,9 @@ uint32_t fast_yuv_invalid_size_checker(unsigned char rot_mode,
} else {
/* if NOT applying rotation 90 degree on fast yuv,
* rotator image input width has to be multiple of 8
* rotator image input height has to be multiple of 2
* rotator image input height has to be multiple of 8
*/
if (((dst_width % 8) != 0) || ((dst_height % 2) != 0))
if (((dst_width % 8) != 0) || ((dst_height % 8) != 0))
return -EINVAL;
}
......@@ -1957,6 +1961,7 @@ static int msm_rotator_start(unsigned long arg,
fast_yuv_en = !fast_yuv_invalid_size_checker(
info.rotations,
info.src.width,
info.src.height,
dst_w,
dst_h,
dst_w,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment