[Mesa-dev] [PATCH v2 14/20] i965/cs: Add max_cs_threads

Ben Widawsky ben at bwidawsk.net
Sat Apr 25 21:06:53 PDT 2015


On Sat, Apr 25, 2015 at 05:39:20PM -0700, Jordan Justen wrote:
> On 2015-04-25 13:54:41, Ben Widawsky wrote:
> > On Fri, Apr 24, 2015 at 04:33:06PM -0700, Jordan Justen wrote:
> > > Add some values for gen7 & gen8. These are the number threads in a
> > > subslice.
> > 
> > I forget if I asked this in the v1, but shouldn't we be moving to the
> > awful^wrequired kernel interface which exposes this information? I think for BSW
> > it's actually required.
> > 
> > http://lists.freedesktop.org/archives/intel-gfx/2014-July/049917.html
> 
> I guess I915_PARAM_SUBSLICE_TOTAL and I915_PARAM_EU_TOTAL will be in
> Linux 4.1, but I think mesa should come up with conservative defaults
> for this info and refine it with the kernel calls when they are
> available.
> 
> What do you think?

Yeah, maybe. Since we know until BSW, things are pretty predictable, maybe just
exclude that for now (IIRC, we can't even guess a conservative default there)??

With the some thinking about whether to keep BSW in, on your part:
Reviewed-by: Ben Widawsky <ben at bwidawsk.net>

> 
> Regarding using the values, so threads per subslice would be
> (I915_PARAM_EU_TOTAL / I915_PARAM_SUBSLICE_TOTAL) * threads_per_eu?
> Since the kernel doesn't provide threads_per_eu, I guess we need to
> have that in brw_device_info?
> 
> -Jordan

You're right. I think this is incomplete. Jeff, how about platforms which might
have different number of EUs per subslice? Can such a thing exist? If it cannot,
then what Jordan said seems correct to me.

> 
> > Thread counts all look right afaict though.
> > 
> > > 
> > > Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> > > Cc: Ben Widawsky <ben at bwidawsk.net>
> > > Cc: Kenneth Graunke <kenneth at whitecape.org>
> > > ---
> > >  src/mesa/drivers/dri/i965/brw_context.c     |  1 +
> > >  src/mesa/drivers/dri/i965/brw_context.h     |  1 +
> > >  src/mesa/drivers/dri/i965/brw_device_info.c | 12 +++++++++++-
> > >  src/mesa/drivers/dri/i965/brw_device_info.h |  1 +
> > >  4 files changed, 14 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> > > index 25b50c7..7f8d430 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_context.c
> > > +++ b/src/mesa/drivers/dri/i965/brw_context.c
> > > @@ -835,6 +835,7 @@ brwCreateContext(gl_api api,
> > >     brw->max_ds_threads = devinfo->max_ds_threads;
> > >     brw->max_gs_threads = devinfo->max_gs_threads;
> > >     brw->max_wm_threads = devinfo->max_wm_threads;
> > > +   brw->max_cs_threads = devinfo->max_cs_threads;
> > >     brw->urb.size = devinfo->urb.size;
> > >     brw->urb.min_vs_entries = devinfo->urb.min_vs_entries;
> > >     brw->urb.max_vs_entries = devinfo->urb.max_vs_entries;
> > > diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
> > > index 07847cc..56827d8 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_context.h
> > > +++ b/src/mesa/drivers/dri/i965/brw_context.h
> > > @@ -1228,6 +1228,7 @@ struct brw_context
> > >     int max_ds_threads;
> > >     int max_gs_threads;
> > >     int max_wm_threads;
> > > +   int max_cs_threads;
> > >  
> > >     /* BRW_NEW_URB_ALLOCATIONS:
> > >      */
> > > diff --git a/src/mesa/drivers/dri/i965/brw_device_info.c b/src/mesa/drivers/dri/i965/brw_device_info.c
> > > index 928bf99..7999ba9 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_device_info.c
> > > +++ b/src/mesa/drivers/dri/i965/brw_device_info.c
> > > @@ -117,6 +117,7 @@ static const struct brw_device_info brw_device_info_ivb_gt1 = {
> > >     .max_ds_threads = 36,
> > >     .max_gs_threads = 36,
> > >     .max_wm_threads = 48,
> > > +   .max_cs_threads = 36,
> > >     .urb = {
> > >        .size = 128,
> > >        .min_vs_entries = 32,
> > > @@ -135,6 +136,7 @@ static const struct brw_device_info brw_device_info_ivb_gt2 = {
> > >     .max_ds_threads = 128,
> > >     .max_gs_threads = 128,
> > >     .max_wm_threads = 172,
> > > +   .max_cs_threads = 64, /* Maybe 96? */
> > >     .urb = {
> > >        .size = 256,
> > >        .min_vs_entries = 32,
> > > @@ -154,6 +156,7 @@ static const struct brw_device_info brw_device_info_byt = {
> > >     .max_ds_threads = 36,
> > >     .max_gs_threads = 36,
> > >     .max_wm_threads = 48,
> > > +   .max_cs_threads = 32,
> > >     .urb = {
> > >        .size = 128,
> > >        .min_vs_entries = 32,
> > > @@ -176,6 +179,7 @@ static const struct brw_device_info brw_device_info_hsw_gt1 = {
> > >     .max_ds_threads = 70,
> > >     .max_gs_threads = 70,
> > >     .max_wm_threads = 102,
> > > +   .max_cs_threads = 70,
> > >     .urb = {
> > >        .size = 128,
> > >        .min_vs_entries = 32,
> > > @@ -193,6 +197,7 @@ static const struct brw_device_info brw_device_info_hsw_gt2 = {
> > >     .max_ds_threads = 280,
> > >     .max_gs_threads = 256,
> > >     .max_wm_threads = 204,
> > > +   .max_cs_threads = 70,
> > >     .urb = {
> > >        .size = 256,
> > >        .min_vs_entries = 64,
> > > @@ -210,6 +215,7 @@ static const struct brw_device_info brw_device_info_hsw_gt3 = {
> > >     .max_ds_threads = 280,
> > >     .max_gs_threads = 256,
> > >     .max_wm_threads = 408,
> > > +   .max_cs_threads = 70,
> > >     .urb = {
> > >        .size = 512,
> > >        .min_vs_entries = 64,
> > > @@ -231,10 +237,11 @@ static const struct brw_device_info brw_device_info_hsw_gt3 = {
> > >     .max_hs_threads = 504,                           \
> > >     .max_ds_threads = 504,                           \
> > >     .max_gs_threads = 504,                           \
> > > -   .max_wm_threads = 384                            \
> > > +   .max_wm_threads = 384
> > >  
> > >  static const struct brw_device_info brw_device_info_bdw_gt1 = {
> > >     GEN8_FEATURES, .gt = 1,
> > > +   .max_cs_threads = 42,
> > >     .urb = {
> > >        .size = 192,
> > >        .min_vs_entries = 64,
> > > @@ -247,6 +254,7 @@ static const struct brw_device_info brw_device_info_bdw_gt1 = {
> > >  
> > >  static const struct brw_device_info brw_device_info_bdw_gt2 = {
> > >     GEN8_FEATURES, .gt = 2,
> > > +   .max_cs_threads = 56,
> > >     .urb = {
> > >        .size = 384,
> > >        .min_vs_entries = 64,
> > > @@ -259,6 +267,7 @@ static const struct brw_device_info brw_device_info_bdw_gt2 = {
> > >  
> > >  static const struct brw_device_info brw_device_info_bdw_gt3 = {
> > >     GEN8_FEATURES, .gt = 3,
> > > +   .max_cs_threads = 56,
> > >     .urb = {
> > >        .size = 384,
> > >        .min_vs_entries = 64,
> > > @@ -280,6 +289,7 @@ static const struct brw_device_info brw_device_info_chv = {
> > >     .max_ds_threads = 80,
> > >     .max_gs_threads = 80,
> > >     .max_wm_threads = 128,
> > > +   .max_cs_threads = 28,
> > >     .urb = {
> > >        .size = 192,
> > >        .min_vs_entries = 34,
> > > diff --git a/src/mesa/drivers/dri/i965/brw_device_info.h b/src/mesa/drivers/dri/i965/brw_device_info.h
> > > index b921c2b..65c024c 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_device_info.h
> > > +++ b/src/mesa/drivers/dri/i965/brw_device_info.h
> > > @@ -71,6 +71,7 @@ struct brw_device_info
> > >     unsigned max_ds_threads;
> > >     unsigned max_gs_threads;
> > >     unsigned max_wm_threads;
> > > +   unsigned max_cs_threads;
> > >  
> > >     struct {
> > >        unsigned size;
> > > -- 
> > > 2.1.4
> > > 


More information about the mesa-dev mailing list