diff mbox

[v2,2/3] exynos: fix G2D_DOUBLE_TO_FIXED for non-integer input

Message ID 1401638646-4039-2-git-send-email-tjakobi@math.uni-bielefeld.de (mailing list archive)
State New, archived
Headers show

Commit Message

Tobias Jakobi June 1, 2014, 4:04 p.m. UTC
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 <tjakobi@math.uni-bielefeld.de>
---
 exynos/fimg2d.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Inki Dae June 13, 2014, 5:05 a.m. UTC | #1
On 2014? 06? 02? 01:04, Tobias Jakobi wrote:
> 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: Inki Dae <inki.dae@samsung.com>

Thanks,
Inki Dae

> 
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
>  exynos/fimg2d.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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 */
>
diff mbox

Patch

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 */