hwc: Fix Bwc policy's decimation check.
In decimation checks of BWC, take log, since a value > 0 and <= 1
doesn't mean decimation will be used.
Change-Id: I2a518e9021a814d3a65e3db793abbb1eb433120a
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index b0ea0fc..0e1638c 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -18,6 +18,7 @@
* limitations under the License.
*/
#define HWC_UTILS_DEBUG 0
+#include <math.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <binder/IServiceManager.h>
@@ -1109,9 +1110,16 @@
}
float horDscale = 0.0f;
float verDscale = 0.0f;
+ int horzDeci = 0;
+ int vertDeci = 0;
ovutils::getDecimationFactor(src_w, src_h, dst_w, dst_h, horDscale,
verDscale);
- if(horDscale || verDscale) return;
+ //TODO Use log2f once math.h has it
+ if((int)horDscale)
+ horzDeci = (int)(log(horDscale) / log(2));
+ if((int)verDscale)
+ vertDeci = (int)(log(verDscale) / log(2));
+ if(horzDeci || vertDeci) return;
}
//Property
char value[PROPERTY_VALUE_MAX];