From: Daniel Vetter <daniel@ffwll.ch>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915: Make sure vsyncshift is positive
Date: Sat, 29 Mar 2014 10:40:31 +0100 [thread overview]
Message-ID: <20140329094031.GO22327@phenom.ffwll.local> (raw)
In-Reply-To: <20140328151155.4cfcdce7@jbarnes-desktop>
On Fri, Mar 28, 2014 at 03:11:55PM -0700, Jesse Barnes wrote:
> On Fri, 28 Mar 2014 23:29:32 +0200
> ville.syrjala@linux.intel.com wrote:
>
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > If vsyncshift comes out as negative, add one htotal to it to get the
> > corresponding positive value.
> >
> > This is rather theoretical as it would require a mode where the
> > hsync+back porch is very long and the active+front porch very short.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 3ab40e3..7d3b18b 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -5377,7 +5377,8 @@ static void intel_set_pipe_timings(struct intel_crtc *intel_crtc)
> > enum transcoder cpu_transcoder = intel_crtc->config.cpu_transcoder;
> > struct drm_display_mode *adjusted_mode =
> > &intel_crtc->config.adjusted_mode;
> > - uint32_t vsyncshift = 0, crtc_vtotal, crtc_vblank_end;
> > + uint32_t crtc_vtotal, crtc_vblank_end;
> > + int vsyncshift = 0;
> >
> > /* We need to be careful not to changed the adjusted mode, for otherwise
> > * the hw state checker will get angry at the mismatch. */
> > @@ -5394,6 +5395,8 @@ static void intel_set_pipe_timings(struct intel_crtc *intel_crtc)
> > else
> > vsyncshift = adjusted_mode->crtc_hsync_start -
> > adjusted_mode->crtc_htotal / 2;
> > + if (vsyncshift < 0)
> > + vsyncshift += adjusted_mode->crtc_htotal;
> > }
> >
> > if (INTEL_INFO(dev)->gen > 3)
>
>
> Funky indeed. I wonder if we should congratulate the user if we detect
> this configuration. "Achievement unlocked: funky mode timings!".
Would be a neat bounty-hunt sprinkling this all over ...
>
> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
All 3 merged, thanks for patches&review.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
prev parent reply other threads:[~2014-03-29 9:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 21:29 [PATCH 0/3] drm/i915: Some vsyncshift fixes ville.syrjala
2014-03-28 21:29 ` [PATCH 1/3] drm/i915: Program VSYNCSHIFT in a more consistent manner ville.syrjala
2014-03-28 22:08 ` Jesse Barnes
2014-03-28 21:29 ` [PATCH 2/3] drm/i915: Fix the interlace mode selection for gmch platforms ville.syrjala
2014-03-28 22:10 ` Jesse Barnes
2014-03-28 21:29 ` [PATCH 3/3] drm/i915: Make sure vsyncshift is positive ville.syrjala
2014-03-28 22:11 ` Jesse Barnes
2014-03-29 9:40 ` Daniel Vetter [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=20140329094031.GO22327@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jbarnes@virtuousgeek.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