[Mesa-dev] [PATCH 01/12] i965: Assign PS kernel start pointers when we decide which kernels to use

Kristian Høgsberg hoegsberg at gmail.com
Mon Aug 11 22:57:40 PDT 2014


On Mon, Aug 11, 2014 at 10:48:49PM -0700, Kenneth Graunke wrote:
> On Monday, August 11, 2014 05:29:31 PM Kristian Høgsberg wrote:
> > Right now we decide which kernels to use and the GRF start offsets in
> > one place and emit the kernel pointers later.  The logic of how to map
> > 8, 16 and 32 kernels to kernel start pointers follows the same logic as which
> > GRF start offsets to use, so lets figure out these two things in one place.
> > 
> > Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
> > ---
> >  src/mesa/drivers/dri/i965/gen6_wm_state.c | 16 ++++++++--------
> >  src/mesa/drivers/dri/i965/gen7_wm_state.c | 18 ++++++++++--------
> >  src/mesa/drivers/dri/i965/gen8_ps_state.c | 14 ++++++++------
> >  3 files changed, 26 insertions(+), 22 deletions(-)
> > 
> > diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c
> > index 047e036..ebd8443 100644
> > --- a/src/mesa/drivers/dri/i965/gen6_wm_state.c
> > +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c
> > @@ -71,7 +71,7 @@ upload_wm_state(struct brw_context *brw)
> >     struct gl_context *ctx = &brw->ctx;
> >     const struct brw_fragment_program *fp =
> >        brw_fragment_program_const(brw->fragment_program);
> > -   uint32_t dw2, dw4, dw5, dw6;
> > +   uint32_t dw2, dw4, dw5, dw6, ksp0, ksp2;
> >  
> >     /* _NEW_BUFFERS */
> >     bool multisampled_fbo = ctx->DrawBuffer->Visual.samples > 1;
> > @@ -109,7 +109,7 @@ upload_wm_state(struct brw_context *brw)
> >        ADVANCE_BATCH();
> >     }
> >  
> > -   dw2 = dw4 = dw5 = dw6 = 0;
> > +   dw2 = dw4 = dw5 = dw6 = ksp2 = 0;
> >     dw4 |= GEN6_WM_STATISTICS_ENABLE;
> >     dw5 |= GEN6_WM_LINE_AA_WIDTH_1_0;
> >     dw5 |= GEN6_WM_LINE_END_CAP_AA_WIDTH_0_5;
> > @@ -151,14 +151,18 @@ upload_wm_state(struct brw_context *brw)
> >                   GEN6_WM_DISPATCH_START_GRF_SHIFT_0);
> >           dw4 |= (brw->wm.prog_data->dispatch_grf_start_reg_16 <<
> >                   GEN6_WM_DISPATCH_START_GRF_SHIFT_2);
> > +         ksp0 = brw->wm.base.prog_offset;
> > +         ksp2 = brw->wm.base.prog_offset + brw->wm.prog_data->prog_offset_16;
> >        } else
> >           dw4 |= (brw->wm.prog_data->dispatch_grf_start_reg_16 <<
> >                  GEN6_WM_DISPATCH_START_GRF_SHIFT_0);
> > +         ksp0 = brw->wm.base.prog_offset + brw->wm.prog_data->prog_offset_16;
> 
> Yikes!  Need curly braces here!!!

Argh, that's terrible, nice catch.
 
> Otherwise you're going to set KSP0 /and/ KSP2 to the SIMD16 program.
> 
> >     }
> >     else {
> >        dw5 |= GEN6_WM_8_DISPATCH_ENABLE;
> >        dw4 |= (brw->wm.prog_data->base.dispatch_grf_start_reg <<
> >                GEN6_WM_DISPATCH_START_GRF_SHIFT_0);
> > +      ksp0 = brw->wm.base.prog_offset;
> >     }
> >  
> >     /* CACHE_NEW_WM_PROG | _NEW_COLOR */
> 
> I like this patch a lot.  Ben is right that there's a slight change
> in KSP2, but it shouldn't matter, and we were just being lazy before
> - zeroing it is better.

Yup, seems cleaner, but shouldn't matter.

> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>




More information about the mesa-dev mailing list