drm/i915: Kill intel_crtc->vbl_wait
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 22 May 2014 16:00:50 +0000 (19:00 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 8 Aug 2014 15:43:26 +0000 (17:43 +0200)
Share the waitqueue that drm_irq uses when performing the vblank evade
trick for atomic pipe updates.

v2: Keep intel_pipe_handle_vblank() (Chris)

Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_sprite.c

index 390ccc2a3096670d636af14a0164dd237a43d66c..0e44c433cfc34de0082d46f50cca2f4a7b562992 100644 (file)
@@ -1989,14 +1989,9 @@ static void gen6_rps_irq_handler(struct drm_i915_private *dev_priv, u32 pm_iir)
 
 static bool intel_pipe_handle_vblank(struct drm_device *dev, enum pipe pipe)
 {
-       struct intel_crtc *crtc;
-
        if (!drm_handle_vblank(dev, pipe))
                return false;
 
-       crtc = to_intel_crtc(intel_get_crtc_for_pipe(dev, pipe));
-       wake_up(&crtc->vbl_wait);
-
        return true;
 }
 
index 620a89961d36228fc94ea079ea3418dbee4baec5..a9b351d1ff889ab99f28e56ffb01fb019681737b 100644 (file)
@@ -11870,8 +11870,6 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
        intel_crtc->cursor_base = ~0;
        intel_crtc->cursor_cntl = ~0;
 
-       init_waitqueue_head(&intel_crtc->vbl_wait);
-
        BUG_ON(pipe >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
               dev_priv->plane_to_crtc_mapping[intel_crtc->plane] != NULL);
        dev_priv->plane_to_crtc_mapping[intel_crtc->plane] = &intel_crtc->base;
index 7a3cac095afea9e06fa2bd522e4924cfd5511e4d..3198de3007be8a77446ba7657c8d9129f6331457 100644 (file)
@@ -425,8 +425,6 @@ struct intel_crtc {
                struct intel_pipe_wm active;
        } wm;
 
-       wait_queue_head_t vbl_wait;
-
        int scanline_offset;
        struct intel_mmio_flip mmio_flip;
 };
index 168c6652cda198731a2afa7d2675658f86ff6023..d34a5696ffb616560c7f963bc54ee69a94dffa5f 100644 (file)
@@ -53,6 +53,7 @@ static bool intel_pipe_update_start(struct intel_crtc *crtc, uint32_t *start_vbl
        enum pipe pipe = crtc->pipe;
        long timeout = msecs_to_jiffies_timeout(1);
        int scanline, min, max, vblank_start;
+       wait_queue_head_t *wq = drm_crtc_vblank_waitqueue(&crtc->base);
        DEFINE_WAIT(wait);
 
        WARN_ON(!drm_modeset_is_locked(&crtc->base.mutex));
@@ -81,7 +82,7 @@ static bool intel_pipe_update_start(struct intel_crtc *crtc, uint32_t *start_vbl
                 * other CPUs can see the task state update by the time we
                 * read the scanline.
                 */
-               prepare_to_wait(&crtc->vbl_wait, &wait, TASK_UNINTERRUPTIBLE);
+               prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
 
                scanline = intel_get_crtc_scanline(crtc);
                if (scanline < min || scanline > max)
@@ -100,7 +101,7 @@ static bool intel_pipe_update_start(struct intel_crtc *crtc, uint32_t *start_vbl
                local_irq_disable();
        }
 
-       finish_wait(&crtc->vbl_wait, &wait);
+       finish_wait(wq, &wait);
 
        drm_vblank_put(dev, pipe);