<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 13, 2016 at 9:01 AM, Pohjolainen, Topi <span dir="ltr"><<a href="mailto:topi.pohjolainen@intel.com" target="_blank">topi.pohjolainen@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Jul 13, 2016 at 07:14:47AM -0700, Jason Ekstrand wrote:<br>
>    On Jul 13, 2016 1:34 AM, "Topi Pohjolainen"<br>
</span><span class="">>    <[1]<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>> wrote:<br>
>    ><br>
>    > Setup for pixel shader push constants is the same as for other<br>
>    > stages. Note that on gen8+ the if-else branches were identical<br>
>    > and the generation check for packet size redundant.<br>
><br>
>    It tripped me up a bit that you didn't have a generation check for<br>
>    packet size in the gen7 version that's now getting used on gen7-9.<br>
<br>
</span>They are still separate, gen7 and gen8+ have their own functions:<br>
<br>
gen7_blorp_disable_constant_state() and<br>
gen8_blorp_disable_constant_state()<br></blockquote><div><br></div><div>Sorry, I missed that. :(<br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
>    However, the extra dwords just turn into noops anyway so it's OK.<br>
><br>
</span>>    > Signed-off-by: Topi Pohjolainen <[2]<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
<div><div class="h5">>    > ---<br>
>    >  src/mesa/drivers/dri/i965/gen7_blorp.c | 27 ++++--------------<br>
>    >  src/mesa/drivers/dri/i965/gen8_blorp.c | 50<br>
>    ++++------------------------------<br>
>    >  2 files changed, 12 insertions(+), 65 deletions(-)<br>
>    ><br>
>    > diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.c<br>
>    b/src/mesa/drivers/dri/i965/gen7_blorp.c<br>
>    > index abdc4be..72ab082 100644<br>
>    > --- a/src/mesa/drivers/dri/i965/gen7_blorp.c<br>
>    > +++ b/src/mesa/drivers/dri/i965/gen7_blorp.c<br>
>    > @@ -233,7 +233,7 @@ gen7_blorp_emit_surface_state(struct brw_context<br>
>    *brw,<br>
>    >   * buffer are valid.<br>
>    >   */<br>
>    >  static void<br>
>    > -gen7_blorp_emit_disable_constant_state(struct brw_context *brw,<br>
>    > +gen7_blorp_disable_constant_state(struct brw_context *brw,<br>
>    >                                         unsigned opcode)<br>
>    >  {<br>
>    >     BEGIN_BATCH(7);<br>
>    > @@ -570,20 +570,6 @@ gen7_blorp_emit_sampler_state_pointers_ps(struct<br>
>    brw_context *brw,<br>
>    >     ADVANCE_BATCH();<br>
>    >  }<br>
>    ><br>
>    > -void<br>
>    > -gen7_blorp_emit_constant_ps_disable(struct brw_context *brw)<br>
>    > -{<br>
>    > -   BEGIN_BATCH(7);<br>
>    > -   OUT_BATCH(_3DSTATE_CONSTANT_PS << 16 | (7 - 2));<br>
>    > -   OUT_BATCH(0);<br>
>    > -   OUT_BATCH(0);<br>
>    > -   OUT_BATCH(0);<br>
>    > -   OUT_BATCH(0);<br>
>    > -   OUT_BATCH(0);<br>
>    > -   OUT_BATCH(0);<br>
>    > -   ADVANCE_BATCH();<br>
>    > -}<br>
>    > -<br>
>    >  static void<br>
>    >  gen7_blorp_emit_depth_stencil_config(struct brw_context *brw,<br>
>    >                                       const struct brw_blorp_params<br>
>    *params)<br>
>    > @@ -779,10 +765,11 @@ gen7_blorp_exec(struct brw_context *brw,<br>
>    >        gen7_blorp_emit_cc_state_pointer(brw, cc_state_offset);<br>
>    >     }<br>
>    ><br>
>    > -   gen7_blorp_emit_disable_constant_state(brw,<br>
>    _3DSTATE_CONSTANT_VS);<br>
>    > -   gen7_blorp_emit_disable_constant_state(brw,<br>
>    _3DSTATE_CONSTANT_HS);<br>
>    > -   gen7_blorp_emit_disable_constant_state(brw,<br>
>    _3DSTATE_CONSTANT_DS);<br>
>    > -   gen7_blorp_emit_disable_constant_state(brw,<br>
>    _3DSTATE_CONSTANT_GS);<br>
>    > +   gen7_blorp_disable_constant_state(brw, _3DSTATE_CONSTANT_VS);<br>
>    > +   gen7_blorp_disable_constant_state(brw, _3DSTATE_CONSTANT_HS);<br>
>    > +   gen7_blorp_disable_constant_state(brw, _3DSTATE_CONSTANT_DS);<br>
>    > +   gen7_blorp_disable_constant_state(brw, _3DSTATE_CONSTANT_GS);<br>
>    > +   gen7_blorp_disable_constant_state(brw, _3DSTATE_CONSTANT_PS);<br>
>    ><br>
>    >     depthstencil_offset = gen6_blorp_emit_depth_stencil_state(brw,<br>
>    params);<br>
>    >     gen7_blorp_emit_depth_stencil_state_pointers(brw,<br>
>    depthstencil_offset);<br>
>    > @@ -821,8 +808,6 @@ gen7_blorp_exec(struct brw_context *brw,<br>
>    >     if (params->wm_prog_data)<br>
>    >        gen7_blorp_emit_binding_table_pointers_ps(brw,<br>
>    wm_bind_bo_offset);<br>
>    ><br>
>    > -   gen7_blorp_emit_constant_ps_disable(brw);<br>
>    > -<br>
</div></div>>    >     if (params->[3]<a href="http://src.mt" rel="noreferrer" target="_blank">src.mt</a>) {<br>
<div><div class="h5">>    >        const uint32_t sampler_offset =<br>
>    >           gen6_blorp_emit_sampler_state(brw, BRW_MAPFILTER_LINEAR, 0,<br>
>    true);<br>
>    > diff --git a/src/mesa/drivers/dri/i965/gen8_blorp.c<br>
>    b/src/mesa/drivers/dri/i965/gen8_blorp.c<br>
>    > index 21fcd9e..f68aba5 100644<br>
>    > --- a/src/mesa/drivers/dri/i965/gen8_blorp.c<br>
>    > +++ b/src/mesa/drivers/dri/i965/gen8_blorp.c<br>
>    > @@ -161,7 +161,7 @@ gen8_blorp_emit_blend_state(struct brw_context<br>
>    *brw,<br>
>    >   * buffer are valid.<br>
>    >   */<br>
>    >  static void<br>
>    > -gen8_blorp_emit_disable_constant_state(struct brw_context *brw,<br>
>    > +gen8_blorp_disable_constant_state(struct brw_context *brw,<br>
>    >                                         unsigned opcode)<br>
>    >  {<br>
>    >     BEGIN_BATCH(11);<br>
>    > @@ -566,44 +566,6 @@ gen8_blorp_emit_depth_stencil_state(struct<br>
>    brw_context *brw,<br>
>    >     ADVANCE_BATCH();<br>
>    >  }<br>
>    ><br>
>    > -static void<br>
>    > -gen8_blorp_emit_disable_constant_ps(struct brw_context *brw)<br>
>    > -{<br>
>    > -   const int dwords = brw->gen >= 8 ? 11 : 7;<br>
>    > -   BEGIN_BATCH(dwords);<br>
>    > -   OUT_BATCH(_3DSTATE_CONSTANT_PS << 16 | (dwords - 2));<br>
>    > -<br>
>    > -   if (brw->gen >= 9) {<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -   } else {<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -   }<br>
>    > -<br>
>    > -   if (brw->gen >= 9) {<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -   } else {<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -      OUT_BATCH(0);<br>
>    > -   }<br>
>    > -<br>
>    > -   ADVANCE_BATCH();<br>
>    > -}<br>
>    > -<br>
>    >  static uint32_t<br>
>    >  gen8_blorp_emit_surface_states(struct brw_context *brw,<br>
>    >                                 const struct brw_blorp_params<br>
>    *params)<br>
>    > @@ -680,12 +642,12 @@ gen8_blorp_exec(struct brw_context *brw, const<br>
>    struct brw_blorp_params *params)<br>
>    >     const uint32_t cc_state_offset = gen6_blorp_emit_cc_state(brw);<br>
>    >     gen7_blorp_emit_cc_state_pointer(brw, cc_state_offset);<br>
>    ><br>
>    > -   gen8_blorp_emit_disable_constant_state(brw,<br>
>    _3DSTATE_CONSTANT_VS);<br>
>    > -   gen8_blorp_emit_disable_constant_state(brw,<br>
>    _3DSTATE_CONSTANT_HS);<br>
>    > -   gen8_blorp_emit_disable_constant_state(brw,<br>
>    _3DSTATE_CONSTANT_DS);<br>
>    > -   gen8_blorp_emit_disable_constant_state(brw,<br>
>    _3DSTATE_CONSTANT_GS);<br>
>    > +   gen8_blorp_disable_constant_state(brw, _3DSTATE_CONSTANT_VS);<br>
>    > +   gen8_blorp_disable_constant_state(brw, _3DSTATE_CONSTANT_HS);<br>
>    > +   gen8_blorp_disable_constant_state(brw, _3DSTATE_CONSTANT_DS);<br>
>    > +   gen8_blorp_disable_constant_state(brw, _3DSTATE_CONSTANT_GS);<br>
>    > +   gen8_blorp_disable_constant_state(brw, _3DSTATE_CONSTANT_PS);<br>
>    ><br>
>    > -   gen8_blorp_emit_disable_constant_ps(brw);<br>
>    >     wm_bind_bo_offset = gen8_blorp_emit_surface_states(brw, params);<br>
>    ><br>
>    >     gen7_blorp_emit_binding_table_pointers_ps(brw,<br>
>    wm_bind_bo_offset);<br>
>    > --<br>
>    > 2.5.5<br>
>    ><br>
>    > _______________________________________________<br>
>    > mesa-dev mailing list<br>
</div></div>>    > [4]<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
>    > [5]<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
><br>
> References<br>
><br>
>    1. mailto:<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a><br>
>    2. mailto:<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a><br>
>    3. <a href="http://src.mt/" rel="noreferrer" target="_blank">http://src.mt/</a><br>
>    4. mailto:<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
>    5. <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div></div>