Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1398713pxb; Wed, 30 Mar 2022 02:34:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIh3k2cwkMWXDim8Sqe1yArrBZIPfCYdcLz5QEWZ3og8tZdfyaDiOwlhrwBSj2Vq6oRX7V X-Received: by 2002:a63:c24:0:b0:382:2a04:3dbe with SMTP id b36-20020a630c24000000b003822a043dbemr5449122pgl.158.1648632894202; Wed, 30 Mar 2022 02:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648632894; cv=none; d=google.com; s=arc-20160816; b=nNFDn0pm3hGlN3arAl3q0HylmdqK7Y74b46ckLOGtfgUPYNsMZi6o5hYPoOjPvtc7a MseFIIrrhY0c/n7pfhIQzBo3iD6Ex2GF0rf7HZeqIqsdSK+1gh+bE0CbuXwuaHqXs5Z7 dJE+dFhpkRA0QqLCIN7EB5pwH5XJ7rPbICu3+Buj4kP/L9sAVlHSFvf/NpRKG8woyYkT foUj26VL1JPWvY/g81TnGbCJLdVSE6xzbLut0x+n4Qo/aHzmapraZrTbw5KiZ3wO9RCB A5qVPcSzLz5GgLsCVfNoprgk6HQIFddR/fl8z1twzTg9LdWRGuXKLTaT/DjRrIK4H0Ry a5Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=zGuZ6IqvWYe2YsXByMGu/ILkOmiamLmQ1cObR+9NJXE=; b=v7iEPJNVv7YcztPRZy7oqFIefRCKat9JhzBKU1QTecMHee93M6sWCEOxbtsYc+45c5 2f3ZAN4G9aiQsxkBcgZ1eiSFPylyirOzJ+FzYXcBVjCpm/goDKMkCc9pj5TOrdQ4zQ8g EwlFgnQnwjGP1J02rBAJ2a25vIYj9TLsPveJBEjClONH6Y1N1k4YSwW52Lh5iwZnqjSy Mqjq5lJQtCkItA4fe4uecjDwtTLhBc4eDIsIL+SA8Doc4sY1z1vmhewQn35jI2g5ER6f M1Rgk24blAqvbNCTbScgu0b4PLDBJiaq1PsPvVPqCfoBvlHKTMLi26lIhdfgNakE7+gI fcNw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a23-20020a62e217000000b004fa3a8e006dsi19014507pfi.292.2022.03.30.02.34.40; Wed, 30 Mar 2022 02:34:54 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239747AbiC2QoS convert rfc822-to-8bit (ORCPT + 99 others); Tue, 29 Mar 2022 12:44:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239906AbiC2Qnz (ORCPT ); Tue, 29 Mar 2022 12:43:55 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 386BC260C63 for ; Tue, 29 Mar 2022 09:42:06 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZEux-0005xu-Ri; Tue, 29 Mar 2022 18:42:03 +0200 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nZEuu-003pAy-2v; Tue, 29 Mar 2022 18:42:02 +0200 Received: from pza by lupine with local (Exim 4.94.2) (envelope-from ) id 1nZEuw-000An1-0m; Tue, 29 Mar 2022 18:42:02 +0200 Message-ID: Subject: Re: [PATCH] gpu: ipu-v3: Fix dev_dbg frequency output From: Philipp Zabel To: Mark Jonas , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, tingquan.ruan@cn.bosch.com Date: Tue, 29 Mar 2022 18:42:01 +0200 In-Reply-To: <20220207151411.5009-1-mark.jonas@de.bosch.com> References: <20220207151411.5009-1-mark.jonas@de.bosch.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 On Mo, 2022-02-07 at 16:14 +0100, Mark Jonas wrote: > 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) { Thank you, applied to imx-drm/fixes. regards Philipp