diff options
author | Ben Widawsky <[email protected]> | 2016-02-08 18:00:41 -0800 |
---|---|---|
committer | Ben Widawsky <[email protected]> | 2016-03-11 11:17:28 -0800 |
commit | 3dc3dbc8d826255d60e2aca8822b77619ace206a (patch) | |
tree | f5ce1bcfa0f676de85a579408b6b81f3ec4c96c0 /src/mesa/drivers/dri | |
parent | 9dd20b715af864ab771e36373f213c6cb4ca4bc1 (diff) |
i965/chv: Check that compute threads are above threshold
The way we are organizing this code, the statically configured max_cs_threads
should always be the minimum value we actually support (ie. are aware of). As a
result, we can fall back to that if we get invalid numbers from the kernel (ie.
when the query succeeds, but the result is lower than expected).
I was originally planning to use an assert, but there is no reason to be so
mean.
Signed-off-by: Ben Widawsky <[email protected]>
Reviewed-by: Jordan Justen <[email protected]
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_device_info.h | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 6e3f0a08432..defcae521a8 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -934,6 +934,10 @@ brwCreateContext(gl_api api, 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; + + /* Fuse configurations may give more threads than expected, never less. */ + if (brw->max_cs_threads < devinfo->max_cs_threads) + brw->max_cs_threads = devinfo->max_cs_threads; } else { brw->max_cs_threads = devinfo->max_cs_threads; } diff --git a/src/mesa/drivers/dri/i965/brw_device_info.h b/src/mesa/drivers/dri/i965/brw_device_info.h index 73d682083a1..5c9517eda0f 100644 --- a/src/mesa/drivers/dri/i965/brw_device_info.h +++ b/src/mesa/drivers/dri/i965/brw_device_info.h @@ -71,6 +71,11 @@ struct brw_device_info /** * Total number of slices present on the device whether or not they've been * fused off. + * + * XXX: CS thread counts are limited by the inability to do cross subslice + * communication. It is the effectively the number of logical threads which + * can be executed in a subslice. Fuse configurations may cause this number + * to change, so we program @max_cs_threads as the lower maximum. */ unsigned num_slices; unsigned max_vs_threads; |