drm: imx: convert to drm_crtc_send_vblank_event()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 25 Nov 2015 10:25:39 +0000 (10:25 +0000)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Wed, 25 Nov 2015 10:37:41 +0000 (11:37 +0100)
commit69d21fc0a21196e9c5b259505c0135a88002f9d2
treea0a39fa3c878cbfd781b4e785c10f4664513e352
parent3f3a7280d4cafd28036378198280640dfc6492aa
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 cc1ef118fc09 ("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: 6556f7f82b9c ("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>
drivers/gpu/drm/imx/ipuv3-crtc.c