From: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> drm_crtc_vblank_get call the drm_vblank_prepare that will be used soon to control power saving states or anything else that needs a mutex before the vblank happens. local_irq_disable disables kernel preemption so we won't be able to use mutex inside drm_crtc_vblank_get. For this reason we need to move the drm_crtc_vblank_get a little up before disabling the interruptions. Another option would be to use local_irq_enable + local_irq_disable around the drm_crtc_vblank_get, but let's avoid touching the kernel states if we can call the vblank_get a bit earlier. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> --- drivers/gpu/drm/i915/intel_sprite.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index 97b1a54..3351c7e 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c @@ -94,13 +94,15 @@ void intel_pipe_update_start(struct intel_crtc *crtc) min = vblank_start - usecs_to_scanlines(adjusted_mode, 100); max = vblank_start - 1; - local_irq_disable(); - - if (min <= 0 || max <= 0) + if (WARN_ON(drm_crtc_vblank_get(&crtc->base))) return; - if (WARN_ON(drm_crtc_vblank_get(&crtc->base))) + local_irq_disable(); + + if (min <= 0 || max <= 0) { + drm_crtc_vblank_put(&crtc->base); return; + } crtc->debug.min_vbl = min; crtc->debug.max_vbl = max; -- 2.5.0 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx