Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3220318pxf; Mon, 22 Mar 2021 00:28:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5nfFW9/dj3TEnAH5q4Eti6rXS328yPKTlPC94V51CGxkgxvczJ5wBgD8u+NCxP5mgtpOX X-Received: by 2002:a05:6402:158d:: with SMTP id c13mr23823170edv.297.1616398110306; Mon, 22 Mar 2021 00:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616398110; cv=none; d=google.com; s=arc-20160816; b=bERgnct2tWVvvssfPH8orZ4OPkvvbk7t7J58u1sHCJgkFh9tDrfI8za3xuw56v6siO LTV4GgBWk7ZVETFJw/SceAOjOMupCrZceywdP613fnMCxh92lomy6YgPq0vtrwTVLqTc cDMY2+DWkpxDD6uimpx8Yf0x8mgFj/CT7+y8pc1ADvsksmqRx/eCmngFaUiCapZUYDZ7 FOQzxzW8LjkKNlrWGEB42j2K8lXDmroRTOESR9m3OPQXxwEK6SugStAn2CIDSiQnLy7D h9NO/sSOCkUjhZCfp2qIWzToZb0ACAWkfOc9CqiXVbgOLXsxwOXqyaTlx8gfItC2NUWu 32ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=GuPUVEEaysOuELfgy2EhE8+gcOg4FRgBrwS+amG3bi0=; b=qnDbo+Jk4i5DlrMnzymroxzqZbgT6+kh79t6MjLo5o2nLtD6Yj5QT2jCZCvEYNfi+u tsK80Zucj+urIUqjHXFLfHeXRBPR5T9txj4vcnjRV7NuW8t5XNI7lSxvlInYuKvEteI5 CnL456gMGlUxhk5UaR/bYNa1cH86Hvotg0dEi3icgjZTdBBGdYa6OWUEwZjDZ/w8MREL 7aJ15C8OqBwHjhDO7O0eVzUbWCSA+eo66fZPsq0xE0kXltot7j2m3DTn+uVg8d+Msrb2 7Y3vlEz0/pP9rn0N5t+UIToa9UYue/vmGlPba67S7grGt9KFZlgmKtOowufI+xfPrFk9 68jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GavvwMsZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm14si9506145ejc.502.2021.03.22.00.28.07; Mon, 22 Mar 2021 00:28:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GavvwMsZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229647AbhCVH1J (ORCPT + 99 others); Mon, 22 Mar 2021 03:27:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:35414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbhCVH0x (ORCPT ); Mon, 22 Mar 2021 03:26:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AF1D260295; Mon, 22 Mar 2021 07:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616398012; bh=7ZZ16k2IQrPSZWmtn+IDkZglcyLIqxtZ8LynJyOxnAI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=GavvwMsZOqyYXx2TYUVFtfYpBgn0KxveSIZ1Ynq9vG2WsufcR9JkDlqsaJRkE7CAN cbGqtcsYBl+8LAKpJZEzZPZlVY8RcwlcYkMd768Y2vX6/JWQPoqHtWm4U1HWQEkLmt SQC3pRm4ORGv8RlRl2L1xIjFJ/s81nQyTC+4yrNd0sJJx1ynljFcOHKKguhmRToFVk eD9OSpzu7ZUAYP9Pa+wLb0fSrQdTgYnsKXxaQxVkshZ+l7HKSVGlfQmkP3uszCvb0f qjxoFmJczBElazis7AwZgV+HKDIKq3DycacSDdJvgll5Y026hpQ5i6CRvuGFHHROqg gTysvdOwO8doA== Subject: Re: [PATCH v2 3/3] drm/tilcdc: fix pixel clock setting warning message To: Dario Binacchi , linux-kernel@vger.kernel.org Cc: Daniel Vetter , David Airlie , Jyri Sarha , dri-devel@lists.freedesktop.org References: <20210321083153.2810-1-dariobin@libero.it> <20210321083153.2810-4-dariobin@libero.it> From: Tomi Valkeinen Message-ID: <0d8770b6-755d-8fc7-4e52-2d745971876d@kernel.org> Date: Mon, 22 Mar 2021 09:26:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210321083153.2810-4-dariobin@libero.it> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/03/2021 10:31, Dario Binacchi wrote: > The warning message did not printed the LCD pixel clock rate but the LCD > clock divisor input rate. As a consequence, the required and real pixel > clock rates are now passed to the tilcdc_pclk_diff(). > > Signed-off-by: Dario Binacchi > > --- > > Changes in v2: > - The patch has been added in version 2. > > drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > index ac6228cb04d9..c0792c52dc02 100644 > --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > @@ -203,7 +203,7 @@ static void tilcdc_crtc_set_clk(struct drm_crtc *crtc) > struct drm_device *dev = crtc->dev; > struct tilcdc_drm_private *priv = dev->dev_private; > struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); > - unsigned long clk_rate, real_rate, real_pclk_rate, pclk_rate; > + unsigned long clk_rate, real_pclk_rate, pclk_rate; > unsigned int clkdiv; > int ret; > > @@ -239,12 +239,12 @@ static void tilcdc_crtc_set_clk(struct drm_crtc *crtc) > * 5% is an arbitrary value - LCDs are usually quite tolerant > * about pixel clock rates. > */ > - real_rate = clkdiv * pclk_rate; > + real_pclk_rate = clk_rate / clkdiv; > > - if (tilcdc_pclk_diff(clk_rate, real_rate) > 5) { > + if (tilcdc_pclk_diff(pclk_rate, real_pclk_rate) > 5) { > dev_warn(dev->dev, > "effective pixel clock rate (%luHz) differs from the calculated rate (%luHz)\n", > - clk_rate, real_rate); > + pclk_rate, real_pclk_rate); Aren't these backwards? "Effective" is the real one in the HW. I'm not sure what "calculated" means here, I guess it should be "requested". Tomi