libdrm/nouveau: ask the kernel for vram/gart aperture sizes

main
Ben Skeggs 2009-03-20 10:35:55 +10:00
parent bad16a6b22
commit 98b0df3953
2 changed files with 19 additions and 0 deletions

View File

@ -76,6 +76,22 @@ nouveau_device_open_existing(struct nouveau_device **dev, int close,
}
nvdev->base.vm_vram_base = value;
ret = nouveau_device_get_param(&nvdev->base,
NOUVEAU_GETPARAM_FB_SIZE, &value);
if (ret) {
nouveau_device_close((void *)&nvdev);
return ret;
}
nvdev->vram_aper_size = value;
ret = nouveau_device_get_param(&nvdev->base,
NOUVEAU_GETPARAM_AGP_SIZE, &value);
if (ret) {
nouveau_device_close((void *)&nvdev);
return ret;
}
nvdev->gart_aper_size = value;
ret = nouveau_bo_init(&nvdev->base);
if (ret) {
nouveau_device_close((void *)&nvdev);

View File

@ -37,6 +37,9 @@ struct nouveau_device_priv {
int needs_close;
int mm_enabled;
/*XXX: move to nouveau_device when interface gets bumped */
uint64_t vram_aper_size;
uint64_t gart_aper_size;
};
#define nouveau_device(n) ((struct nouveau_device_priv *)(n))