mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Matt Redfearn <matt.redfearn@thinci.com>
Cc: Archit Taneja <architt@codeaurora.org>,
	Andrzej Hajda <a.hajda@samsung.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Matthew Redfearn <matthew.redfearn@thinci.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jia-Ju Bai <baijiaju1990@gmail.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	David Airlie <airlied@linux.ie>,
	Sean Paul <seanpaul@chromium.org>,
	Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH] drm/bridge: adv7511: Fix low refresh rate selection
Date: Sat, 11 May 2019 22:32:26 +0300	[thread overview]
Message-ID: <20190511193226.GO13043@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20190424132210.26338-1-matt.redfearn@thinci.com>

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 <matt.redfearn@thinci.com>

Wow, a 4.5 year old bug fix, nice :-)

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> 
>  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

  reply	other threads:[~2019-05-11 19:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 13:22 Matt Redfearn
2019-05-11 19:32 ` Laurent Pinchart [this message]
2019-05-14 18:12   ` Sean Paul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190511193226.GO13043@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=architt@codeaurora.org \
    --cc=baijiaju1990@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.redfearn@thinci.com \
    --cc=matthew.redfearn@thinci.com \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®