public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm: Store the calculated vrefresh in the user mode
Date: Wed, 14 Mar 2018 16:55:33 +0200	[thread overview]
Message-ID: <20180314145533.GJ5453@intel.com> (raw)
In-Reply-To: <7969466b-ff26-3163-5f73-37dd392a3474@linux.intel.com>

On Tue, Mar 13, 2018 at 08:04:03PM +0100, Maarten Lankhorst wrote:
> Op 13-03-18 om 16:07 schreef Ville Syrjala:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Ignore the vrefresh in the mode the user passed in and instead
> > calculate the value based on the actual timings. This way we can
> > actually trust mode->vrefresh to some degree.
> >
> > Or should we compare the user's idea of vrefresh with the one
> > we get from the timings and return an error if they differ? We
> > can't really be sure what the user is asking in that case.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/drm_modes.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> > index f6b7c0e36a1a..021526ec6fa0 100644
> > --- a/drivers/gpu/drm/drm_modes.c
> > +++ b/drivers/gpu/drm/drm_modes.c
> > @@ -1609,7 +1609,11 @@ int drm_mode_convert_umode(struct drm_device *dev,
> >  	out->vsync_end = in->vsync_end;
> >  	out->vtotal = in->vtotal;
> >  	out->vscan = in->vscan;
> > -	out->vrefresh = in->vrefresh;
> > +	 /*
> > +	  * Ignore what the user is saying here and instead
> > +	  * calculate vrefresh based on the actual timings.
> > +	  */
> > +	out->vrefresh = 0;
> >  	out->flags = in->flags;
> >  	out->type = in->type;
> >  	strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
> > @@ -1619,6 +1623,8 @@ int drm_mode_convert_umode(struct drm_device *dev,
> >  	if (out->status != MODE_OK)
> >  		return -EINVAL;
> >  
> > +	out->vrefresh = drm_mode_vrefresh(out);
> > +
> >  	drm_mode_set_crtcinfo(out, CRTC_INTERLACE_HALVE_V);
> >  
> >  	return 0;
> 
> Could we also get this with dim fixes tags dc911f5bd8aa, so we can backport the alt mode handling patch?

Do we want/need to backport it actually?

> 
> And update the documentation about vrefresh, that you can retrieve it with drm_mode_vrefresh?

The whole "return cached value if present, otherwise calculate but don't
update the cached value" apporach always seemed off to me. Might be a
good idea to change it somehow. Maybe just always calculate it, or do
the cached value updates in sensible places so that you only have to
calculate once. But I haven't actually checked how much work that
would entail.

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-03-14 14:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 15:07 [PATCH 1/3] drm: Nuke the useless 'ret' variable from drm_mode_convert_umode() Ville Syrjala
2018-03-13 15:07 ` [PATCH 2/3] drm: Make drm_mode_vrefresh() a bit more accurate Ville Syrjala
2018-03-14 13:56   ` Daniel Vetter
2018-03-14 14:50     ` Ville Syrjälä
2018-03-16 16:34     ` Ville Syrjälä
2018-03-13 15:07 ` [PATCH 3/3] drm: Store the calculated vrefresh in the user mode Ville Syrjala
2018-03-13 19:04   ` Maarten Lankhorst
2018-03-14 14:55     ` Ville Syrjälä [this message]
2018-03-13 16:17 ` [PATCH 1/3] drm: Nuke the useless 'ret' variable from drm_mode_convert_umode() Daniel Vetter
2018-03-13 16:25 ` ✓ Fi.CI.BAT: success for series starting with [1/3] " Patchwork
2018-03-13 17:32 ` ✓ Fi.CI.IGT: " Patchwork

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=20180314145533.GJ5453@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /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