Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp503380pxb; Mon, 7 Feb 2022 17:08:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2j0ASzOXaLj03bB9yPiGF9cigHfUx2F4Y2fjEkiRI+6PwY/qgQ8/zIjNpW0OgyYQ+Rtp5 X-Received: by 2002:a05:6402:510b:: with SMTP id m11mr2036976edd.203.1644282523272; Mon, 07 Feb 2022 17:08:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644282523; cv=pass; d=google.com; s=arc-20160816; b=tWp35Zb4Wz6USaC0InjIMWyOdxVA67HOqDMXfY3RVGyMmuIq6pNuJ1k9acukhwtcN8 A4PYvvUr6dgR6FYbmEMq/ut6AolOKWYnqbZ4gM41YFUP7N9Z6YBmjNyq16t3tsBq0NKX K1dWxPvcW7qzq9YRoCQLRO37fAdTpVk0Ut0HfHFiw1FF2CXlmhx0w8e1aeg81OC+9c4c epjib6NV8rVHfdSSp0ZWILHGJ/Cy0ay853+G934tSaJRjL7NRrtZ1CY8R2Mey07zNOND fuZV8to8lpwIyXEYQjGFmDP1RudurmvKb8Xz8eCUDnlvtNnej7Ixwgn5CgnwzBv69qZm k0Vg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=t9Zd1dc31B2ptklV5TBhUXuMMqIr5qAkzJ4cgOkdmpo=; b=kFvXonsoWfUaEjXlKuUTbYJEMLmhaTIVYG7dfiA3WfB5b9amQm7GlaOfU7amcCnDI8 P+WSTfwXlVospT2773zyxkyTc1Wx6W6jwtwS2wxMa7xmKESAbfdzT1o8p41SJdpWEnHr kcF3VtuhX3kn0J9A3YYm1/PkG26+Ov8S0CAe9UcJX6rHfKgICUviI/o3iwGw9pRwLg8l ESHpuyiyM44E4AXw/HaKGvQNxhfXKZQPYxb91KbISuJG3k+a2JpCbB3khDyKipH09Ebl G667cJ7UPdTExLLhZH5+tvyZKiQKQdmimYhLNg00ABfeEWsRgTL/QFSLkUChOKiAHhbB R5yg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@de.bosch.com header.s=selector1 header.b="QvO/r1ag"; arc=pass (i=1 spf=pass spfdomain=de.bosch.com dmarc=pass fromdomain=de.bosch.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=de.bosch.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j21si7306379ejj.17.2022.02.07.17.08.18; Mon, 07 Feb 2022 17:08:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@de.bosch.com header.s=selector1 header.b="QvO/r1ag"; arc=pass (i=1 spf=pass spfdomain=de.bosch.com dmarc=pass fromdomain=de.bosch.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=de.bosch.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376315AbiBGPaD (ORCPT + 99 others); Mon, 7 Feb 2022 10:30:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442893AbiBGPPW (ORCPT ); Mon, 7 Feb 2022 10:15:22 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70072.outbound.protection.outlook.com [40.107.7.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AA3BC03FEF4 for ; Mon, 7 Feb 2022 07:14:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NAiSOVzHN+qsrO/hS2gt7BBfTZEpOaUelKbWS7jrLbrXrmugBGcpD2QM2akWh9MCtOnoNeQhisaW1HREaQyB/rE+3O7NE1tSqGz0Sk6juTXis1OmBALJIHPpC/BUCz2/+bREo1uTRlryNMKGZLJPeaaxt9+59Zp15XsVDnT5aH1IoTcT5P9Jv+IVenRbvV3KS5JDtwYYiHJwG8/7IblMAO7IfFzDnb8tlQokyEvmt4y47ieVOA2BcaeRf5wxlIPVGtg/BWQUsT+8VE7YMSSjECpOwlp7zdpHlQgXyA9byhDTw0R4KsuEV0YFCRugjumtUZtJHcUGALfAHiYsleXJjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=t9Zd1dc31B2ptklV5TBhUXuMMqIr5qAkzJ4cgOkdmpo=; b=NyO8AWdiMOr8DMcJ2stsRwnzvHgSWssrtfWlviqvTzv/eUXA/KVKcHfVpOTP1ZGGPSxNb5wros6TOdBF/PA11fNuuWMZmRK6KIcxOw8Uvk9EyZ5F+VG+uIxJhZKuBE7jzzC86fw6aRRN6Q45LHnCsdV0lr8tMe/LBa/mSFWPkrixE8lUKkTR6I+f9mNPBZ/TUy/OKbUn/oOr49kiFDq5DVFC5I/RGVaGa1FxsYh5a2diol1C3EOKjpkz/NPf5H+mWPJkwlyl0ateAMGqOJwV8wI/q9PlYeuDB6IchZoxLJ5ltTcJaSUTzH0fC5s2V/NDhBD2aZZwZ6TJFpOhs4zvvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 139.15.153.201) smtp.rcpttodomain=pengutronix.de smtp.mailfrom=de.bosch.com; dmarc=pass (p=reject sp=none pct=100) action=none header.from=de.bosch.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=de.bosch.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t9Zd1dc31B2ptklV5TBhUXuMMqIr5qAkzJ4cgOkdmpo=; b=QvO/r1agdYlLaxvLWWWoWur9p8kR8iXE7EuWL1SienKCAazs9/pL9uWpPb9ENqrgzAWX0yndjBdn5uUenCH21Mz9Mclri+t1F7UHvePX0GoxMNlSefJzGN4LfY/EjmYfoxwxX0S3MsPVUPaHJWV2LIsWF4lwLsLuRfCsEZpHFhs= Received: from AS9PR06CA0154.eurprd06.prod.outlook.com (2603:10a6:20b:45c::28) by DB9PR10MB4443.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:226::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Mon, 7 Feb 2022 15:14:53 +0000 Received: from AM5EUR03FT052.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:45c:cafe::19) by AS9PR06CA0154.outlook.office365.com (2603:10a6:20b:45c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17 via Frontend Transport; Mon, 7 Feb 2022 15:14:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 139.15.153.201) smtp.mailfrom=de.bosch.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=de.bosch.com; Received-SPF: Pass (protection.outlook.com: domain of de.bosch.com designates 139.15.153.201 as permitted sender) receiver=protection.outlook.com; client-ip=139.15.153.201; helo=eop.bosch-org.com; Received: from eop.bosch-org.com (139.15.153.201) by AM5EUR03FT052.mail.protection.outlook.com (10.152.17.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Mon, 7 Feb 2022 15:14:53 +0000 Received: from SI-EXCAS2000.de.bosch.com (10.139.217.201) by eop.bosch-org.com (139.15.153.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.18; Mon, 7 Feb 2022 16:14:45 +0100 Received: from SI-HUB2000.de.bosch.com (10.4.103.108) by SI-EXCAS2000.de.bosch.com (10.139.217.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.18; Mon, 7 Feb 2022 16:14:45 +0100 Received: from luchador.grb-fir.grb.de.bosch.com (10.19.187.97) by SI-HUB2000.de.bosch.com (10.4.103.108) with Microsoft SMTP Server id 15.1.2375.18; Mon, 7 Feb 2022 16:14:45 +0100 From: Mark Jonas To: Philipp Zabel , David Airlie , Daniel Vetter CC: , , , Subject: [PATCH] gpu: ipu-v3: Fix dev_dbg frequency output Date: Mon, 7 Feb 2022 16:14:11 +0100 Message-ID: <20220207151411.5009-1-mark.jonas@de.bosch.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: df01d6af-efc0-48c5-8784-08d9ea4c97ac X-MS-TrafficTypeDiagnostic: DB9PR10MB4443:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:192; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d/48mt/R01x6n/QoTd7OpCBqoNvm3ALxULFSwgi7mgNnxExoKfebsBaQG7EDnNBX/4UkoNOa9WJmi6WJkHZAj4oc4vTaFCSDxZKcNWeEqx+WKEqIlZP7iK6Brb7iy3WgH1n2rm4DNi6OTotypFMcGbae82AgWAzz99BjHgIdMwN5hftU0ArPDNgpwS3VG+xTROGbqpBPvzUXcj2ymuxe52LBfBAJlXbiCBj4iQCFgy+74NTViPOfiJwDFKf453Kl1BQmHu8wjxhynQDoWTSX3xdksAiTNZoqTialeQ6qb02EwGQEUDnv8FkbwaX9wg47t8M5eAUw3MQMBWx5lfLdxbKUFTsu41NRBYaD3RbBozDTLanxlynNawSLfcz0lX/pjB0SvKdpF8IJE8Kf84bymqEZWzV9x2hSIdIhuoTlC1seH8PBy4SgwE1HynT9CJP/GN4aBnZ9cJCXvZ768PVFnDvhSy6HgkwMS0EUHYyFywKiu4zQ41I30/VJS+dSs0Le7CovL/VOQvjW6sbC43xBX2Ng/QKszlnUce1Wrt+kq9EDSUWsALuDMQuhronKdpMVVhio491xBhjnjoyEeby5YBuas3tmWAGAdK5aCcdwZlh1h1Uydcpaog+nE8uwQjfbqm0uN1L7GSCoOq2bDs4k2yg8U5DmKt31zb3sPC0Nkim0ZT8YMrWp/L7cgBUxDzZm46jkExtL7Y/W8B64DPu2cQ== X-Forefront-Antispam-Report: CIP:139.15.153.201;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:eop.bosch-org.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(47076005)(4326008)(36860700001)(70206006)(7696005)(8936002)(8676002)(70586007)(316002)(107886003)(82310400004)(86362001)(54906003)(110136005)(2906002)(2616005)(6666004)(508600001)(40460700003)(81166007)(336012)(26005)(83380400001)(356005)(186003)(1076003)(82960400001)(44832011)(426003)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: de.bosch.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2022 15:14:53.1778 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df01d6af-efc0-48c5-8784-08d9ea4c97ac X-MS-Exchange-CrossTenant-Id: 0ae51e19-07c8-4e4b-bb6d-648ee58410f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0ae51e19-07c8-4e4b-bb6d-648ee58410f4;Ip=[139.15.153.201];Helo=[eop.bosch-org.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT052.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR10MB4443 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leo Ruan This commit corrects the printing of the IPU clock error percentage if it is between -0.1% to -0.9%. For example, if the pixel clock requested is 27.2 MHz but only 27.0 MHz can be achieved the deviation is -0.8%. But the fixed point math had a flaw and calculated error of 0.2%. Before: Clocks: IPU 270000000Hz DI 24716667Hz Needed 27200000Hz IPU clock can give 27000000 with divider 10, error 0.2% Want 27200000Hz IPU 270000000Hz DI 24716667Hz using IPU, 27000000Hz After: Clocks: IPU 270000000Hz DI 24716667Hz Needed 27200000Hz IPU clock can give 27000000 with divider 10, error -0.8% Want 27200000Hz IPU 270000000Hz DI 24716667Hz using IPU, 27000000Hz Signed-off-by: Leo Ruan Signed-off-by: Mark Jonas --- drivers/gpu/ipu-v3/ipu-di.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-di.c b/drivers/gpu/ipu-v3/ipu-di.c index b4a31d506fcc..74eca68891ad 100644 --- a/drivers/gpu/ipu-v3/ipu-di.c +++ b/drivers/gpu/ipu-v3/ipu-di.c @@ -451,8 +451,9 @@ static void ipu_di_config_clock(struct ipu_di *di, error = rate / (sig->mode.pixelclock / 1000); - dev_dbg(di->ipu->dev, " IPU clock can give %lu with divider %u, error %d.%u%%\n", - rate, div, (signed)(error - 1000) / 10, error % 10); + dev_dbg(di->ipu->dev, " IPU clock can give %lu with divider %u, error %c%d.%d%%\n", + rate, div, error < 1000 ? '-' : '+', + abs(error - 1000) / 10, abs(error - 1000) % 10); /* Allow a 1% error */ if (error < 1010 && error >= 990) { -- 2.17.1