• Russell King's avatar
    drm: imx: convert to drm_crtc_send_vblank_event() · 63b66be9
    Russell King authored
    commit 69d21fc0 upstream.
    
    ipu_crtc_handle_pageflip() was calling drm_send_vblank_event() with
    a pipe argument of -1.  Commit cc1ef118 ("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: 6556f7f8 ("drm: imx: Move imx-drm driver out of staging")
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
    Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
    63b66be9
ipuv3-crtc.c 12.4 KB