hwc: Add check for YUV formats in configRotator.
Since configRotator gets called from FBUpdate for non-YUV layer,
check for YUV formats is required.
Change-Id: Idaef9d9b650499f8a0342ddfc04e1f55c9b75f73
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 20cdf72..cc0be09 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -759,10 +759,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);
}