Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5932938pxb; Mon, 14 Feb 2022 11:03:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUJEtOqMZ+45dRfafwVgvOVtV7gqlBIJNp1ARYaC0r5pZvdU0cqN1Ik8uy7Yokq55wpE7H X-Received: by 2002:a62:c141:: with SMTP id i62mr57755pfg.39.1644865390333; Mon, 14 Feb 2022 11:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644865390; cv=none; d=google.com; s=arc-20160816; b=DeLW8B+hCIKH6jQnp3/Ptt6n8oobl3Qj0QnbrFjfuUTruPXeHy9pVjrYAuau7zDxb4 3J+99DK2hf4OHHqWMVVnzArUk0a0NyaWYA7dc7/4ea1BiQtOovz5VRPHoVCBBV2btmGa 3i3po93zY8IbcN+o1G57RYcZ5h6UZW4Enc3o2Da+BmKkPh1HTFNORFbpQdRMKmePzA1W FUsZZl+vaaRQN6EzJFzG7ke8fzzihGFZshyvBpp6E5BfB/6t+U5xA6fjvHyo9gAOfemr XjoidmNsoAr/c74ptEVh6QBSSICtO+2llnnhTyIg8KQA0Sn0xYz6yS+9AUoaJZMTkS12 vzHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=3prlPbj1WTf3ArvUmU3oSNI45o9aoogvmoqAUHKhOn0=; b=c2BwmFR7f5Gq/HSucbiYHQFwxxPc0GYJb5GxdK50p4mKxGaNINnwy+JHL8QiVbgHJR StmIkammNKHuOuMLLNJSOlr4UeZku9NB7e1z/mJSdjqn/lMoBmsVy2JJw5SzgotqgZDz x8cnoRSXnxliqo0cFc67nP+30rpmsFRwDQOzPUxKE4t4tiS6pI7f+3ESB4C7bXcrxmPE gtKIcFRdwpRYR3YgkFoA3LLbP33vEnwLVJvAKqisuAkNEb3dS6+HtwMLlZr51J1WsOp/ m9MuXwi/rj5SFxI/DuEfmQ2naExUMzqTlYxBV02Ra963o10oMH2UnW7+W4hrlbxJG+ix ZSDw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id z10si5517521pfw.83.2022.02.14.11.03.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:03:10 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CF056D76CB; Mon, 14 Feb 2022 11:00:58 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357034AbiBNRYP (ORCPT + 99 others); Mon, 14 Feb 2022 12:24:15 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232948AbiBNRYO (ORCPT ); Mon, 14 Feb 2022 12:24:14 -0500 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 43048652F1 for ; Mon, 14 Feb 2022 09:24:06 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJf51-0008Qe-HH; Mon, 14 Feb 2022 18:24:03 +0100 Message-ID: <65a7fdadc60d0c76138a8979a0c6fe1d6cdeb85d.camel@pengutronix.de> Subject: Re: [PATCH] gpu: ipu-v3: Fix dev_dbg frequency output From: Lucas Stach To: "Jonas Mark (BT-FIR/ENG1-Grb)" , Philipp Zabel , David Airlie , Daniel Vetter Cc: "RUAN Tingquan (BT-FIR/ENG1-Zhu)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" Date: Mon, 14 Feb 2022 18:24:01 +0100 In-Reply-To: References: <20220207151411.5009-1-mark.jonas@de.bosch.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-1.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@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=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Am Montag, dem 14.02.2022 um 16:44 +0000 schrieb Jonas Mark (BT-FIR/ENG1-Grb): > Hi, > > > 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) { > > Is there anything I can do to help getting this patch mainline? Philipp is still on vacation, but will be back in a few days. I guess he will take a look at those patches then. Regards, Lucas