From: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
To: daniel.vetter@intel.com, intel-gfx@lists.freedesktop.org
Cc: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Subject: [RFC] drm: drm_vblank_cleanup: WARN when refcount is more than 0
Date: Thu, 12 Oct 2017 22:30:06 +0530 [thread overview]
Message-ID: <20171012170006.21169-1-prasannatsmkumar@gmail.com> (raw)
Warn when refcount > 0 in drm_vblank_cleanup.
In i915 driver unload drm_vblank_get is added to test whether this patch
is working. This will be removed once the patch gets tested.
Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
---
drivers/gpu/drm/drm_vblank.c | 2 ++
drivers/gpu/drm/i915/i915_drv.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 70f2b95..2a6630a 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -402,6 +402,8 @@ void drm_vblank_cleanup(struct drm_device *dev)
if (dev->num_crtcs == 0)
return;
+ WARN_ON(atomic_read(&vblank->refcount) > 0);
+
for (pipe = 0; pipe < dev->num_crtcs; pipe++) {
struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 9f45cfe..c7a93a9 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1373,6 +1373,7 @@ void i915_driver_unload(struct drm_device *dev)
struct drm_i915_private *dev_priv = to_i915(dev);
struct pci_dev *pdev = dev_priv->drm.pdev;
+ drm_vblank_get(dev_priv, 0);
i915_driver_unregister(dev_priv);
if (i915_gem_suspend(dev_priv))
--
2.10.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2017-10-12 17:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 17:00 PrasannaKumar Muralidharan [this message]
2017-10-12 17:07 ` [RFC] drm: drm_vblank_cleanup: WARN when refcount is more than 0 Chris Wilson
2017-10-12 17:10 ` PrasannaKumar Muralidharan
2017-10-12 17:21 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-10-12 17:22 ` [RFC] " Ville Syrjälä
2017-10-12 17:32 ` PrasannaKumar Muralidharan
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=20171012170006.21169-1-prasannatsmkumar@gmail.com \
--to=prasannatsmkumar@gmail.com \
--cc=daniel.vetter@intel.com \
--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 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.