From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 09/17] drm/i915: init ring->id early Date: Sun, 15 Dec 2013 12:13:23 -0800 Message-ID: <20131215201322.GA8778@bwidawsk.net> References: <1386994565-29395-1-git-send-email-benjamin.widawsky@intel.com> <1386994565-29395-10-git-send-email-benjamin.widawsky@intel.com> <20131214214534.GC5054@nuc-i3427.alporthouse.com> <20131215014242.GA614@bwidawsk.net> <20131215092411.GE5054@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 5087FFA494 for ; Sun, 15 Dec 2013 12:13:28 -0800 (PST) Content-Disposition: inline In-Reply-To: <20131215092411.GE5054@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Chris Wilson , Ben Widawsky , Intel GFX List-Id: intel-gfx@lists.freedesktop.org On Sun, Dec 15, 2013 at 09:24:11AM +0000, Chris Wilson wrote: > On Sat, Dec 14, 2013 at 05:42:42PM -0800, Ben Widawsky wrote: > > On Sat, Dec 14, 2013 at 09:45:34PM +0000, Chris Wilson wrote: > > > On Fri, Dec 13, 2013 at 08:15:57PM -0800, Ben Widawsky wrote: > > > > Having the ring id all set up will allow us to use some macro shortcuts > > > > during ringbuffer init. Admittedly it leaves the code a bit confusing, > > > > having the initialization of the id member in a separate place - but I > > > > think the savings is worth it. > > > > > > This is not required since the macro could be written more simply as > > > ring[i]->id == i. > > > -Chris > > > > > > > It could be written as ring->id = i. Is that what you mean? I didn't > > quite follow the "not required" part. > > Afaict this pre-init is only required because the macro you wrote > depends upon ring[n]->id, but the macro can be trivially written not to > use ring[n]->id but n. > -Chris > It appears so. I know for certain something blew up with an earlier version of this patch, but the original version was indeed not the same. I do need ring->id for the macro, but that's not a problem here. So yeah, look like good advice, and I feel silly. -- Ben Widawsky, Intel Open Source Technology Center