From patchwork Sun Jun 1 13:42:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Jakobi X-Patchwork-Id: 4279431 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4A3A2BEEAA for ; Mon, 2 Jun 2014 00:52:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91E5F203AD for ; Mon, 2 Jun 2014 00:52:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D07D72039E for ; Mon, 2 Jun 2014 00:52:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BA1DE6E469; Sun, 1 Jun 2014 17:52:08 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.math.uni-bielefeld.de (smtp.math.uni-bielefeld.de [129.70.45.10]) by gabe.freedesktop.org (Postfix) with ESMTP id CE65989321 for ; Sun, 1 Jun 2014 06:43:01 -0700 (PDT) Received: from chidori.lan (ip-37-201-156-236.unitymediagroup.de [37.201.156.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by smtp.math.uni-bielefeld.de (Postfix) with ESMTPSA id 6A78360D3F; Sun, 1 Jun 2014 15:42:59 +0200 (CEST) From: Tobias Jakobi To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] exynos: fix G2D_DOUBLE_TO_FIXED for non-integer input Date: Sun, 1 Jun 2014 15:42:45 +0200 Message-Id: <1401630166-2969-2-git-send-email-tjakobi@math.uni-bielefeld.de> X-Mailer: git-send-email 1.8.5.5 In-Reply-To: <1401630166-2969-1-git-send-email-tjakobi@math.uni-bielefeld.de> References: <1401630166-2969-1-git-send-email-tjakobi@math.uni-bielefeld.de> X-Mailman-Approved-At: Sun, 01 Jun 2014 17:52:06 -0700 Cc: Tobias Jakobi X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. --- exynos/fimg2d.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exynos/fimg2d.h b/exynos/fimg2d.h index 1aac378..bc45ab5 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 */