public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Ben Widawsky <benjamin.widawsky@intel.com>,
	Intel GFX <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Replace has_bsd/blt/vebox with a mask
Date: Tue, 15 Oct 2013 08:03:25 -0700	[thread overview]
Message-ID: <20131015150325.GA4729@bwidawsk.net> (raw)
In-Reply-To: <20131015085039.GE29463@nuc-i3427.alporthouse.com>

On Tue, Oct 15, 2013 at 09:50:39AM +0100, Chris Wilson wrote:
> On Mon, Oct 14, 2013 at 08:46:22PM -0700, Ben Widawsky wrote:
> > -cleanup_vebox_ring:
> > -	intel_cleanup_ring_buffer(&dev_priv->ring[VECS]);
> > -cleanup_blt_ring:
> > -	intel_cleanup_ring_buffer(&dev_priv->ring[BCS]);
> > -cleanup_bsd_ring:
> > -	intel_cleanup_ring_buffer(&dev_priv->ring[VCS]);
> > -cleanup_render_ring:
> > -	intel_cleanup_ring_buffer(&dev_priv->ring[RCS]);
> > +cleanup:
> > +	for_each_ring(ring, dev_priv, i) {
> > +		if (!(INTEL_INFO(dev)->ring_mask & (1<<i)) ||
> > +		    !ring->name)
> > +			continue;
> 
> This looks dubious. You don't need to check ring_mask here as that will
> be implicit in whatever we test for completeness. ring->name is set at
> the start of initialisation and is not cleaned upon error. A better
> choice is ring->obj, which we already check in
> intel_cleanup_ring_buffer.
> 
> So this becomes:
> cleanup:
>   for_each_ring(ring, dev_priv, i)
> > +		intel_cleanup_ring_buffer(ring);
> 
> -Chris
> 

Actually, I just plopped this code in at the last minute because I
wanted to provide a sample usage in the patch too. I do have some issues
in the future of using for_each_ring(), hopefully you remember those...

In any event, I'll gladly drop this hunk. Can you review the rest?

P.S. if you want my acked-by on this above mentioned cleanup, have it.

-- 
Ben Widawsky, Intel Open Source Technology Center

  reply	other threads:[~2013-10-15 15:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-14 17:01 [PATCH 1/2] drm/i915: Do a fuller init after reset Ben Widawsky
2013-10-14 17:01 ` [PATCH 2/2] drm/i915: cleanup context fini Ben Widawsky
2013-10-14 21:24 ` [PATCH 1/2] drm/i915: Do a fuller init after reset Chris Wilson
2013-10-14 22:07   ` Ben Widawsky
2013-10-15  3:46 ` [PATCH] drm/i915: Replace has_bsd/blt/vebox with a mask Ben Widawsky
2013-10-15  8:50   ` Chris Wilson
2013-10-15 15:03     ` Ben Widawsky [this message]
2013-10-15 15:08       ` Chris Wilson
2013-10-15 17:02         ` Ben Widawsky
2013-10-16  9:09           ` Daniel Vetter

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=20131015150325.GA4729@bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=benjamin.widawsky@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox