nouveau/winsys: Getch the BAR size from the kernel

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26622>
This commit is contained in:
Faith Ekstrand 2024-02-16 15:39:25 -06:00
parent 85849ed9cb
commit d4623da9a3
2 changed files with 5 additions and 0 deletions

View file

@ -43,6 +43,7 @@ struct nv_device_info {
uint16_t cls_compute;
uint64_t vram_size_B;
uint64_t bar_size_B;
};
#endif /* NV_DEVINFO_H */

View file

@ -317,6 +317,10 @@ nouveau_ws_device_new(drmDevicePtr drm_device)
else
device->local_mem_domain = NOUVEAU_GEM_DOMAIN_VRAM;
if (drm_device->bustype == DRM_BUS_PCI &&
!nouveau_ws_param(fd, NOUVEAU_GETPARAM_VRAM_BAR_SIZE, &value))
device->info.bar_size_B = value;
if (nouveau_ws_param(fd, NOUVEAU_GETPARAM_GRAPH_UNITS, &value))
goto out_err;