Skip to content

Commit 69d21fc

Browse files
Russell KingpH5
authored andcommitted
drm: imx: convert to drm_crtc_send_vblank_event()
ipu_crtc_handle_pageflip() was calling drm_send_vblank_event() with a pipe argument of -1. Commit cc1ef11 ("drm/irq: Make pipe unsigned and name consistent") now makes this error obvious, as we now may get a warning from: if (WARN_ON(pipe >= dev->num_crtcs)) in drm_vblank_count_and_time(). Prior to this change, we would end up making out-of-bounds array accesses via: struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; and *vblanktime = vblanktimestamp(dev, pipe, cur_vblank); So, this has been broken for a very long time, and is not a result of the above commit. Since we don't care about the staging versions, I've tagged this with the earliest mainline commit where we do care, even though this commit did not introduce the bug. Fixes: 6556f7f ("drm: imx: Move imx-drm driver out of staging") Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
1 parent 3f3a728 commit 69d21fc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/imx/ipuv3-crtc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc)
212212

213213
spin_lock_irqsave(&drm->event_lock, flags);
214214
if (ipu_crtc->page_flip_event)
215-
drm_send_vblank_event(drm, -1, ipu_crtc->page_flip_event);
215+
drm_crtc_send_vblank_event(&ipu_crtc->base,
216+
ipu_crtc->page_flip_event);
216217
ipu_crtc->page_flip_event = NULL;
217218
imx_drm_crtc_vblank_put(ipu_crtc->imx_crtc);
218219
spin_unlock_irqrestore(&drm->event_lock, flags);

0 commit comments

Comments
 (0)