From: Greg Hackmann Date: Fri, 27 Sep 2013 17:23:41 +0000 (-0700) Subject: hwc: do not allow gsc downscaling by exactly max_downscale X-Git-Tag: cm-11.0-XNPH22R-bacon-03d77315ea~1^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c0b4a4f1a8b088964ded32dfee294b9199c71534;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos5.git hwc: do not allow gsc downscaling by exactly max_downscale The Gscaler registers do not have enough bits to represent downscaling by exactly 16x Bug: 10946861 Change-Id: I6a9921193d9188bca2344815c29863c550c5e3dd Signed-off-by: Greg Hackmann --- diff --git a/libhwc/hwc.cpp b/libhwc/hwc.cpp index d5a7603..546b047 100644 --- a/libhwc/hwc.cpp +++ b/libhwc/hwc.cpp @@ -401,11 +401,11 @@ static bool exynos5_supports_gscaler(hwc_layer_1_t &layer, int format, dst_crop_w_aligned(dest_w) && handle->stride <= max_w && handle->stride % GSC_W_ALIGNMENT == 0 && - src_w <= dest_w * max_downscale && + src_w < dest_w * max_downscale && dest_w <= src_w * max_upscale && handle->vstride <= max_h && handle->vstride % GSC_H_ALIGNMENT == 0 && - src_h <= dest_h * max_downscale && + src_h < dest_h * max_downscale && dest_h <= src_h * max_upscale && // per 46.2 (!rot90or270 || layer.sourceCrop.top % 2 == 0) &&