Merge "hwc: Add check for YUV formats in configRotator."
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index ca6d489..16c2c8f 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -760,10 +760,12 @@
qdutils::MDSS_V5) {
uint32_t crop_w = (crop.right - crop.left);
uint32_t crop_h = (crop.bottom - crop.top);
- ovutils::normalizeCrop((uint32_t&)crop.left, crop_w);
- ovutils::normalizeCrop((uint32_t&)crop.top, crop_h);
- crop.right = crop.left + crop_w;
- crop.bottom = crop.top + crop_h;
+ if (ovutils::isYuv(whf.format)) {
+ ovutils::normalizeCrop((uint32_t&)crop.left, crop_w);
+ ovutils::normalizeCrop((uint32_t&)crop.top, crop_h);
+ crop.right = crop.left + crop_w;
+ crop.bottom = crop.top + crop_h;
+ }
Dim rotCrop(crop.left, crop.top, crop_w, crop_h);
rot->setCrop(rotCrop);
}