Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2637826pxf; Sun, 21 Mar 2021 01:39:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0LwQhZQFDQUQPioG+VFv17swBqGpQxB3qGeG3jVeBBu/c4ZYibgZ+nBlWQyYO8txUP5De X-Received: by 2002:a05:6402:268c:: with SMTP id w12mr19091429edd.280.1616315963629; Sun, 21 Mar 2021 01:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616315963; cv=none; d=google.com; s=arc-20160816; b=gDvBhH2Ei5rcAt+gDUuquwCvcnlNvL+WNAo9IKXWRnZ2ael4dSjagmLwXqUX66PbIR AZR32YSUUi4jo4F93X3bBCr19yrR5i8gFOad6Fl6vkck3SIT6xeRR/fwiCOxjVBTvCYW Itmye+FiwGJSK9JNAH/CVs7ww2vKiQMe1YzcyrUlw6iqgmsT0+x8l/z6MSX3pj98DRny 5eHe0EBVVSohgJw4FtSH1q5UA//Wx11PnefD/prMpE3yZ5zikoRyDx2fP10NgeZGNh8w O0b7mEsmiJlbIdbhRcDwqGlmK905N5q+nul6ltEhewpq7maGNHhX5z3LVnXRb37MVXHI 5OLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=zVkuQ2oGVldVrVFvB2CtFewtN+s31qqxbZSXdfUASHo=; b=ff0iOTtXYMJXdULb9Vuxs9Pv6XXeZNww5zisXjiDs+pUAk1akDwLxAwm2n3xF8qjAO 5Ob46H3nvXbTYYDkg9RUSeuaJGSHJpVcVfvn8syz66Jl6GeqY2i7BWoYApJCvuVfddcD ez2fIOXu1ClrgrtzVufy8VLr5ogrgQfOOQM0Lr90IGq8Hi4c+Ai0o8sqp2cTh0bi1nfF Tr9tJpQYd/9ZarO/n1eTI6RZlvO/zGObuJtiK235yiHr7p/tWHLP/J7xkQdnObHySGvm fBqycSUYwQSk+x/VoD3v3/exyYT31f+YU5032re5LrDKUuts+IuUxj5/o7XJjchExo4A Egjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@libero.it header.s=s2021 header.b=epsGvrqt; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=libero.it Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k25si8274064ejq.186.2021.03.21.01.39.01; Sun, 21 Mar 2021 01:39:23 -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=@libero.it header.s=s2021 header.b=epsGvrqt; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=libero.it Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbhCUIcj (ORCPT + 99 others); Sun, 21 Mar 2021 04:32:39 -0400 Received: from smtp-17.italiaonline.it ([213.209.10.17]:56561 "EHLO libero.it" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230112AbhCUIcW (ORCPT ); Sun, 21 Mar 2021 04:32:22 -0400 Received: from passgat-Modern-14-A10M.homenet.telecomitalia.it ([87.20.116.197]) by smtp-17.iol.local with ESMTPA id NtVMlAZljtpGHNtVUlqmO0; Sun, 21 Mar 2021 09:32:21 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2021; t=1616315541; bh=zVkuQ2oGVldVrVFvB2CtFewtN+s31qqxbZSXdfUASHo=; h=From; b=epsGvrqty3s6iFfes2spvJSYvC7S/QX9vSanM/ueqgb91eqsI3bglYSMZhREP0j4Y Wk1eLwF1NbgZyzQAer4inFW7Jrh9sfDhGOZeVXvc5Bs3idT45Us2BjEPd7pCecy4HI y+gFG1wk9PsMsijRKr080oJddayveH6VB9BWQjtFfxW+2ZeiyIU9Zi/rpiYtLa4azI 95oHmZPtkxm3zxwSixJNXpwNOUWtahVTrPCeXlXp+YoelxYpBCC5VldvTZ+a+eqmVh VkFaeqZchwEf4/E+0FlWrxbfpioWyPd4XgVSsjMhxgNey6prbdT3envruUlzz52mEB 0keUqygT+rqCQ== X-CNFS-Analysis: v=2.4 cv=Q7IXX66a c=1 sm=1 tr=0 ts=60570495 cx=a_exe a=AVqmXbCQpuNSdJmApS5GbQ==:117 a=AVqmXbCQpuNSdJmApS5GbQ==:17 a=1RDr0-BV0bhq8KCB1kIA:9 From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Dario Binacchi , Daniel Vetter , David Airlie , Jyri Sarha , Tomi Valkeinen , dri-devel@lists.freedesktop.org Subject: [PATCH v2 3/3] drm/tilcdc: fix pixel clock setting warning message Date: Sun, 21 Mar 2021 09:31:53 +0100 Message-Id: <20210321083153.2810-4-dariobin@libero.it> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210321083153.2810-1-dariobin@libero.it> References: <20210321083153.2810-1-dariobin@libero.it> X-CMAE-Envelope: MS4xfDfpQSq7LzLNjIKjRNpVkFUqvjQm8/IVFQmhMqy2ynSc8QsfkjfF2nqwWdIFB3L0yfo9Rzyps2fqvsxnn+mAU8JHdnKfvY3Kt0gTRdl5vF6fMK1Gwt+3 JPOH5Sxi/oPF59IyD+mw6UA+sSIHmN52JOQDWl1GPJ0bKlv5mtyHw0JCcDkyzWoT057xrVfzThytZYwDmKIimPoaLYGmzf9l7h1dGZgJ0yKgbLr2W5NE7Hen c/U8znWRWyATFFNV/XbkVSS0HMrmm2tJ2i8wRzFhBai4/xHXXOTlKkALIPaNOYVCgjuHvJBKuJdMvKPytAjnJWjqGzO0VoZu32M8gvR0w0qGEu/eBhiKcSli l5O+EXUfU7pQj24oxDR9+zO2v2pzP5j/lXOw6NIzajJrCv4Md1MogOKhbjqfZaTJxnuCKuBd Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } } -- 2.17.1