From patchwork Fri Nov 5 14:30:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Clifton X-Patchwork-Id: 304132 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA5EUwqc021489 for ; Fri, 5 Nov 2010 14:31:23 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F20689ECFA for ; Fri, 5 Nov 2010 07:30:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from ppsw-50.csi.cam.ac.uk (ppsw-50.csi.cam.ac.uk [131.111.8.150]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F2439E79D for ; Fri, 5 Nov 2010 07:30:38 -0700 (PDT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from client-82-26-201-5.pete.adsl.virginmedia.com ([82.26.201.5]:16252 helo=[192.168.1.2]) by ppsw-50.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:465) with esmtpsa (LOGIN:pcjc2) (SSLv3:DHE-RSA-CAMELLIA256-SHA:256) id 1PENJM-0008Kg-qt (Exim 4.72) (return-path ); Fri, 05 Nov 2010 14:30:36 +0000 From: Peter Clifton To: Chris Wilson In-Reply-To: <1288957454.4728.19.camel@pcjc2lap> References: <1288952467.24411.44.camel@pcjc2lap> <5b55a1$iitkru@fmsmga002.fm.intel.com> <1288957454.4728.19.camel@pcjc2lap> Date: Fri, 05 Nov 2010 14:30:35 +0000 Message-ID: <1288967435.11782.31.camel@pcjc2lap> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Cc: "intel-gfx@lists.freedesktop.org" , "mesa3d-dev@lists.sourceforge.net" Subject: Re: [Intel-gfx] i915_gem_evict_something in sysprof trace using VBOs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 05 Nov 2010 14:31:23 +0000 (UTC) From 055cd27dbdf225c084f4bc2254763dba016edd50 Mon Sep 17 00:00:00 2001 From: Peter Clifton Date: Fri, 5 Nov 2010 14:26:24 +0000 Subject: [PATCH] intel: Fix emit_linear_blit to use DWORD aligned width blits The width of the 2D blits used to copy the data is defined as a 16-bit signed integer, but the pitch must be DWORD aligned. Limit to an integral number of DWORDs, (1 << 15 - 4) rather than (1 << 15 -1). Fixes corruption to data uploaded with glBufferSubData. Signed-off-by: Peter Clifton --- src/mesa/drivers/dri/intel/intel_blit.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index a74e217..4dc8888 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -483,8 +483,11 @@ intel_emit_linear_blit(struct intel_context *intel, /* Blits are in a different ringbuffer so we don't use them. */ assert(intel->gen < 6); - /* The pitch is a signed value. */ - pitch = MIN2(size, (1 << 15) - 1); + /* The pitch hits the GPU as a is a signed value, IN DWORDs. + * But we want width to match pitch. Max width is (1 << 15 -1), + * rounding that down to the nearest DWORD is 1 << 15 - 3 + */ + pitch = MIN2(size, (1 << 15) - 4); height = size / pitch; ok = intelEmitCopyBlit(intel, 1, pitch, src_bo, src_offset, I915_TILING_NONE, -- 1.7.1