]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm: rcar-du: Clear handled event pointer in CRTC state
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 12 Feb 2017 00:45:11 +0000 (02:45 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 4 Apr 2017 14:03:47 +0000 (17:03 +0300)
The atomic commit helper requires drivers to clear the event pointer
stored in the CRTC state when the event is handled. In preparation to
using the helper, fix the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
drivers/gpu/drm/rcar-du/rcar_du_crtc.c

index 04046c0faffd8d7e6f075f035ce933365a48da6e..7391dd95c7330ffd74a17c3538cd97b8991a7a73 100644 (file)
@@ -501,16 +501,16 @@ static void rcar_du_crtc_disable(struct drm_crtc *crtc)
 static void rcar_du_crtc_atomic_begin(struct drm_crtc *crtc,
                                      struct drm_crtc_state *old_crtc_state)
 {
-       struct drm_pending_vblank_event *event = crtc->state->event;
        struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
        struct drm_device *dev = rcrtc->crtc.dev;
        unsigned long flags;
 
-       if (event) {
+       if (crtc->state->event) {
                WARN_ON(drm_crtc_vblank_get(crtc) != 0);
 
                spin_lock_irqsave(&dev->event_lock, flags);
-               rcrtc->event = event;
+               rcrtc->event = crtc->state->event;
+               crtc->state->event = NULL;
                spin_unlock_irqrestore(&dev->event_lock, flags);
        }