drm/i915: optimize vblank waits in set_base_atomic
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 2 Jun 2013 15:23:01 +0000 (17:23 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 3 Jun 2013 12:16:12 +0000 (14:16 +0200)
We only need to do them if the pipe is actually running and if the
framebuffers have changed. Removes two "wait for vblank timed out"
messages when doing a suspend/resume cycle on my i855gm.

v2: s/to_intel_ctrc(crtc)/intel_crtc/ spotted by Chris.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index c112466bb76912e7aaed471d6f8336353709f8b3..988e3dee5ece9d4071b1340659a9e808ef814e22 100644 (file)
@@ -2212,7 +2212,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
        crtc->y = y;
 
        if (old_fb) {
-               intel_wait_for_vblank(dev, intel_crtc->pipe);
+               if (intel_crtc->active && old_fb != fb)
+                       intel_wait_for_vblank(dev, intel_crtc->pipe);
                intel_unpin_fb_obj(to_intel_framebuffer(old_fb)->obj);
        }