From: Daniel Vetter <daniel@ffwll.ch>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
DRI Development <dri-devel@lists.freedesktop.org>,
Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 1/5] drm/irq: Add drm_crtc_vblank_reset
Date: Mon, 23 Feb 2015 10:54:24 +0100 [thread overview]
Message-ID: <20150223095424.GV24485@phenom.ffwll.local> (raw)
In-Reply-To: <4596092.WFWztjMhDm@avalon>
On Sun, Feb 15, 2015 at 04:08:31PM +0200, Laurent Pinchart wrote:
> Hi Daniel,
>
> Thank you for the patch.
>
> On Friday 13 February 2015 21:03:42 Daniel Vetter wrote:
> > At driver load we need to tell the vblank code about the state of the
> > pipes, so that the logic around reject vblank_get when the pipe is off
> > works correctly.
> >
> > Thus far i915 used drm_vblank_off, but one of the side-effects of it
> > is that it also saves the vblank counter. And for that it calls down
> > into the ->get_vblank_counter hook. Which isn't really a good idea
> > when the pipe is off for a few reasons:
> > - With runtime pm the register might not respond.
> > - If the pipe is off some datastructures might not be around or
> > unitialized.
> >
> > The later is what blew up on gen3: We look at intel_crtc->config to
> > compute the vblank counter, and for a disabled pipe at boot-up that's
> > just not there. Thus far this was papered over by a check for
> > intel_crtc->active, but I want to get rid of that (since it's fairly
> > race, vblank hooks are called from all kinds of places).
> >
> > So prep for that by adding a _reset functions which only does what we
> > really need to be done at driver load: Mark the vblank pipe as off,
> > but don't do any vblank counter saving or event flushing - neither of
> > that is required.
> >
> > v2: Clarify the code flow slightly as suggested by Ville.
> >
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Cc: Imre Deak <imre.deak@intel.com>
> > Reviewed-by: Imre Deak <imre.deak@intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> > drivers/gpu/drm/drm_irq.c | 32 ++++++++++++++++++++++++++++++++
> > drivers/gpu/drm/i915/intel_display.c | 6 +++---
> > include/drm/drmP.h | 1 +
> > 3 files changed, 36 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> > index 75647e7f012b..1e5fb1b994d7 100644
> > --- a/drivers/gpu/drm/drm_irq.c
> > +++ b/drivers/gpu/drm/drm_irq.c
> > @@ -1226,6 +1226,38 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
> > EXPORT_SYMBOL(drm_crtc_vblank_off);
> >
> > /**
> > + * drm_crtc_vblank_reset - reset vblank state to off on a CRTC
> > + * @crtc: CRTC in question
> > + *
> > + * Drivers can use this function to reset the vblank state to off at load
> > time.
> > + * Drivers should use this together with the drm_crtc_vblank_off() and
> > + * drm_crtc_vblank_on() functions. The diffrence comparet to
>
> s/diffrence comparet/difference compared/
>
> With that fixed,
>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Fixed while applying, thanks for the feedback.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2015-02-23 9:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-13 20:03 [PATCH 1/5] drm/irq: Add drm_crtc_vblank_reset Daniel Vetter
2015-02-13 20:03 ` [PATCH 2/5] drm/i915: Drop pipe_enable checks in vblank funcs Daniel Vetter
2015-02-13 20:03 ` [PATCH 3/5] drm/i915: Flatten DRIVER_MODESET checks in i915_irq.c Daniel Vetter
2015-02-13 20:03 ` [PATCH 4/5] drm/i915: Switch to drm_crtc variants of vblank functions Daniel Vetter
2015-02-13 20:03 ` [PATCH 5/5] drm/irq: Don't call ->get_vblank_counter directly from irq_uninstall/cleanup Daniel Vetter
2015-02-14 9:38 ` shuang.he
2015-02-17 13:42 ` Imre Deak
2015-02-22 11:17 ` [PATCH] " Daniel Vetter
2015-02-23 0:20 ` shuang.he
2015-02-22 14:11 ` [PATCH 1/2] " Daniel Vetter
2015-02-22 14:11 ` [PATCH 2/2] drm: WARN if drm_handle_vblank is called errornously Daniel Vetter
2015-02-23 2:26 ` shuang.he
2015-02-23 9:52 ` Daniel Vetter
2015-02-15 14:08 ` [PATCH 1/5] drm/irq: Add drm_crtc_vblank_reset Laurent Pinchart
2015-02-23 9:54 ` 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=20150223095424.GV24485@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.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