mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-11 00:30:44 +01:00
pan/kmod: Add max_tasks_per_core to kmod props
max_tasks_per_core is available via the THREAD_FEATURES register. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31370>
This commit is contained in:
parent
2675a2fae7
commit
ba36333fd8
3 changed files with 6 additions and 1 deletions
|
|
@ -176,6 +176,9 @@ struct pan_kmod_dev_props {
|
|||
/* Maximum number of threads per core. */
|
||||
uint32_t max_threads_per_core;
|
||||
|
||||
/* Maximum number of compute tasks per core. */
|
||||
uint8_t max_tasks_per_core;
|
||||
|
||||
/* Maximum number of threads per workgroup. */
|
||||
uint32_t max_threads_per_wg;
|
||||
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ panfrost_dev_query_thread_props(const struct pan_kmod_dev *dev,
|
|||
|
||||
uint32_t thread_features =
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_THREAD_FEATURES, true, 0);
|
||||
props->max_tasks_per_core = MAX2(thread_features >> 24, 1);
|
||||
props->num_registers_per_core = thread_features & 0xffff;
|
||||
if (!props->num_registers_per_core) {
|
||||
switch (pan_arch(props->gpu_prod_id)) {
|
||||
|
|
|
|||
|
|
@ -225,6 +225,7 @@ panthor_dev_query_thread_props(const struct panthor_kmod_dev *panthor_dev,
|
|||
{
|
||||
props->max_threads_per_wg = panthor_dev->props.gpu.thread_max_workgroup_size;
|
||||
props->max_threads_per_core = panthor_dev->props.gpu.max_threads;
|
||||
props->max_tasks_per_core = panthor_dev->props.gpu.thread_features >> 24;
|
||||
props->num_registers_per_core =
|
||||
panthor_dev->props.gpu.thread_features & 0x3fffff;
|
||||
|
||||
|
|
@ -233,7 +234,7 @@ panthor_dev_query_thread_props(const struct panthor_kmod_dev *panthor_dev,
|
|||
* quirk here.
|
||||
*/
|
||||
assert(props->max_threads_per_wg && props->max_threads_per_core &&
|
||||
props->num_registers_per_core);
|
||||
props->max_tasks_per_core && props->num_registers_per_core);
|
||||
|
||||
/* There is no THREAD_TLS_ALLOC register on v10+, and the maximum number
|
||||
* of TLS instance per core is assumed to be the maximum number of threads
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue