From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH] drm/i915: Replace has_bsd/blt/vebox with a mask Date: Tue, 15 Oct 2013 08:03:25 -0700 Message-ID: <20131015150325.GA4729@bwidawsk.net> References: <1381770097-1450-1-git-send-email-benjamin.widawsky@intel.com> <1381808782-14214-1-git-send-email-benjamin.widawsky@intel.com> <20131015085039.GE29463@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.bwidawsk.net (bwidawsk.net [166.78.191.112]) by gabe.freedesktop.org (Postfix) with ESMTP id 6402BE66F8 for ; Tue, 15 Oct 2013 08:03:30 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20131015085039.GE29463@nuc-i3427.alporthouse.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: Chris Wilson , Ben Widawsky , Intel GFX List-Id: intel-gfx@lists.freedesktop.org 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< > + !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