From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rodrigo Vivi Subject: Re: [PATCH 01/10] drm/i915: Grab struct_mutex around all FBC updates Date: Wed, 20 Nov 2013 14:39:22 -0800 Message-ID: <20131120223708.GA4234@bratislava.jf.intel.com> References: <1383771745-22463-1-git-send-email-ville.syrjala@linux.intel.com> <1383771745-22463-2-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 97BB5FCEDC for ; Wed, 20 Nov 2013 14:39:22 -0800 (PST) Received: by mail-pd0-f171.google.com with SMTP id z10so8657205pdj.2 for ; Wed, 20 Nov 2013 14:39:22 -0800 (PST) Content-Disposition: inline In-Reply-To: <1383771745-22463-2-git-send-email-ville.syrjala@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Nov 06, 2013 at 11:02:16PM +0200, ville.syrjala@linux.intel.com wro= te: > From: Ville Syrj=E4l=E4 > = > We need some protection for the FBC state, and since struct_mutex > is it currently in most places, make sure all FBC update/disable > calles are protected by it. Why don't you create a new mutex only for fbc update? > = > Signed-off-by: Ville Syrj=E4l=E4 > --- > drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > = > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/= intel_display.c > index 12cf362..bce6e07 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -3576,8 +3576,10 @@ static void haswell_crtc_disable_planes(struct drm= _crtc *crtc) > drm_vblank_off(dev, pipe); > = > /* FBC must be disabled before disabling the plane on HSW. */ > + mutex_lock(&dev->struct_mutex); > if (dev_priv->fbc.plane =3D=3D plane) > intel_disable_fbc(dev); > + mutex_unlock(&dev->struct_mutex); > = > hsw_disable_ips(intel_crtc); > = > @@ -3717,8 +3719,10 @@ static void ironlake_crtc_disable(struct drm_crtc = *crtc) > intel_crtc_wait_for_pending_flips(crtc); > drm_vblank_off(dev, pipe); > = > + mutex_lock(&dev->struct_mutex); > if (dev_priv->fbc.plane =3D=3D plane) > intel_disable_fbc(dev); > + mutex_unlock(&dev->struct_mutex); > = > intel_crtc_update_cursor(crtc, false); > intel_disable_planes(crtc); > @@ -4102,7 +4106,9 @@ static void valleyview_crtc_enable(struct drm_crtc = *crtc) > intel_enable_planes(crtc); > intel_crtc_update_cursor(crtc, true); > = > + mutex_lock(&dev->struct_mutex); > intel_update_fbc(dev); > + mutex_unlock(&dev->struct_mutex); > = > for_each_encoder_on_crtc(dev, crtc, encoder) > encoder->enable(encoder); > @@ -4146,7 +4152,9 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc) > /* Give the overlay scaler a chance to enable if it's on this pipe */ > intel_crtc_dpms_overlay(intel_crtc, true); > = > + mutex_lock(&dev->struct_mutex); > intel_update_fbc(dev); > + mutex_unlock(&dev->struct_mutex); > = > for_each_encoder_on_crtc(dev, crtc, encoder) > encoder->enable(encoder); > @@ -4210,7 +4218,9 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc) > intel_crtc->active =3D false; > intel_update_watermarks(crtc); > = > + mutex_lock(&dev->struct_mutex); > intel_update_fbc(dev); > + mutex_unlock(&dev->struct_mutex); > } > = > static void i9xx_crtc_off(struct drm_crtc *crtc) > -- = > 1.8.1.5 > = > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx