intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 2/4] drm: vblank cannot be enabled if dev->irq_enabled is false
Date: Fri, 17 Mar 2017 20:20:28 +0000	[thread overview]
Message-ID: <20170317202030.24410-2-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20170317202030.24410-1-chris@chris-wilson.co.uk>

Since we cannot enable the vblank if !dev->irq_enabled, we assert that
checking for both !vblank->enabled and !dev->irq_enabled is tautological
and only need the former. The only time it may differ is when racing
with drm_irq_uninstall(), but that will then disable the vblank and
wakeup the waiters.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/drm_irq.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index c47e07c89136..a164cf51d093 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -1647,10 +1647,9 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
 		DRM_DEBUG("waiting on vblank count %u, crtc %u\n",
 			  vblwait->request.sequence, pipe);
 		DRM_WAIT_ON(ret, vblank->queue, 3 * HZ,
-			    (((drm_vblank_count(dev, pipe) -
-			       vblwait->request.sequence) <= (1 << 23)) ||
-			     !READ_ONCE(vblank->enabled) ||
-			     !dev->irq_enabled));
+			    (drm_vblank_count(dev, pipe) -
+			     vblwait->request.sequence) <= (1 << 23) ||
+			    !READ_ONCE(vblank->enabled));
 	}
 
 	if (ret != -EINTR) {
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-03-17 20:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-17 20:20 [PATCH v2 1/4] drm: Mark up accesses of vblank->enabled outside of its spinlock Chris Wilson
2017-03-17 20:20 ` Chris Wilson [this message]
2017-03-17 20:20 ` [PATCH v2 3/4] drm: Refactor vblank sequence number comparison Chris Wilson
2017-03-22  8:54   ` Michel Dänzer
2017-03-22 10:06   ` [PATCH v2] " Chris Wilson
2017-03-23  3:23     ` Michel Dänzer
2017-03-29 11:32       ` Ville Syrjälä
2017-03-17 20:20 ` [PATCH v2 4/4] drm: Peek at the current counter/timestamp for vblank queries Chris Wilson
2017-03-17 20:37 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/4] drm: Mark up accesses of vblank->enabled outside of its spinlock Patchwork
2017-03-17 20:44 ` [PATCH v2 1/4] " Ville Syrjälä
2017-03-22 10:37 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/4] drm: Mark up accesses of vblank->enabled outside of its spinlock (rev2) 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=20170317202030.24410-2-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --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;
as well as URLs for NNTP newsgroup(s).