hwc/overlay: MDSS driver requires 4-aligned crop.h for interlaced
MDSS driver requires the crop height to be multiple of 4 to
de-interlace the interlaced Yuv content.
CRs-Fixed: 491488
Change-Id: I9a95392a71cca217e2890c9736f1450fd8aa4a59
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 16c2c8f..b598d0b 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -763,6 +763,9 @@
if (ovutils::isYuv(whf.format)) {
ovutils::normalizeCrop((uint32_t&)crop.left, crop_w);
ovutils::normalizeCrop((uint32_t&)crop.top, crop_h);
+ // For interlaced, crop.h should be 4-aligned
+ if ((mdpFlags & ovutils::OV_MDP_DEINTERLACE) && (crop_h % 4))
+ crop_h = ovutils::aligndown(crop_h, 4);
crop.right = crop.left + crop_w;
crop.bottom = crop.top + crop_h;
}