From: Peter Clifton <pcjc2@cam.ac.uk>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"mesa3d-dev@lists.sourceforge.net"
<mesa3d-dev@lists.sourceforge.net>
Subject: Re: i915_gem_evict_something in sysprof trace using VBOs
Date: Fri, 05 Nov 2010 14:30:35 +0000 [thread overview]
Message-ID: <1288967435.11782.31.camel@pcjc2lap> (raw)
In-Reply-To: <1288957454.4728.19.camel@pcjc2lap>
[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]
On Fri, 2010-11-05 at 11:44 +0000, Peter Clifton wrote:
> I take bets its "something I've done wrong", as usually seems to be the
> way, but for now - if I just use glBufferSubData to upload changed data
> only, I get rendering corruption. It works fine with
> LIBGL_ALWAYS_SOFTWARE=1 though, so there is perhaps a small possibility
> of a driver bug?
Does this look correct? Forcing the Gen6 fallback for BufferSubData
fixes my corruption. Seems as if the blit is going wrong. The PRM
suggests the pitch needs to be DWORD aligned,
The attached patch fixes it. What I can't quite fathom is how this has
escaped until now.. am I doing something unusual by calling
glBufferSubData with large buffers?
Could someone with access to MESA repositories review and commit it
please?
--
Peter Clifton
Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA
Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)
[-- Attachment #2: 0001-intel-Fix-emit_linear_blit-to-use-DWORD-aligned-widt.patch --]
[-- Type: text/x-patch, Size: 1479 bytes --]
>From 055cd27dbdf225c084f4bc2254763dba016edd50 Mon Sep 17 00:00:00 2001
From: Peter Clifton <pcjc2@cam.ac.uk>
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 <pcjc2@cam.ac.uk>
---
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
[-- Attachment #3: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2010-11-05 14:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-05 10:21 i915_gem_evict_something in sysprof trace using VBOs Peter Clifton
2010-11-05 10:35 ` Chris Wilson
2010-11-05 11:44 ` Peter Clifton
2010-11-05 14:30 ` Peter Clifton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1288967435.11782.31.camel@pcjc2lap \
--to=pcjc2@cam.ac.uk \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mesa3d-dev@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox