From: Tobias Jakobi Date: Sun, 1 Jun 2014 16:04:05 +0000 (+0200) Subject: exynos: fix G2D_DOUBLE_TO_FIXED for non-integer input X-Git-Tag: libdrm-2.4.55~5 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Flibdrm.git;a=commitdiff_plain;h=3001c232d14a07153c36a0722e196041d6536d30 exynos: fix G2D_DOUBLE_TO_FIXED for non-integer input The hardware accepts scaling factors formatted in a fixed-point format. The current macro casts to integer first, then multiplies by the fp conversion factor. This does not make any sense. In particular, truly 'fractional' inputs, like 1.5, won't work that way. Signed-off-by: Tobias Jakobi Signed-off-by: Inki Dae --- diff --git a/exynos/fimg2d.h b/exynos/fimg2d.h index 1aac378..4785e2f 100644 --- a/exynos/fimg2d.h +++ b/exynos/fimg2d.h @@ -25,7 +25,7 @@ #define G2D_MAX_CMD_LIST_NR 64 #define G2D_PLANE_MAX_NR 2 -#define G2D_DOUBLE_TO_FIXED(d) ((unsigned int)(d) * 65536.0) +#define G2D_DOUBLE_TO_FIXED(d) ((unsigned int)((d) * 65536.0)) enum e_g2d_color_mode { /* COLOR FORMAT */