<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, 9 Feb 2016 at 12:47 Marek Olšák <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Feb 9, 2016 at 6:17 PM, Alexandre Demers<br>
<<a href="mailto:alexandre.f.demers@gmail.com" target="_blank">alexandre.f.demers@gmail.com</a>> wrote:<br>
>> +            /* The kernel returns 12 for some cards for an unknown<br>
>> reason.<br>
>> +             * I thought this was supposed to be a power of two.<br>
>> +             */<br>
>> +            if (ws->gen == DRV_SI && ws->info.num_tile_pipes == 12)<br>
>> +                ws->info.num_tile_pipes = 8;<br>
>> +<br>
><br>
> I may be late in the conversation, but shouldn't we have a look at why the<br>
> value reported by the kernel is wrong for "some" cards? Which ones and why<br>
> should be identified. It seems to be limited to Southern Islands as far as<br>
> we know for now, which limits the scope for now.<br>
><br>
> Also, about the patch itself, even if only some cards were reported to be<br>
> problematic, why would we limit it to "ws->gen == DRV_SI"? Any cards<br>
> reporting a wrong value should be treated the same way by mapping its value<br>
> from 12 to 8, no?<br>
<br>
No. Only one card is affected (Tahiti or Pitcairn, I don't remember<br>
which one). No other card reports 12.<br>
<br>
There is no point in looking into why the value is wrong and I haven't<br>
been able to find where the value had come from. It's part of the<br>
kernel ABI now anyway. Userspace won't use it anymore.<br>
<br>
Marek<br></blockquote>Well, meanwhile, I went on and I had a look at the kernel settings. Here is the answer and the "problem": <div><br></div><div>This was returned by radeon_info_ioctl(), case RADEON_INFO_NUM_TILE_PIPES, else if (rdev->family >= CHIP_TAHITI) *value = rdev->config.si.max_tile_pipes;</div><div>(<a href="http://lxr.free-electrons.com/source/drivers/gpu/drm/radeon/radeon_kms.c#L353">http://lxr.free-electrons.com/source/drivers/gpu/drm/radeon/radeon_kms.c#L353</a>)</div><div><br></div><div>Searching where max_tile_pipes was set, it seems the value comes from <span class="hl opt"><font color="#010181"><span style="font-size:13.3333px;line-height:normal">si_gpu_init()</span></font><font color="#000000"><span style="font-size:13.3333px;line-height:normal">, case CHIP_TAHITI</span></font></span><span style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal">, </span><span style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal">rdev</span><span class="hl opt" style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal">-></span><span style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal">config</span><span class="hl opt" style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal">.</span><span style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal">si</span><span class="hl opt" style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal">.</span><span style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal">max_tile_pipes </span><span class="hl opt" style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal">=</span><span style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal"> </span><span class="hl num" style="font-size:13.3333px;line-height:normal;color:rgb(41,40,255)">12</span></div><div><span class="hl num" style="font-size:13.3333px;line-height:normal;color:rgb(41,40,255)"><font color="#000000" style="font-size:13.3333px">(</font><span style="color:rgb(33,33,33);font-size:small;line-height:20px"><a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/radeon/si.c">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/radeon/si.c</a>)</span><br></span></div><div><br><div><span class="hl num" style="font-size:13.3333px;line-height:normal"><font color="#000000">This is probably wrong, all other GPU having a power of 2 value (I had a look at ni.c, si.c, evergreen.c). Either that or</font></span> we have a special case for Tahiti.</div><br>Also, if this is a special case, while comparing how things works between si.c and cik.c, I saw that (si | cik)_<span style="color:rgb(1,1,129);font-size:13.3333px;line-height:normal">tiling_mode_table_init() were not exactly mapping gpus the same way: si.c uses the family, while cik.c uses the </span><span style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal">max_tile_pipes value and defaults any value over 8 to be treated as 16.</span></div><div><span style="color:rgb(0,0,0);font-size:13.3333px;line-height:normal"><br></span></div><div><font color="#000000"><span style="font-size:13.3333px;line-height:normal">If this can be of any help / reflection...</span></font></div><div><font color="#000000"><span style="font-size:13.3333px;line-height:normal">Alexandre Demers</span></font></div></div></div>