hwc: Add BWC policy manager
Add a BWC policy manager that decides if BWC needs to be disabled on
certain conditions.
These conditions are statically determined. BWC might get used and
still fail (or cause failure of subsequent pipe requests) if SMP
blocks are not sufficient.
Change-Id: I805738911a8da7dfc6232c133c74ef844c3af5b1
diff --git a/liboverlay/overlayMdp.cpp b/liboverlay/overlayMdp.cpp
index 3e75d4e..2abdc19 100644
--- a/liboverlay/overlayMdp.cpp
+++ b/liboverlay/overlayMdp.cpp
@@ -144,19 +144,11 @@
minHorDeci = 2;
}
- float horDscale = ceilf((float)mOVInfo.src_rect.w /
- (float)mOVInfo.dst_rect.w);
- float verDscale = ceilf((float)mOVInfo.src_rect.h /
- (float)mOVInfo.dst_rect.h);
+ float horDscale = 0.0f;
+ float verDscale = 0.0f;
- //Next power of 2, if not already
- horDscale = powf(2.0f, ceilf(log2f(horDscale)));
- verDscale = powf(2.0f, ceilf(log2f(verDscale)));
-
- //Since MDP can do 1/4 dscale and has better quality, split the task
- //between decimator and MDP downscale
- horDscale /= 4.0f;
- verDscale /= 4.0f;
+ utils::getDecimationFactor(mOVInfo.src_rect.w, mOVInfo.src_rect.h,
+ mOVInfo.dst_rect.w, mOVInfo.dst_rect.h, horDscale, verDscale);
if(horDscale < minHorDeci)
horDscale = minHorDeci;