hwc: Punt layers with non integral source crop
The MDP driver cannot handle such layers right now. Investigate
doing this with pixel phase in the future.
Change-Id: Iabbdd0285234160770ae5a799b07a5b912e5fde3
(cherry picked from commit e6aff6414ba478312d9d4af21ab63d586594009f)
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index ebfa22e..ef77567 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -292,6 +292,10 @@
return false;
}
+ //XXX: Investigate doing this with pixel phase on MDSS
+ if(isNonIntegralSourceCrop(layer->sourceCropf))
+ return false;
+
int hw_w = ctx->dpyAttr[mDpy].xres;
int hw_h = ctx->dpyAttr[mDpy].yres;
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index d1fbad8..93d65c5 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -173,6 +173,16 @@
return cropI;
}
+inline bool isNonIntegralSourceCrop(const hwc_frect_t& cropF) {
+ if(cropF.left - roundf(cropF.left) ||
+ cropF.top - roundf(cropF.top) ||
+ cropF.right - roundf(cropF.right) ||
+ cropF.bottom - roundf(cropF.bottom))
+ return true;
+ else
+ return false;
+}
+
// -----------------------------------------------------------------------------
// Utility functions - implemented in hwc_utils.cpp
void dumpLayer(hwc_layer_1_t const* l);