Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6662117yba; Tue, 14 May 2019 11:15:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcRgEUDlGljPZfSeaPwrYQUmCWHKYvaPugf0nejnytu+qBwhliKlJd6eaeZ6De5nbP+xlv X-Received: by 2002:a63:8949:: with SMTP id v70mr40314353pgd.196.1557857702565; Tue, 14 May 2019 11:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557857702; cv=none; d=google.com; s=arc-20160816; b=Ya8/ONYou3yXHYcWqFxEERngcCrCUJ9Rb+m3aA5T6XXtSp0YyKO/buQoKq3sWPoE0z eAOeO6Rtyia2mWw1Cct85j5Szy3lgsoxysGH9bu7iCGD+WJ5h1hhuYOTBb5tSdvd9hjh +iXmzIOybmpbxrpzKTw9lwXW1AtEHwm+f6+THDR+YR4lboEEx5b+f8hj4JapXDlVxfJt /9BZXsgUFMvBhxzMB5CYsyydzKujb+SFFj4UlNx+RHszSNIvgCw0AomjP4kIOUiV/jPz 4HXvg1L8oLUGxJEF0WvTCRddWeYv7w/mxqpMAohnMlQShTkzenIDboW59ivhc+XH7T16 PErA== 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=HrkjcsngWKiOpJS10js6bvf1zdshTsN54KJhQwcMKVg=; b=zlnR8Qtn0gpl896k/bMz16lhJr8M8FYCF0SPRJmP5PUM8CdwMHZGBRYP3Wj5UKLlCh kZKcCm2Ee0LLGcnaHxN44V6ziKpQWDzKUkBiVttpnebulsfGgUSwa1NyCnzAHGwhHFhS vl5tztICjzeBs6eJaUjN8fMbVwRhpP8q9YGGoFKoQdos4Y8NClrhbMnpIBMq3dyLbAHM FEXWP7sVS3UXJm9BvYoLOFcO9ost8JWr80/f604PfQZROGidIr9KwgH1MCwQ+7sGFp9x igSAllfV2POpirnjS4ITO2BCXIcRGK8Mf9uzEBys2gjrAHg1l84BR6LBaldiJPNE0xyi e+2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=UywwujrY; 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 m3si19656059pll.214.2019.05.14.11.14.47; Tue, 14 May 2019 11:15:02 -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 header.i=@poorly.run header.s=google header.b=UywwujrY; 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 S1727582AbfENSNA (ORCPT + 99 others); Tue, 14 May 2019 14:13:00 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:42987 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbfENSM7 (ORCPT ); Tue, 14 May 2019 14:12:59 -0400 Received: by mail-qk1-f194.google.com with SMTP id d4so10884795qkc.9 for ; Tue, 14 May 2019 11:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HrkjcsngWKiOpJS10js6bvf1zdshTsN54KJhQwcMKVg=; b=UywwujrY/ytEzSfp8rG9FXW/ApAoK75ult5EIRsYGH1clhBX7Ek9y6Tj6lWt9Xo6pK P8kF8427XKk1mgLR646yNWutCI9Y4T3sU62CshHLqV9b0UYbtVRph4V9DhrPDpK147Zx bDPZrVlvWhkkSq5ZLj8Xa8I6WWnhSNA5PiYSumt4rpj34C9M6t2h2wW+9ZLG7JMPpTL3 48SXBH1rghW8V51fCr0a+0MEYGnRSGDasXc2GYaXoxPGkQLcMlxBlHQJlU7voH/u3aIO PUHIxzdBMivxsr5/Zpqw8TcH09MZDT6mzWt6LZcFAxotbq5el/9nRruGl72Nolpv4GFx 3sqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HrkjcsngWKiOpJS10js6bvf1zdshTsN54KJhQwcMKVg=; b=fSIEj4K9O5IUdkn+V7T8Bt7YPUBMx5q5Dav/WYfXZo9EF/DWhPfDpzX+GA45C7y35V FYfh//HuEBihgqA4P1fgaoIYXaCJW645lgBmY8+iltGWFD5Rz+XGjcFYr8UfL7pQb6YS mzy/pNXGTFzN0QuFyefI7im99x/07yEjwr5uP0Z1R8GMQ0zBWTRH1FEgIqJw1A6ByX7R S/+0JxJOZhfZtD0+zkJW/eVQzfLLfjNxcUHOlHj3/KORcE944jrpVEz/GJnyBdF9mbLO L1TkmAa4DIqggKF52n+D6psl4Vaw/Juv2jGrRE5qRkRz1JWuMHoHmulQS8tGGKz7P9iz jzYg== X-Gm-Message-State: APjAAAVyt//EqXxATrGpkLnP7NwesLTbMQFCpK7oOtlzYznsGIKufUq+ 2xQqBHOIi6PzGoWVsLmEEu4dEQ== X-Received: by 2002:a37:358:: with SMTP id 85mr28270475qkd.174.1557857578793; Tue, 14 May 2019 11:12:58 -0700 (PDT) Received: from localhost ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id g55sm14028045qtk.76.2019.05.14.11.12.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 11:12:58 -0700 (PDT) Date: Tue, 14 May 2019 14:12:57 -0400 From: Sean Paul To: Laurent Pinchart Cc: Matt Redfearn , Archit Taneja , David Airlie , Kieran Bingham , "linux-kernel@vger.kernel.org" , Matthew Redfearn , Jia-Ju Bai , Sean Paul , "dri-devel@lists.freedesktop.org" Subject: Re: [PATCH] drm/bridge: adv7511: Fix low refresh rate selection Message-ID: <20190514181257.GS17077@art_vandelay> References: <20190424132210.26338-1-matt.redfearn@thinci.com> <20190511193226.GO13043@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190511193226.GO13043@pendragon.ideasonboard.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 On Sat, May 11, 2019 at 10:32:26PM +0300, Laurent Pinchart wrote: > 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 > Applied to drm-misc-next-fixes. Thanks! Sean > > --- > > > > 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 > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Sean Paul, Software Engineer, Google / Chromium OS