diff options
author | Rob Clark <rob@ti.com> | 2012-10-08 15:50:46 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-05-21 19:13:42 -0400 |
commit | 0eca56f9467038ee0b798637f03581aaa1186fac (patch) | |
tree | b0129e5ad19229f0950a65e83613856b3d707934 | |
parent | f7e96d7e28817a66db36e89f25b77bda7dba6da0 (diff) |
drm/imx: use drm_send_vblank_event() helper
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>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/staging/imx-drm/ipuv3-crtc.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c b/drivers/staging/imx-drm/ipuv3-crtc.c index b028b0d1317b..1cd74f5e4c76 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, | |||
311 | 311 | ||
312 | static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc) | 312 | static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc) |
313 | { | 313 | { |
314 | struct drm_pending_vblank_event *e; | ||
315 | struct timeval now; | ||
316 | unsigned long flags; | 314 | unsigned long flags; |
317 | struct drm_device *drm = ipu_crtc->base.dev; | 315 | struct drm_device *drm = ipu_crtc->base.dev; |
318 | 316 | ||
319 | spin_lock_irqsave(&drm->event_lock, flags); | 317 | spin_lock_irqsave(&drm->event_lock, flags); |
320 | 318 | if (ipu_crtc->page_flip_event) | |
321 | e = ipu_crtc->page_flip_event; | 319 | drm_send_vblank_event(drm, -1, ipu_crtc->page_flip_event); |
322 | if (!e) { | ||
323 | spin_unlock_irqrestore(&drm->event_lock, flags); | ||
324 | return; | ||
325 | } | ||
326 | |||
327 | do_gettimeofday(&now); | ||
328 | e->event.sequence = 0; | ||
329 | e->event.tv_sec = now.tv_sec; | ||
330 | e->event.tv_usec = now.tv_usec; | ||
331 | ipu_crtc->page_flip_event = NULL; | 320 | ipu_crtc->page_flip_event = NULL; |
332 | |||
333 | imx_drm_crtc_vblank_put(ipu_crtc->imx_crtc); | 321 | imx_drm_crtc_vblank_put(ipu_crtc->imx_crtc); |
334 | |||
335 | list_add_tail(&e->base.link, &e->base.file_priv->event_list); | ||
336 | |||
337 | wake_up_interruptible(&e->base.file_priv->event_wait); | ||
338 | |||
339 | spin_unlock_irqrestore(&drm->event_lock, flags); | 322 | spin_unlock_irqrestore(&drm->event_lock, flags); |
340 | } | 323 | } |
341 | 324 | ||