nvk: retrieve gpc/mp counts from kernel.

These are needed to size the tls area.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Dave Airlie 2022-06-06 13:39:05 +10:00 committed by Marge Bot
parent bd8077bef5
commit a3e5eb1134
2 changed files with 9 additions and 0 deletions

View file

@ -156,6 +156,12 @@ nouveau_ws_device_new(int fd)
else
device->local_mem_domain = NOUVEAU_GEM_DOMAIN_VRAM;
uint64_t value;
if (nouveau_getparam(dev, NOUVEAU_GETPARAM_GRAPH_UNITS, &value))
goto out_dev;
device->base.gpc_count = value & 0x000000ff;
device->base.mp_count = value >> 8;
return &device->base;
out_dev:

View file

@ -16,6 +16,9 @@ struct nouveau_ws_device {
uint64_t vram_size;
uint64_t gart_size;
bool is_integrated;
uint8_t gpc_count;
uint16_t mp_count;
};
/* don't use directly, gets removed once the new UAPI is here */