drm/udl: properly set active_16 flag in udl_crtc_page_flip(). (v2)
authorHaixia Shi <hshi@chromium.org>
Fri, 30 Jan 2015 18:57:27 +0000 (10:57 -0800)
committerDave Airlie <airlied@gmail.com>
Sat, 31 Jan 2015 00:12:23 +0000 (10:12 +1000)
When page flipping, we need to mark the new fb as active and unmark the active
flag for the old fb (if different).

Signed-off-by: Haixia Shi <hshi@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Dave Airlie <airlied@gmail.com>
drivers/gpu/drm/udl/udl_modeset.c

index 1701f1dfb23f50044145fceeb1d94d8caed7bbd7..677190a65e827484d76239bb6f324c91f21ebbfd 100644 (file)
@@ -340,11 +340,11 @@ static int udl_crtc_mode_set(struct drm_crtc *crtc,
 
        wrptr = udl_dummy_render(wrptr);
 
-       ufb->active_16 = true;
        if (old_fb) {
                struct udl_framebuffer *uold_fb = to_udl_fb(old_fb);
                uold_fb->active_16 = false;
        }
+       ufb->active_16 = true;
        udl->mode_buf_len = wrptr - buf;
 
        /* damage all of it */
@@ -373,6 +373,13 @@ static int udl_crtc_page_flip(struct drm_crtc *crtc,
        struct drm_device *dev = crtc->dev;
        unsigned long flags;
 
+       struct drm_framebuffer *old_fb = crtc->primary->fb;
+       if (old_fb) {
+               struct udl_framebuffer *uold_fb = to_udl_fb(old_fb);
+               uold_fb->active_16 = false;
+       }
+       ufb->active_16 = true;
+
        udl_handle_damage(ufb, 0, 0, fb->width, fb->height);
 
        spin_lock_irqsave(&dev->event_lock, flags);