From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915: Record the tail at each request and use it to estimate the head Date: Wed, 08 Feb 2012 19:21:33 +0000 Message-ID: References: <20120208145149.GC5030@phenom.ffwll.local> <1328724390-28037-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id BA0A19E746 for ; Wed, 8 Feb 2012 11:21:39 -0800 (PST) In-Reply-To: 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: Eugeni Dodonov Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, 8 Feb 2012 16:56:30 -0200, Eugeni Dodonov wrote: > On Wed, Feb 8, 2012 at 16:06, Chris Wilson wrote: > > + /* Record the position of the start of the request so that > > + * should we detect the updated seqno part-way through the > > + * GPU processing the request, we never over-estimate the > > + * position of the head. > > + */ > > + request_ring_position = intel_ring_get_tail(ring); > > > Perhaps a stupid question within the bikeshedding spirit, but why do we > need intel_ring_get_tail()? Wouldn't just: > > request_ring_position = ring->tail; > > be self-explainable? Or some additional logic could be involved there at > some point? It is to try and preserve the illusion of a ringbuffer abstraction; the position of the request within the ring should be an internal detail of the ring but we are leaking it for our purposes. The use of a function there serves as a reminder of that leak (and easier to find than ring->tail) in the hope that someone will clean up the entire ringbuffer API and make the issue moot. -Chris -- Chris Wilson, Intel Open Source Technology Centre