summaryrefslogtreecommitdiff
path: root/libdrm/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2009-03-20 10:35:55 +1000
committerBen Skeggs <bskeggs@redhat.com>2009-03-20 10:41:28 +1000
commit98b0df3953f229fd5fb7484d2f566aeb0443c12f (patch)
tree732eb0f5fd2e3bd016a1acd9e560d5d42d630875 /libdrm/nouveau
parentbad16a6b22e06b0adf7663543e26caae9916444c (diff)
libdrm/nouveau: ask the kernel for vram/gart aperture sizes
Diffstat (limited to 'libdrm/nouveau')
-rw-r--r--libdrm/nouveau/nouveau_device.c16
-rw-r--r--libdrm/nouveau/nouveau_drmif.h3
2 files changed, 19 insertions, 0 deletions
diff --git a/libdrm/nouveau/nouveau_device.c b/libdrm/nouveau/nouveau_device.c
index b5ac8546..c6b24462 100644
--- a/libdrm/nouveau/nouveau_device.c
+++ b/libdrm/nouveau/nouveau_device.c
@@ -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);
diff --git a/libdrm/nouveau/nouveau_drmif.h b/libdrm/nouveau/nouveau_drmif.h
index c21fba2d..37913257 100644
--- a/libdrm/nouveau/nouveau_drmif.h
+++ b/libdrm/nouveau/nouveau_drmif.h
@@ -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))