From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 2/2] drm/i915: Warn if ring tail is not qword aligned Date: Mon, 26 Nov 2012 19:40:16 +0200 Message-ID: <20121126174016.GB20128@intel.com> References: <1353934099-18685-1-git-send-email-ville.syrjala@linux.intel.com> <1353934099-18685-3-git-send-email-ville.syrjala@linux.intel.com> <453bf0$6k5283@azsmga001.ch.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 13DE6E6251 for ; Mon, 26 Nov 2012 09:40:25 -0800 (PST) Content-Disposition: inline In-Reply-To: <453bf0$6k5283@azsmga001.ch.intel.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 Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, Nov 26, 2012 at 04:25:47PM +0000, Chris Wilson wrote: > On Mon, 26 Nov 2012 14:48:19 +0200, ville.syrjala@linux.intel.com wrote: > > From: Ville Syrj=E4l=E4 > > = > > Ringbuffer tail pointer must be qword aligned. Warn if someone > > makes a mistake and forgets to pad the ring when the commands > > inserted into the ring don't align to qword naturally. > = > The assertion should be that we wrote precisely the number of dwords we > declared in intel_ring_begin(). Which is one of the important factors to > check whenever reviewing such code. This assertion (which should be a > BUG_ON) is no substitute for such review. Yeah. I was considering adding some reserved_space field to the ring, populate it in ring_begin(), and and make sure it was correctly consumed at ring_advance(). If you think that sounds good, I can cook up a patch for it. -- = Ville Syrj=E4l=E4 Intel OTC