<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Aug 7, 2015 at 11:07 AM, Mathias Fröhlich <span dir="ltr"><<a href="mailto:Mathias.Froehlich@gmx.net" target="_blank">Mathias.Froehlich@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div style="font-family:'Monospace';font-size:9pt;font-weight:400;font-style:normal">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Hi,</p><span class="">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">On Friday, August 07, 2015 10:28:10 Ilia Mirkin wrote:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> > One alternative I can see is to call _tnl_InvalidateState without the</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> > _NEW_VIEWPORT and</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> ></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> > _NEW_BUFFERS flag set instead of _tnl_wakeup in the two nouveau early</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> > initialization</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> ></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> > code paths in nouveau_swtnl_t.c and nv04_render.c. That should also bring</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> > us back to</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> ></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> > the original behavior.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> ></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> That seems like a bit of a hack. If you think it's OK, I'm just going to</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> introduce the DrawBuffer check. Brian, does that seem OK to you? I'm mostly</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> unfamiliar with the TnL module, its APIs, and when/how they're supposed to</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> be used. But nouveau_vieux calls tnl_wakeup right in its context creation</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> pass. nv04/nv05 don't have hwtnl at all, nv10+ have it, but it has various</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> limitations, with which we end up using swtnl.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
</span><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">To be honest, I did not expect the _tnl_InvalidateState function to be called</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">much differently than through _mesa_update_state where it is usually called</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">through a driver provided UpdateState callback. If you look where</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">_tnl_InvalidateState is used you can see this pattern broadly used.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">The only exception is that it is also called through _tnl_wakeup which sounds</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">to me like something that is not meant for initialization purpose. Actually,</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">only nouveau uses this call for initialization stuff. So, to me the question</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">looks like: what is the right way to initialize nouveau.</p></div></blockquote><div><br></div><div>Yeah, I tend to agree with you -- it seems like _tnl_wakeup is meant for "oh hey, I shut you down and haven't been sending you updates, but I want to use you again, so please update your stuff to match reality". Does it even need to be called at all? nouveau_state.c:nouveau_update_state unconditionally calls _tnl_InvalidateState. i965, on the other hand, the only other user of tnl_wakeup, calls it at draw time, for RenderMode != GL_RENDER, and never calls _tnl_InvalidateState, so the tnl module is completely out-of-date there.</div><div><br></div><div>So I'm actually in favor of removing it entirely. Thoughts?</div><div><br></div><div>  -ilia</div></div></div></div>