All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/overlay: Fix unpinning along init error paths
Date: Tue, 28 Jun 2011 17:32:14 +0100	[thread overview]
Message-ID: <1309278734_34912@CP5-2952> (raw)
In-Reply-To: <20110628155714.GA2961@snipes.kumite>

On Tue, 28 Jun 2011 08:57:14 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> > diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
> > index cffd3ed..d360380 100644
> > --- a/drivers/gpu/drm/i915/intel_overlay.c
> > +++ b/drivers/gpu/drm/i915/intel_overlay.c
> > @@ -1405,6 +1405,11 @@ void intel_setup_overlay(struct drm_device *dev)
> >  	overlay = kzalloc(sizeof(struct intel_overlay), GFP_KERNEL);
> >  	if (!overlay)
> >  		return;
> > +
> > +	mutex_lock(&dev->struct_mutex);
> > +	if (WARN_ON(dev_priv->overlay))
> > +		goto out_free;
> > +
> >  	overlay->dev = dev;
> >  
> >  	reg_bo = i915_gem_alloc_object(dev, PAGE_SIZE);
> 
> For my curiosity, was there a reason you chose to acquire the lock after
> the kzalloc?

I was just trying to keep the error paths as simple as possible. Overtime,
we probably want to lift the mutex out of this function and higher into
the init paths for simplicity.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2011-06-28 16:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28 10:27 [PATCH] drm/i915/overlay: Fix unpinning along init error paths Chris Wilson
2011-06-28 15:57 ` Ben Widawsky
2011-06-28 16:32   ` Chris Wilson [this message]
2011-06-28 16:08 ` Keith Packard

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=1309278734_34912@CP5-2952 \
    --to=chris@chris-wilson.co.uk \
    --cc=ben@bwidawsk.net \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.