<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jul 8, 2017 1:59 PM, "Christian König" <<a href="mailto:deathsimple@vodafone.de">deathsimple@vodafone.de</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">Am 08.07.2017 um 00:27 schrieb Marek Olšák:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Jul 7, 2017 at 9:37 PM, Dave Airlie <<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 8 July 2017 at 04:07, Christian König <<a href="mailto:deathsimple@vodafone.de" target="_blank">deathsimple@vodafone.de</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Am 07.07.2017 um 18:51 schrieb Marek Olšák:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Jul 7, 2017 at 11:18 AM, Christian König<br>
<<a href="mailto:deathsimple@vodafone.de" target="_blank">deathsimple@vodafone.de</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What tilling format have the destination textures?<br>
<br>
Sounds like the offset is just added so that we distribute memory<br>
accesses<br>
more equally over memory channels.<br>
</blockquote>
You can't set an offset that is not aligned. The hardware ignores the<br>
low unaligned bits, so they have a different meaning. They specify<br>
pipe and bank rotation for macro tiling. It's like a state. It<br>
basically rotates the tile pattern.<br>
</blockquote>
<br>
Yeah, I know. That's what I meant with distributing memory accesses more<br>
equally over all channels. The lower bits select a memory bank swizzle IIRC.<br>
<br>
I've tried years ago with R600 if shuffling them randomly could improve<br>
performance, but MRT wasn't widely used and/or supported at that time.<br>
</blockquote>
I'd known this and forgotten, the public CIK docs say bits 0..7 must be zero,<br>
but I have older docs which had more info. It would be nice if we could get<br>
proper docs released for the bottom bits considering AMD are using them in their<br>
drivers.<br>
</blockquote></blockquote>
<br></div>
I'm pretty sure AMD released that stuff years ago because I knew of it before starting to work for AMD.</blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">I think it was first released as addrlib source code. Some people might have had access to docs under NDA, but it wasn't known publicly. I didn't know it when I started at AMD.</div><div dir="auto"><br></div><div dir="auto">Marek</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The low 8 bits of the address are unused and can't be set, because<br>
CB_COLOR0_BASE is shifted by 8 bits. We are really talking about bits<br>
starting from 8 going higher. E.g. 8K alignment gives you 5 bits that<br>
can be used to express the rotation.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It would be good to know what registers have the bits that matter (i.e. BASE,<br>
FMASK, CMASK, DCC, and resource descriptors.)<br>
</blockquote></blockquote>
<br></div>
The feature to select the memory pipe/bank to start with is implemented in the MC. So AFAIK all blocks are programmed the same way regarding this. E.g. you can use it for UVD/VCE as well.<div class="quoted-text"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Then I suppose we'd need to know the algorithm for programming them, and<br>
if we need to make any allocations bigger in order to do so.<br>
</blockquote></blockquote>
<br></div>
As far as I understand it you don't need to make anything bigger. Addrlib makes sure anyway that all pipe/banks are covered by a texture allocation as soon as you select some tilling mode (linear is obviously an exception).<br>
<br>
Regards,<br>
Christian.<div class="elided-text"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I expect this only starts to matter when we hit memory bandwidth limits,<br>
the deferred demo does 3 MRT, one depth at 2kx2k then samples from those<br>
down to 1280x720 displayed. This combined with a 3 instanced 57k vertex<br>
draw seemed to be enough to see the pain. (Maybe a GL example doing something<br>
similiar might show the problem for radeonsi).<br>
</blockquote>
Addrlib contains the encoding code for the base address pipe/bank bits.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The other open question I have, is does this just matter for MRT or does texture<br>
sampling also get some boost from it, my hack patch does it for only<br>
surfaces which<br>
will end up attached to the CB.<br>
</blockquote>
Yes, it should be done for read-only textures too.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'll update the patch to not call it an offset but name them the tile<br>
rotation bits.<br>
</blockquote>
The proper name is "tile swizzle" or "pipe/bank swizzle". On gfx9,<br>
it's called "pipe/bank xor".<br>
<br>
Marek<br>
</blockquote>
<br>
<br>
</div></blockquote></div><br></div></div></div>