From: Chris Wilson Subject: Re: [PATCH] convert intel_ring_begin count to dword Date: Sat, 12 Jun 2010 10:22:10 +0100 Message-ID: <89khjo$flr437@orsmga002.jf.intel.com> References: <1276334094-6117-1-git-send-email-nanhai.zou@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 0062C9E78C for ; Sat, 12 Jun 2010 02:22:13 -0700 (PDT) In-Reply-To: <1276334094-6117-1-git-send-email-nanhai.zou@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: Zou Nan hai , Anholt Eric , intel-gfx List-Id: intel-gfx@lists.freedesktop.org On Sat, 12 Jun 2010 17:14:54 +0800, Zou Nan hai wrote: > convert intel_ring_begin count to dword, > fix some wrong intel_ring_begin size. > > Signed-off-by: Zou Nan hai > --- > @@ -723,10 +723,10 @@ int intel_wait_ring_buffer(struct drm_device *dev, > void intel_ring_begin(struct drm_device *dev, > struct intel_ring_buffer *ring, int n) Let's make the prototype a little clearer and s/n/num_dwords/... > { And then: int n = 4 * num_dwords; > - if (unlikely(ring->tail + n > ring->size)) > + if (unlikely(ring->tail + 4*n > ring->size)) > intel_wrap_ring_buffer(dev, ring); > - if (unlikely(ring->space < n)) > - intel_wait_ring_buffer(dev, ring, n); > + if (unlikely(ring->space < 4*n)) > + intel_wait_ring_buffer(dev, ring, 4*n); > } > > void intel_ring_emit(struct drm_device *dev, > @@ -752,7 +752,7 @@ void intel_fill_struct(struct drm_device *dev, > { > unsigned int *virt = ring->virtual_start + ring->tail; > BUG_ON((len&~(4-1)) != 0); > - intel_ring_begin(dev, ring, len); > + intel_ring_begin(dev, ring, len/4); Admittedly this is the fly in the ointment. -ickle -- Chris Wilson, Intel Open Source Technology Centre