From: Hans de Goede <hdegoede@redhat.com>
To: linux-fbdev@vger.kernel.org
Subject: Re: [linux-sunxi] [PATCH] video/modedb: fb_find_nearest_mode: take vmode into account
Date: Mon, 11 Feb 2013 09:28:29 +0000 [thread overview]
Message-ID: <5118B9BD.7070803@redhat.com> (raw)
In-Reply-To: <1360527814-28883-1-git-send-email-bos@je-eigen-domein.nl>
Hi,
On 02/10/2013 09:23 PM, Floris Bos wrote:
> Previously fb_find_nearest_mode() only searched the modelist for a video mode that best matches the
> desired resolution and refresh rate.
> With this patch it also takes the vmode into account if there is more then one mode with the same
> resolution and refresh rate.
> Typical use case is HDMI TVs that support both 1080p60 and 1080i60
>
> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> ---
> drivers/video/modedb.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
> index a9a907c..e852371 100644
> --- a/drivers/video/modedb.c
> +++ b/drivers/video/modedb.c
> @@ -913,6 +913,8 @@ const struct fb_videomode *fb_find_best_mode(const struct fb_var_screeninfo *var
> * Finds best matching videomode, smaller or greater in dimension.
> * If more than 1 videomode is found, will return the videomode with
> * the closest refresh rate.
> + * If multiple modes with the same resolution and refresh rate are found
> + * pick the one with the matching vmode (e.g. non-interlaced)
> */
> const struct fb_videomode *fb_find_nearest_mode(const struct fb_videomode *mode,
> struct list_head *head)
> @@ -939,6 +941,8 @@ const struct fb_videomode *fb_find_nearest_mode(const struct fb_videomode *mode,
> if (diff_refresh > d) {
> diff_refresh = d;
> best = cmode;
> + } else if (diff_refresh = d && cmode->vmode = mode->vmode) {
> + best = cmode;
> }
> }
> }
>
Hmm, my version of this patch was more conservative, only comparing the INTERLACED bit
of vmode. I assume you've tested this, and it works as advertised? If so ack.
Regards,
Hans
next prev parent reply other threads:[~2013-02-11 9:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-10 20:23 [PATCH] video/modedb: fb_find_nearest_mode: take vmode into account Floris Bos
2013-02-11 9:28 ` Hans de Goede [this message]
2013-02-11 13:52 ` [linux-sunxi] " Floris Bos
2013-02-11 14:06 ` Michal Suchanek
2013-02-11 14:16 ` Floris Bos
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=5118B9BD.7070803@redhat.com \
--to=hdegoede@redhat.com \
--cc=linux-fbdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).