diff options
author | Ben Widawsky <[email protected]> | 2016-02-08 16:22:06 -0800 |
---|---|---|
committer | Ben Widawsky <[email protected]> | 2016-03-11 11:17:28 -0800 |
commit | 9dd20b715af864ab771e36373f213c6cb4ca4bc1 (patch) | |
tree | cfadeae68b17c5937ffc2e0cec5810f14390d4b0 | |
parent | 38eb6068847708f054b2d2e93f569061b5245852 (diff) |
i965/chv: Use kernel provided info for max_cs_threads
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.
v2: Some minor adjustments from Matt
Signed-off-by: Ben Widawsky <[email protected]>
Reviewed-by: Jordan Justen <[email protected]
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index c66dd13373b..6e3f0a08432 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -929,7 +929,14 @@ 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 = EUs per subslice * 7 threads per EU */ + brw->max_cs_threads = screen->eu_total / screen->subslice_total * 7; + } else { + 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; |