All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Maling list - DRI developers <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/edid: compare actual vrefresh for all modes for quirks
Date: Mon, 14 Oct 2013 19:58:57 +0300	[thread overview]
Message-ID: <20131014165857.GG13047@intel.com> (raw)
In-Reply-To: <CADnq5_O4X8sWdEAm1vhYraADErwwU+NaMEwC+A4r0LVGiGpjWQ@mail.gmail.com>

On Mon, Oct 14, 2013 at 12:50:41PM -0400, Alex Deucher wrote:
> On Fri, Sep 20, 2013 at 6:32 PM, Alex Deucher <alexdeucher@gmail.com> wrote:
> > On Thu, Aug 15, 2013 at 11:48 AM, Alex Deucher <alexdeucher@gmail.com> wrote:
> >> The vrefresh field of the mode is 0 for most modes
> >> fetched from the EDID (e.g., established timings).
> >> When dealing with monitors that have a bogus preferred
> >> mode, we may not always select the mode we want because
> >> we compare the target refresh to the mode's vrefresh which
> >> is 0 in a lot of cases.
> >>
> >> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> >
> > Ping?  Any objections?
> 
> Anyone?  Without this quirking doesn't work unless the quirked mode
> happens to have the vrefesh field filled in which most modes don't.

Yeah, seems saner than comparing against 0.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> 
> Alex
> 
> 
> >
> > Alex
> >
> >> ---
> >>  drivers/gpu/drm/drm_edid.c | 11 ++++++++---
> >>  1 file changed, 8 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> >> index 58b4882..c3095e0 100644
> >> --- a/drivers/gpu/drm/drm_edid.c
> >> +++ b/drivers/gpu/drm/drm_edid.c
> >> @@ -1278,7 +1278,7 @@ static u32 edid_get_quirks(struct edid *edid)
> >>  }
> >>
> >>  #define MODE_SIZE(m) ((m)->hdisplay * (m)->vdisplay)
> >> -#define MODE_REFRESH_DIFF(m,r) (abs((m)->vrefresh - target_refresh))
> >> +#define MODE_REFRESH_DIFF(c,t) (abs((c) - (t)))
> >>
> >>  /**
> >>   * edid_fixup_preferred - set preferred modes based on quirk list
> >> @@ -1293,6 +1293,7 @@ static void edid_fixup_preferred(struct drm_connector *connector,
> >>  {
> >>         struct drm_display_mode *t, *cur_mode, *preferred_mode;
> >>         int target_refresh = 0;
> >> +       int cur_vrefresh, preferred_vrefresh;
> >>
> >>         if (list_empty(&connector->probed_modes))
> >>                 return;
> >> @@ -1315,10 +1316,14 @@ static void edid_fixup_preferred(struct drm_connector *connector,
> >>                 if (MODE_SIZE(cur_mode) > MODE_SIZE(preferred_mode))
> >>                         preferred_mode = cur_mode;
> >>
> >> +               cur_vrefresh = cur_mode->vrefresh ?
> >> +                       cur_mode->vrefresh : drm_mode_vrefresh(cur_mode);
> >> +               preferred_vrefresh = preferred_mode->vrefresh ?
> >> +                       preferred_mode->vrefresh : drm_mode_vrefresh(preferred_mode);
> >>                 /* At a given size, try to get closest to target refresh */
> >>                 if ((MODE_SIZE(cur_mode) == MODE_SIZE(preferred_mode)) &&
> >> -                   MODE_REFRESH_DIFF(cur_mode, target_refresh) <
> >> -                   MODE_REFRESH_DIFF(preferred_mode, target_refresh)) {
> >> +                   MODE_REFRESH_DIFF(cur_vrefresh, target_refresh) <
> >> +                   MODE_REFRESH_DIFF(preferred_vrefresh, target_refresh)) {
> >>                         preferred_mode = cur_mode;
> >>                 }
> >>         }
> >> --
> >> 1.8.3.1
> >>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC

      reply	other threads:[~2013-10-14 16:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15 15:48 [PATCH] drm/edid: compare actual vrefresh for all modes for quirks Alex Deucher
2013-09-20 22:32 ` Alex Deucher
2013-10-14 16:50   ` Alex Deucher
2013-10-14 16:58     ` Ville Syrjälä [this message]

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=20131014165857.GG13047@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.