From patchwork Wed Oct 31 22:03:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 1681921 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id C0FBCDFB80 for ; Wed, 31 Oct 2012 22:06:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A9C5A0DBD for ; Wed, 31 Oct 2012 15:06:41 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 936E7A0C62; Wed, 31 Oct 2012 15:03:43 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 31 Oct 2012 15:03:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,688,1344236400"; d="scan'208";a="211950436" Received: from ideak-desk.fi.intel.com (HELO localhost) ([10.237.72.98]) by azsmga001.ch.intel.com with ESMTP; 31 Oct 2012 15:03:42 -0700 From: Imre Deak To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/i915: lock event_lock for drm_vblank_off() Date: Thu, 1 Nov 2012 00:03:39 +0200 Message-Id: <1351721019-8040-2-git-send-email-imre.deak@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351721019-8040-1-git-send-email-imre.deak@intel.com> References: <1351721019-8040-1-git-send-email-imre.deak@intel.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org drm_vblank_off() requires callers to hold the event_lock. Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b453901..56f1119 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3413,6 +3413,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) struct intel_encoder *encoder; int pipe = intel_crtc->pipe; int plane = intel_crtc->plane; + unsigned long flags; u32 reg, temp; @@ -3423,7 +3424,11 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) encoder->disable(encoder); intel_crtc_wait_for_pending_flips(crtc); + + spin_lock_irqsave(&dev->event_lock, flags); drm_vblank_off(dev, pipe); + spin_unlock_irqrestore(&dev->event_lock, flags); + intel_crtc_update_cursor(crtc, false); intel_disable_plane(dev_priv, plane, pipe); @@ -3495,6 +3500,7 @@ static void haswell_crtc_disable(struct drm_crtc *crtc) int plane = intel_crtc->plane; enum transcoder cpu_transcoder = intel_crtc->cpu_transcoder; bool is_pch_port; + unsigned long flags; if (!intel_crtc->active) return; @@ -3505,7 +3511,11 @@ static void haswell_crtc_disable(struct drm_crtc *crtc) encoder->disable(encoder); intel_crtc_wait_for_pending_flips(crtc); + + spin_lock_irqsave(&dev->event_lock, flags); drm_vblank_off(dev, pipe); + spin_unlock_irqrestore(&dev->event_lock, flags); + intel_crtc_update_cursor(crtc, false); intel_disable_plane(dev_priv, plane, pipe); @@ -3617,6 +3627,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc) struct intel_encoder *encoder; int pipe = intel_crtc->pipe; int plane = intel_crtc->plane; + unsigned long flags; if (!intel_crtc->active) @@ -3627,7 +3638,11 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc) /* Give the overlay scaler a chance to disable if it's on this pipe */ intel_crtc_wait_for_pending_flips(crtc); + + spin_lock_irqsave(&dev->event_lock, flags); drm_vblank_off(dev, pipe); + spin_unlock_irqrestore(&dev->event_lock, flags); + intel_crtc_dpms_overlay(intel_crtc, false); intel_crtc_update_cursor(crtc, false);