<p dir="ltr"><br>
On Jul 16, 2015 5:03 PM, "Jordan Justen" <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>> wrote:<br>
><br>
> On 2015-07-16 14:37:59, Jason Ekstrand wrote:<br>
> >    On Jul 16, 2015 4:35 PM, "Jordan Justen" <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
> >    wrote:<br>
> >    ><br>
> >    > On 2015-07-16 13:59:45, Jason Ekstrand wrote:<br>
> >    > >    On Jul 16, 2015 2:00 PM, "Jordan Justen"<br>
> >    <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
> >    > >    wrote:<br>
> >    > >    ><br>
> >    > >    > This prevents an assertion failure in brw_fs_live_variables.cpp,<br>
> >    > >    > fs_live_variables::setup_one_write: Assertion `var < num_vars'<br>
> >    failed.<br>
> >    > ><br>
> >    > >    Best guess is that you should just fix regs_read to return the<br>
> >    right value<br>
> >    > >    (1 in this case).  Most other send instructions use mlen but that<br>
> >    may not<br>
> >    > >    be needed tour CS_TERMINATE.<br>
> >    ><br>
> >    > I think regs_read will fix a similar assert in setup_one_read. The MOV<br>
> >    > will still hit the setup_one_write assert. Should I be generating the<br>
> >    > MOV differently?<br>
> >    ><br>
> >    > For example<br>
> >    ><br>
> >    >    bld.group(8, 0).exec_all().MOV(payload, g0);<br>
> ><br>
> >    Yes, that's how we need to do the MOV.<br>
> ><br>
> >    Out of curiosity, why are you emitting a MOV at all and not just calling<br>
> >    CS_TERMINATE with g0 directly?<br>
><br>
> While sending from g0 appears to work, apparently we are supposed to<br>
> do the final send from a high register. Ken found some wording that<br>
> appeared to indicate that we needed to do this even on compute:</p>
<p dir="ltr">Right... That makes sense. Might be worth a comment somewhere of you don't have one already.<br>
--Jason</p>
<p dir="ltr">> <a href="http://article.gmane.org/gmane.comp.video.mesa3d.devel/98098">http://article.gmane.org/gmane.comp.video.mesa3d.devel/98098</a><br>
><br>
> -Jordan<br>
><br>
> >    > works in combo with an update to regs_read.<br>
> >    ><br>
> >    > -Jordan<br>
> >    ><br>
> >    > >    > Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
> >    > >    > Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
> >    > >    > ---<br>
> >    > >    >  src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 7 ++++---<br>
> >    > >    >  1 file changed, 4 insertions(+), 3 deletions(-)<br>
> >    > >    ><br>
> >    > >    > diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
> >    > >    b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
> >    > >    > index 94d6a58..62dfb9a 100644<br>
> >    > >    > --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
> >    > >    > +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
> >    > >    > @@ -1960,11 +1960,12 @@ fs_visitor::emit_cs_terminate()<br>
> >    > >    >      */<br>
> >    > >    >     struct brw_reg g0 = retype(brw_vec8_grf(0, 0),<br>
> >    > >    BRW_REGISTER_TYPE_UD);<br>
> >    > >    >     fs_reg payload = fs_reg(GRF, alloc.allocate(1),<br>
> >    > >    BRW_REGISTER_TYPE_UD);<br>
> >    > >    > -   bld.exec_all().MOV(payload, g0);<br>
> >    > >    > +   const fs_builder bld8 = bld.group(8, 0);<br>
> >    > >    > +   bld8.exec_all().MOV(payload, g0);<br>
> >    > >    ><br>
> >    > >    >     /* Send a message to the thread spawner to terminate the<br>
> >    thread. */<br>
> >    > >    > -   fs_inst *inst = bld.exec_all()<br>
> >    > >    > -                      .emit(CS_OPCODE_CS_TERMINATE, reg_undef,<br>
> >    > >    payload);<br>
> >    > >    > +   fs_inst *inst = bld8.exec_all()<br>
> >    > >    > +                       .emit(CS_OPCODE_CS_TERMINATE, reg_undef,<br>
> >    > >    payload);<br>
> >    > >    >     inst->eot = true;<br>
> >    > >    >  }<br>
> >    > >    ><br>
> >    > >    > --<br>
> >    > >    > 2.1.4<br>
> >    > >    ><br>
</p>