hwc: Avoid MDP comp for RGB downscaled layer

- In targets with fewer pipes, composition switch can happen
  continuously for a layer based on whether it is updating or not.
  If that updating layer requires downscaling, because of the
  difference in the downscale filters between MDP and GPU,
  the output of MDP and GPU will differ. This difference could be
  perceived as flicker. To avoid this flicker, mark RGB downscaled layer
  with downscale more than threshold to GPU always.
- property persist.hwc.downscale_threshold defines the threshold value
  for downscale beyond which the layer will be marked for GPU composition.

Change-Id: Ifd26d7eb1eff0096b0391a0552d0fd97386c1a19
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index f0f8e77..59056b6 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -309,6 +309,7 @@
 bool isAlphaScaled(hwc_layer_1_t const* layer);
 bool needsScaling(hwc_layer_1_t const* layer);
 bool isDownscaleRequired(hwc_layer_1_t const* layer);
+bool isDownscaleWithinThreshold(hwc_layer_1_t const* layer, float threshold);
 bool needsScalingWithSplit(hwc_context_t* ctx, hwc_layer_1_t const* layer,
                            const int& dpy);
 void sanitizeSourceCrop(hwc_rect_t& cropL, hwc_rect_t& cropR,