public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Move drm_framebuffer_unreference out of struct_mutex for takeover
Date: Tue, 14 Apr 2015 12:00:15 +0300	[thread overview]
Message-ID: <20150414090015.GJ11009@intel.com> (raw)
In-Reply-To: <1428937383-5949-1-git-send-email-tvrtko.ursulin@linux.intel.com>

On Mon, Apr 13, 2015 at 04:03:03PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> intel_user_framebuffer_destroy() requires the struct_mutex for its
> object bookkeeping, so this means that all calls to
> drm_framebuffer_unreference must be held without that lock.
> 
> This is a simplified version of the identically named patch by Chris Wilson.
> 
>     Regression from commit ab8d66752a9c28cd6c94fa173feacdfc1554aa03
>     Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>     Date:   Mon Feb 2 15:44:15 2015 +0000
> 
>         drm/i915: Track old framebuffer instead of object
> 
> v2: Bikeshedding.
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=89166
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 97922fb..5fb11bc 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14739,6 +14739,7 @@ void intel_modeset_gem_init(struct drm_device *dev)
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct drm_crtc *c;
>  	struct drm_i915_gem_object *obj;
> +	int ret;
>  
>  	mutex_lock(&dev->struct_mutex);
>  	intel_init_gt_powersave(dev);
> @@ -14763,16 +14764,18 @@ void intel_modeset_gem_init(struct drm_device *dev)
>  	 * pinned & fenced.  When we do the allocation it's too early
>  	 * for this.
>  	 */
> -	mutex_lock(&dev->struct_mutex);
>  	for_each_crtc(dev, c) {
>  		obj = intel_fb_obj(c->primary->fb);
>  		if (obj == NULL)
>  			continue;
>  
> -		if (intel_pin_and_fence_fb_obj(c->primary,
> -					       c->primary->fb,
> -					       c->primary->state,
> -					       NULL)) {
> +		mutex_lock(&dev->struct_mutex);
> +		ret = intel_pin_and_fence_fb_obj(c->primary,
> +						 c->primary->fb,
> +						 c->primary->state,
> +						 NULL);
> +		mutex_unlock(&dev->struct_mutex);
> +		if (ret) {
>  			DRM_ERROR("failed to pin boot fb on pipe %d\n",
>  				  to_intel_crtc(c)->pipe);
>  			drm_framebuffer_unreference(c->primary->fb);
> @@ -14780,7 +14783,6 @@ void intel_modeset_gem_init(struct drm_device *dev)
>  			update_state_fb(c->primary);
>  		}
>  	}
> -	mutex_unlock(&dev->struct_mutex);
>  
>  	intel_backlight_register(dev);
>  }
> -- 
> 2.3.5

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-04-14  9:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13 15:03 [PATCH] drm/i915: Move drm_framebuffer_unreference out of struct_mutex for takeover Tvrtko Ursulin
2015-04-13 18:18 ` shuang.he
2015-04-14  9:00 ` Ville Syrjälä [this message]
2015-04-14 13:19   ` Jani Nikula
  -- strict thread matches above, loose matches on Subject: below --
2015-03-26 12:39 Tvrtko Ursulin
2015-03-26 13:30 ` Ville Syrjälä
2015-03-26 14:05   ` Tvrtko Ursulin
2015-04-13 12:09     ` Jani Nikula
2015-04-13 13:37       ` Tvrtko Ursulin
2015-04-13 13:52         ` Ville Syrjälä
2015-03-26 20:13 ` shuang.he

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150414090015.GJ11009@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=tvrtko.ursulin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox