From: Ben Widawsky Subject: Re: [PATCH 1/5] drm/i915: clean up ring id/semaphore sync index magic Date: Thu, 15 Sep 2011 19:11:00 -0700 Message-ID: <20110915191100.779dca67@bwidawsk.net> References: <1316138941-6537-1-git-send-email-ben@bwidawsk.net> <1316138941-6537-2-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 04AA79F390 for ; Thu, 15 Sep 2011 19:10:44 -0700 (PDT) In-Reply-To: <1316138941-6537-2-git-send-email-ben@bwidawsk.net> 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: Ben Widawsky Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, 15 Sep 2011 19:08:57 -0700 Ben Widawsky wrote: > From: Daniel Vetter > > The calculation of the semaphore sync register index is obfuscated > by some pointer calculation to get at the ring id (RCS, VCS and BCS). > Now we already have a ring->id field, but that contains a flag value > usefull for ORing together multiple rings - that's what the flushing > code as the user of this field needs. > > So change the meaning of ring->id to be the real id, add a tiny > helper for those that actually want a flag and use ring->id in the > semaphore index calculations. > > Also extract the inverse function intel_sync_index_to_ring_id and > move it right next to intel_ring_sync_index. > > v2: Simplify RING_SYNC macro as suggested by Chris Wilson. > > Signed-off-by: Daniel Vetter Crap, I forgot: Signed-off-by: Ben Widawsky