All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Clark <rob.clark@linaro.org>
To: dri-devel@lists.freedesktop.org
Cc: patches@linaro.org, daniel.vetter@ffwll.ch,
	laurent.pinchart@ideasonboard.com, gregkh@linuxfoundation.org,
	Rob Clark <rob@ti.com>,
	bskeggs@redhat.com
Subject: [PATCH 08/11] drm/imx: use drm_send_vblank_event() helper
Date: Mon,  8 Oct 2012 14:50:46 -0500	[thread overview]
Message-ID: <1349725849-22433-9-git-send-email-rob.clark@linaro.org> (raw)
In-Reply-To: <1349725849-22433-1-git-send-email-rob.clark@linaro.org>

From: Rob Clark <rob@ti.com>

Also, slightly changes the behavior to always put the vblank irq,
even if userspace did not request a vblank event.  As far as I
can tell, the previous code would leak a vblank irq refcnt if
userspace requested a pageflip without event.

Signed-off-by: Rob Clark <rob@ti.com>
---
 drivers/staging/imx-drm/ipuv3-crtc.c |   21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c b/drivers/staging/imx-drm/ipuv3-crtc.c
index 78d3eda..8fa0f4d 100644
--- a/drivers/staging/imx-drm/ipuv3-crtc.c
+++ b/drivers/staging/imx-drm/ipuv3-crtc.c
@@ -311,31 +311,14 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
 
 static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc)
 {
-	struct drm_pending_vblank_event *e;
-	struct timeval now;
 	unsigned long flags;
 	struct drm_device *drm = ipu_crtc->base.dev;
 
 	spin_lock_irqsave(&drm->event_lock, flags);
-
-	e = ipu_crtc->page_flip_event;
-	if (!e) {
-		spin_unlock_irqrestore(&drm->event_lock, flags);
-		return;
-	}
-
-	do_gettimeofday(&now);
-	e->event.sequence = 0;
-	e->event.tv_sec = now.tv_sec;
-	e->event.tv_usec = now.tv_usec;
+	if (ipu_crtc->page_flip_event)
+		drm_send_vblank_event(drm, -1, ipu_crtc->page_flip_event);
 	ipu_crtc->page_flip_event = NULL;
-
 	imx_drm_crtc_vblank_put(ipu_crtc->imx_crtc);
-
-	list_add_tail(&e->base.link, &e->base.file_priv->event_list);
-
-	wake_up_interruptible(&e->base.file_priv->event_wait);
-
 	spin_unlock_irqrestore(&drm->event_lock, flags);
 }
 
-- 
1.7.9.5

  parent reply	other threads:[~2012-10-08 19:51 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 19:50 [PATCH 00/11] page-flip cleanups and fixes Rob Clark
2012-10-08 19:50 ` [PATCH 01/11] drm: add drm_send_vblank_event() helper Rob Clark
2012-10-08 21:26   ` Marcin Slusarz
2012-10-11 14:19   ` Laurent Pinchart
2012-10-11 14:43     ` Rob Clark
2012-10-13  0:28     ` Mario Kleiner
2012-10-16 12:53       ` Laurent Pinchart
2012-10-08 19:50 ` [PATCH 02/11] drm/i915: use " Rob Clark
2012-10-09  8:02   ` Daniel Vetter
2012-11-21 16:48   ` Daniel Vetter
2012-10-08 19:50 ` [PATCH 03/11] drm/nouveau: " Rob Clark
2012-10-08 19:50 ` [PATCH 04/11] drm/radeon: " Rob Clark
2012-10-08 19:50 ` [PATCH 05/11] drm/exynos: " Rob Clark
2013-05-21 23:19   ` Dave Airlie
2013-05-22  2:28     ` Inki Dae
2013-05-22  4:04   ` [PATCH] " Inki Dae
2013-05-22  4:51     ` Joonyoung Shim
2013-05-22  6:56       ` Inki Dae
2013-05-22  6:59     ` [PATCH RESEND] " Inki Dae
2012-10-08 19:50 ` [PATCH 06/11] drm/exynos: page flip fixes Rob Clark
2013-05-21 23:17   ` Dave Airlie
2013-05-22  2:36     ` Inki Dae
2012-10-08 19:50 ` [PATCH 07/11] drm/shmob: use drm_send_vblank_event() helper Rob Clark
2012-10-08 19:50 ` Rob Clark [this message]
2012-10-08 19:50 ` [PATCH 09/11] drm/imx: page flip fixes Rob Clark
2013-05-21 23:18   ` Dave Airlie
2012-10-08 19:50 ` [PATCH 10/11] drm/omap: use drm_send_vblank_event() helper Rob Clark
2012-10-10  3:33   ` Mario Kleiner
2012-10-10 11:03     ` Rob Clark
2012-10-12 23:38       ` Mario Kleiner
2012-10-08 19:50 ` [PATCH 11/11] drm/omap: page-flip fixes Rob Clark
2012-10-09  9:35   ` Imre Deak
2012-10-09  9:38     ` Imre Deak
2012-10-08 20:51 ` [PATCH 00/11] page-flip cleanups and fixes Alex Deucher
2012-10-08 22:10 ` Marcin Slusarz
2012-10-09  5:17 ` Inki Dae
2012-10-22 22:39 ` Greg KH
2012-10-22 22:51   ` Rob Clark

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=1349725849-22433-9-git-send-email-rob.clark@linaro.org \
    --to=rob.clark@linaro.org \
    --cc=bskeggs@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=patches@linaro.org \
    --cc=rob@ti.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 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.