From patchwork Thu Oct 3 20:00:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13821495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3EF90CF34C3 for ; Thu, 3 Oct 2024 20:01:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C04A10E8F2; Thu, 3 Oct 2024 20:01:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="hFYVe6bZ"; dkim-atps=neutral Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2069.outbound.protection.outlook.com [40.107.100.69]) by gabe.freedesktop.org (Postfix) with ESMTPS id CD25110E8EB; Thu, 3 Oct 2024 20:01:41 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DQR5xYzFBStR9KeFfD4NqImc82EBxa+CZ5oF9MvmKehiNWsMG/TKuk9XvWRphouNkWtxnDIuiB6cKKxevAV0BPvNP2q4XcUk3fNyfvMKcNHe9PC/bUondWatuYm/cbfcbipblzLVlm8/COO8xDXt4dnPo6u+nfkIW/FVS0Tsc5Hne2zgHRrqOyvkNnIO6w7xfW05fNd9NeK4mwATbMAT544owvFh+KBJvRnEq6XtPVd99VHmi5pzuTvh1hy6MphUBy3rLNm7YxeAleBS6X9BlWsabLYn0r4RUP3uYhVXybGazl1iUlg5uGKImx4ZbCdXsJezrj3N8DtDwDaq8gaItg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GKhFuF2R67lF3Fx3qUcWAp+7TtXF1wlCDOCZIn6ep4U=; b=yrQEJyj3soHt1zxI7i0woB5zAgbIuDsMX9JG9aRdWv1aXMTSXcKfDx/5GzeURt9aPL+4BSRlcadQqs5O9HWhT8mzOdUToPF4Gf8iWGi3kWYHon0ASA2hingLTlF+95/pJ4CpesB2oagwdTWmeFJPAHO2JCKS7SV5nizd/+VVO+OAUv66FwNbPqZ5fjxLLlkSzuhqxrxzC6un0WbmNvzYCYBO7M65wIzhr8vYcnB04Dpr6E1rqxUz2E5PBM50YzYE4nPjtBpWV6qzsO4aXo6XBq+MedjJ9B32WbMImW+kaCQId+s2fCO7oVxyrmhBike5tx+FiCb53MH7QwGuXdDUOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GKhFuF2R67lF3Fx3qUcWAp+7TtXF1wlCDOCZIn6ep4U=; b=hFYVe6bZYOECxLutabLoiOB8G7190Lq8aUrrlTfBKFf7f+vsAO4jPfIYHkHHBWtmwxgEKUqykruxZKRbNi0FvL/NJxifQXvv9qP8LM70yD62jBOFoi30dca2/gQlHF0SkF2V2RFiHEEz7jAhvgGzykmWiGUmx0mlr/lKD8Go1mo= Received: from CH0PR03CA0066.namprd03.prod.outlook.com (2603:10b6:610:cc::11) by MN0PR12MB5859.namprd12.prod.outlook.com (2603:10b6:208:37a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.16; Thu, 3 Oct 2024 20:01:37 +0000 Received: from CH2PEPF00000140.namprd02.prod.outlook.com (2603:10b6:610:cc:cafe::1) by CH0PR03CA0066.outlook.office365.com (2603:10b6:610:cc::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.17 via Frontend Transport; Thu, 3 Oct 2024 20:01:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CH2PEPF00000140.mail.protection.outlook.com (10.167.244.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Thu, 3 Oct 2024 20:01:37 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 3 Oct 2024 15:01:33 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 3 Oct 2024 15:01:34 -0500 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 3 Oct 2024 15:01:33 -0500 From: Harry Wentland To: , CC: , Harry Wentland , Louis Chauvet Subject: [PATCH v6 02/44] drm/vkms: Round fixp2int conversion in lerp_u16 Date: Thu, 3 Oct 2024 16:00:44 -0400 Message-ID: <20241003200129.1732122-3-harry.wentland@amd.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241003200129.1732122-1-harry.wentland@amd.com> References: <20241003200129.1732122-1-harry.wentland@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: harry.wentland@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF00000140:EE_|MN0PR12MB5859:EE_ X-MS-Office365-Filtering-Correlation-Id: 508d94bd-86fe-4150-af5e-08dce3e6303e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: i5IUu61E+iCtzkvDRvirIEfe2YQ9K7pxZ63q4icrncxOs/zAL8ILG+hCzQtENbqw2XGzTUGgRxnbWD/oKlKnTpv/Hja4JsVP3lxkjF0GehXBgA3LjlSDoK3V1h550z5TsDAqvRR+SgVyzpsXjM6/sGuBdckCU1LlFZU49Hz7gNkQKmOfbl8usY6/eQQhABP1geAkaT6g1Lm5Sr83+QrGPJYoD8GtK0KoG/6CaMEQ2LQIx+EHK7aJMv1GDlWJY50wEh1mYGaVyiwYU8JIy8ltCJR68z6lXQUVZ5ZYmksc11n7+KEDd8MysU7+L++y+vQzKoLb/rvAhrecbsZ20/94WB49qlFDiqE+94jEiWwrfcNzbbi6zlrv/q0LvRFefjIWwhy9YOm1URDaxERbUn+sHOH9bIobv5wGlJvu/CTjFk1N4+aZ1Q+YhAIyppWwlqSoa7r70Xe4lWfU0OBGWH16bkXJUyYyGd5vuAqTXYtRCTdYHvcb9rHm8AJr6nxywcwSEQPBzOB/Oc81w8P6eY6RBB/W1j4iT9Gth1eCB9XfI2LxjEQHRHWHdnT474O+JqZqp1Bvbt65qqHOk9I7o0dGfRg6m1nFb+PZc9HpFfN0euJl+D8pBFGKFt9DhI25nZD6mQsraRZwJ3bg0alPA28lhbt1SvoJ8jsKNjnhz0QeFWkz6jGH/c8wNM6jv5+xrkJ7CMs1aVSfdsHT0Y9se3Oeqc3sUcaFnfK4EbbHlviYYpa9IdQLUBFOKrmagIxGo9qdSr0C6Gb4i9mvJMwFK99IJp+I+GDiM52tC1YPpzrL8DBuvjqvBcRJl4CJl86O9bcjo3Xp/Om3oyvCKeci3qmHRjK4hNXIVXAu6l3LPj7HNegipfCiquEGO7d02o3sdS0DLn6rRx/4BLXu6/mAevsDXJvb0l08dYOeYTXf3yPobkM6FBQ1dhlYVil6JSwYUJgK9f6yUapFXK6H3VaO8Pn4OlXKmiFDRASv3XhmJwg3zqpG8Qjfptp8LJrCDUJqCyWONr6phgTrjx/lXisgdyWqK1N3DwJxgJdtaLEc+Uyf1gGnPrwKUuPbiUBip1+2jTvzhNO6G7pHizGw4trGnkoI/GWSWQDk97L/nwPn+Fl+WD85su1u2Oh87iKaVdOzUqAX7ivjVQFc26vhpl5JeRf/9aqVHqxLTNWBA0OvaXhXB8TgFlwIp85i+X9ki3Eum4nWbt+figFOJq5Jby74FVOOi608u1h3AixNCg2T4ul+GCsiEHW6NqzaQgL8KZEeQHrtHEAQcm1vkDDInKGffRwcHLbOQVMqurs3bqCfqg5fDm7eDD0Gxdgj6nyiWnFyH4XinHlEtQkdCWX5oBM/CjgA453QmMkAwQm/Z1JcpvTl1G5qZxskPS6+3cNf4DgRcrIf X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2024 20:01:37.0070 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 508d94bd-86fe-4150-af5e-08dce3e6303e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF00000140.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5859 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" fixp2int always rounds down, fixp2int_ceil rounds up. We need the new fixp2int_round. Signed-off-by: Harry Wentland Reviewed-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c index e7441b227b3c..3d6785d081f2 100644 --- a/drivers/gpu/drm/vkms/vkms_composer.c +++ b/drivers/gpu/drm/vkms/vkms_composer.c @@ -98,7 +98,7 @@ static u16 lerp_u16(u16 a, u16 b, s64 t) s64 delta = drm_fixp_mul(b_fp - a_fp, t); - return drm_fixp2int(a_fp + delta); + return drm_fixp2int_round(a_fp + delta); } static s64 get_lut_index(const struct vkms_color_lut *lut, u16 channel_value)