Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3517182yba; Sat, 11 May 2019 12:33:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzLaJJAqJViYzOBjBfmqsy1TbiTP9Sfv5+K5qauZAPorrgSTeDcnqNy1VLfElMGMYKopcs X-Received: by 2002:a63:231c:: with SMTP id j28mr22468958pgj.430.1557603230654; Sat, 11 May 2019 12:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557603230; cv=none; d=google.com; s=arc-20160816; b=B6eWsVKVgP8XEkwbCWAExAL47jSCv4w5rh+wy1xzU6f4NruhwVOiBfZYUpN6Pv3a2h OXkCRw5B0MOQbBlkq+Uji6QY5CK43XE/i5Wkewx9fswKNUu4d4NjrmJ19Ue7z/U9aNXD 5C/RsDISVxUDU6cS52Ak50cS/TqneqByVw2NZa4SRDiBmfoGFL3j2DsxECY+h3CULxe4 UGyPmkzMOrlDH5uGdubz8E/vc9Lps0mmCSXdru0WwwA+h/mejs+rIU3AvKgJN0QN99cU WbOWFgXygTMmzpFLrfdrqP8RVjUZB5VJ3zYCqZS92sheQn+LaIaoD/qPEmVPWK+Wg6Q4 bE4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OKq/CrBx6NapSLM+xPnsU+PX0DJLDfgci5r6O2oGWIs=; b=kUnWnvNWMESQm9e5ufI/1qeDiOq8tn4a/6uJxu2t9rAX+65aN8DK5eKr4k8wzYleNL jUAhc9ECq63zfq+Nk+6BoG+QWxO63ilTdZyJhn37sKkNrMsQOgzlAKXhPyDmwk8dY5KO zdBYWH+uneNXwTrjmt/HhaE2MrmkeHKeOnu5c+Qgs83bGxyFmwuseickk/LjnvVpISHv Oqd/173s3FA8aab5wlurn0MloqIYxuC663B539fnSlS42e1vB90Ywk0pukbDqZ5v4TTj CeHAyRuQKni4lkqKnt3cAFM5JSW4OBCoqBx1CCzNP/e+FYXMB8Dl0RiIfkSC7x8keaQg HnRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=qPeEvNAy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16si11524520plr.369.2019.05.11.12.33.33; Sat, 11 May 2019 12:33:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=qPeEvNAy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726104AbfEKTco (ORCPT + 99 others); Sat, 11 May 2019 15:32:44 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:57458 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725911AbfEKTco (ORCPT ); Sat, 11 May 2019 15:32:44 -0400 Received: from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9466F2B6; Sat, 11 May 2019 21:32:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1557603162; bh=4GxJMWPvsoT7sFOH6pc36YVXHmeGHUgyYVxKO5tdj9o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qPeEvNAymM9eKh3Qwo99SifRNGsfBkUKuBbkdHyqQXDjM26T+QWENZN1wP9bZJPSK AsJ9RTRH3yLdizwG/v/lZmC9iub8mKO1ri/rapjQZP2GJjxWvR7+NKDuMg1M5tE4OO 0BQJtf7fldzjxQ4FLShSoM8HWsmqOAVSv3y3981I= Date: Sat, 11 May 2019 22:32:26 +0300 From: Laurent Pinchart To: Matt Redfearn Cc: Archit Taneja , Andrzej Hajda , "dri-devel@lists.freedesktop.org" , Matthew Redfearn , "linux-kernel@vger.kernel.org" , Jia-Ju Bai , Kieran Bingham , David Airlie , Sean Paul , Daniel Vetter Subject: Re: [PATCH] drm/bridge: adv7511: Fix low refresh rate selection Message-ID: <20190511193226.GO13043@pendragon.ideasonboard.com> References: <20190424132210.26338-1-matt.redfearn@thinci.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190424132210.26338-1-matt.redfearn@thinci.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Matt, Thank you for the patch. On Wed, Apr 24, 2019 at 01:22:27PM +0000, Matt Redfearn wrote: > The driver currently sets register 0xfb (Low Refresh Rate) based on the > value of mode->vrefresh. Firstly, this field is specified to be in Hz, > but the magic numbers used by the code are Hz * 1000. This essentially > leads to the low refresh rate always being set to 0x01, since the > vrefresh value will always be less than 24000. Fix the magic numbers to > be in Hz. > Secondly, according to the comment in drm_modes.h, the field is not > supposed to be used in a functional way anyway. Instead, use the helper > function drm_mode_vrefresh(). > > Fixes: 9c8af882bf12 ("drm: Add adv7511 encoder driver") > Signed-off-by: Matt Redfearn Wow, a 4.5 year old bug fix, nice :-) Reviewed-by: Laurent Pinchart > --- > > drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > index 85c2d407a52..e7ddd3e3db9 100644 > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > @@ -747,11 +747,11 @@ static void adv7511_mode_set(struct adv7511 *adv7511, > vsync_polarity = 1; > } > > - if (mode->vrefresh <= 24000) > + if (drm_mode_vrefresh(mode) <= 24) > low_refresh_rate = ADV7511_LOW_REFRESH_RATE_24HZ; > - else if (mode->vrefresh <= 25000) > + else if (drm_mode_vrefresh(mode) <= 25) > low_refresh_rate = ADV7511_LOW_REFRESH_RATE_25HZ; > - else if (mode->vrefresh <= 30000) > + else if (drm_mode_vrefresh(mode) <= 30) > low_refresh_rate = ADV7511_LOW_REFRESH_RATE_30HZ; > else > low_refresh_rate = ADV7511_LOW_REFRESH_RATE_NONE; -- Regards, Laurent Pinchart