From: Daniel Vetter <daniel@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 2/2] drm: WARN if drm_handle_vblank is called errornously
Date: Mon, 23 Feb 2015 10:52:45 +0100 [thread overview]
Message-ID: <20150223095245.GU24485@phenom.ffwll.local> (raw)
In-Reply-To: <1424614280-29571-2-git-send-email-daniel.vetter@ffwll.ch>
On Sun, Feb 22, 2015 at 03:11:20PM +0100, Daniel Vetter wrote:
> KMS drivers are in full control of their irq and vblank handling, if
> they get a vblank interrupt before drm_vblank_init or after
> drm_vblank_cleanup that's just a driver bug.
>
> For ums driver there's only r128 and radeon which support vblank, and
> they call drm_vblank_init in their driver load functions. Which again
> means that userspace can do whatever it wants with interrupt, vblank
> structures will always be there.
>
> So this should never happen, let's catch driver issues with a WARN_ON.
> Motivated by some discussions with Imre.
>
> v2: Use WARN_ON_ONCE as suggested by Imre.
>
> Cc: Imre Deak <imre.deak@intel.com>
> Reviewed-by: Imre Deak <imre.deak@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Merged the entire series to dinq with Dave's irc-ack for the core bits.
Thanks a lot for the review feedback.
-Daniel
> ---
> drivers/gpu/drm/drm_irq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index 3c18e522cc3b..dbece03979f3 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -1682,7 +1682,7 @@ bool drm_handle_vblank(struct drm_device *dev, int crtc)
> struct timeval tvblank;
> unsigned long irqflags;
>
> - if (!dev->num_crtcs)
> + if (WARN_ON_ONCE(!dev->num_crtcs))
> return false;
>
> if (WARN_ON(crtc >= dev->num_crtcs))
> --
> 1.9.3
>
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next 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 [this message]
2015-02-15 14:08 ` [PATCH 1/5] drm/irq: Add drm_crtc_vblank_reset Laurent Pinchart
2015-02-23 9:54 ` Daniel Vetter
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=20150223095245.GU24485@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 \
/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