[Mesa-dev] [PATCH 2/5] i965/chv: Use kernel provided info for max_cs_threads

Matt Turner mattst88 at gmail.com
Tue Mar 8 06:18:30 UTC 2016


On Mon, Mar 7, 2016 at 5:39 PM, Ben Widawsky
<benjamin.widawsky at intel.com> wrote:
> With the previous patches, the code can find out the actual number of available
> compute threads. It is enabled only for Cherryview since that is the only
> platform I know for a fact has shipped devices which can benefit from this.  It
> seems like other platforms /might/ benefit from this because of fused
> configurations which /might/ have shipped. Fallback code is still there.
>
> Cc: Jordan Justen <jordan.l.justen at intel.com>
> Signed-off-by: Ben Widawsky <benjamin.widawsky at intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_context.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> index c66dd13..6e3e97b 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -929,7 +929,13 @@ 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;
> +   /* FINISHME: Do this for all platforms that the kernel supports */
> +   if (brw->is_cherryview &&
> +       screen->subslice_total > 0 && screen->eu_total > 0)
> +      /* Logical CS threads = n EUs per subslice * 7 threads per EU */

"EUs per subslice" is fine without the 'n' abbreviation, IMO.

> +      brw->max_cs_threads = screen->eu_total / screen->subslice_total * 7;
> +   else
> +      brw->max_cs_threads = devinfo->max_cs_threads;

This would be a lot more readable with braces, and would simplify the
next patch if you just added them here.

>     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;
> --
> 2.7.1


More information about the mesa-dev mailing list