summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_debugfs.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-03-18 02:45:20 +0300
committerBen Skeggs <bskeggs@redhat.com>2010-04-09 04:12:02 +0400
commita76fb4e8ffe42144529e21fe1e609b762e8eb5cc (patch)
tree3215f63360ffb93d685582edeca2e48ee7646170 /drivers/gpu/drm/nouveau/nouveau_debugfs.c
parent952eb63543552deb1bf1113739d59d29172d7755 (diff)
downloadlinux-a76fb4e8ffe42144529e21fe1e609b762e8eb5cc.tar.xz
drm/nouveau: detect vram amount once, and save the value
As opposed to repeatedly reading the amount back from the GPU every time we need to know the VRAM size. We should now fail to load gracefully on detecting no VRAM, rather than something potentially messy happening. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_debugfs.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_debugfs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
index 8ff9ef5d4b47..a251886a0ce6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
@@ -137,10 +137,9 @@ nouveau_debugfs_memory_info(struct seq_file *m, void *data)
{
struct drm_info_node *node = (struct drm_info_node *) m->private;
struct drm_minor *minor = node->minor;
- struct drm_device *dev = minor->dev;
+ struct drm_nouveau_private *dev_priv = minor->dev->dev_private;
- seq_printf(m, "VRAM total: %dKiB\n",
- (int)(nouveau_mem_fb_amount(dev) >> 10));
+ seq_printf(m, "VRAM total: %dKiB\n", (int)(dev_priv->vram_size >> 10));
return 0;
}