Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Clifton <pcjc2@cam.ac.uk>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] intel: Fix emit_linear_blit to use DWORD aligned width blits
Date: Tue, 09 Nov 2010 10:52:36 +0000	[thread overview]
Message-ID: <1289299956.2999.8.camel@pcjc2lap> (raw)
In-Reply-To: <5b55a1$ijc3pt@fmsmga002.fm.intel.com>

On Sun, 2010-11-07 at 10:25 +0000, Chris Wilson wrote:
> On Sat, 06 Nov 2010 10:04:31 +0000, Peter Clifton <pcjc2@cam.ac.uk> wrote:
> > Fixes corruption with glBufferSubData on my machine,
> > 
> > Can someone review and push?
> 
> Oddly, the pitch for BLT is in bytes and it should be sufficient to be a
> multiple of element-size. Or two element-size depending on circumstances. 
> 
> Just to satisfy my curiosity, what happens with (1<<15 - 2)?

I've not tried that yet, but the PRM does state that BLT pitch is in
DWORDs.


We do this:

   src_pitch *= cpp;
   dst_pitch *= cpp;

Converting a pitch passed to the blit function in _pixels_, to a pitch
in bytes, but further dragons lurking I think:

Also, only on non I915 defined builds of intel_blit.c, we also do things
like:

   if (dst_tiling != I915_TILING_NONE) {
      CMD |= XY_DST_TILED;
      dst_pitch /= 4;
   }


The G45 PRM doesn't appear to specify pitch is in DWORDS _only_ for
tiled surfaces, merely that there is further restriction:

"
Source Pitch (double word aligned) and in DWords: [15:00] 2’s
complement.

For Tiled Src (bit 15 enabled) this pitch is of 512Byte granularity and
can be upto 128Kbytes (or 32KDwords).
"

Truthfully, I'm not quite sure I understand what the implication for a
tiled surface is.. or how pitch should be calculated correctly for that
case.. but it does seem clear that our handing for non-tiled surfaces is
suspect.


-- 
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)

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2010-11-09 10:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-06 10:04 [PATCH] intel: Fix emit_linear_blit to use DWORD aligned width blits Peter Clifton
2010-11-07 10:25 ` Chris Wilson
2010-11-09 10:52   ` Peter Clifton [this message]
2010-11-09 11:34     ` Peter Clifton
2010-11-09 11:43       ` Chris Wilson
  -- strict thread matches above, loose matches on Subject: below --
2010-11-06  9:23 Peter Clifton

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=1289299956.2999.8.camel@pcjc2lap \
    --to=pcjc2@cam.ac.uk \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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