diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-03-17 19:45:20 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-04-08 20:12:02 -0400 |
commit | a76fb4e8ffe42144529e21fe1e609b762e8eb5cc (patch) | |
tree | 3215f63360ffb93d685582edeca2e48ee7646170 /drivers/gpu/drm/nouveau/nouveau_bo.c | |
parent | 952eb63543552deb1bf1113739d59d29172d7755 (diff) |
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_bo.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 418d881050a0..eeab3fb27083 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
@@ -71,7 +71,7 @@ nouveau_bo_fixup_align(struct drm_device *dev, | |||
71 | * many small buffers. | 71 | * many small buffers. |
72 | */ | 72 | */ |
73 | if (dev_priv->card_type == NV_50) { | 73 | if (dev_priv->card_type == NV_50) { |
74 | uint32_t block_size = nouveau_mem_fb_amount(dev) >> 15; | 74 | uint32_t block_size = dev_priv->vram_size >> 15; |
75 | int i; | 75 | int i; |
76 | 76 | ||
77 | switch (tile_flags) { | 77 | switch (tile_flags) { |
@@ -399,8 +399,8 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, | |||
399 | man->io_addr = NULL; | 399 | man->io_addr = NULL; |
400 | man->io_offset = drm_get_resource_start(dev, 1); | 400 | man->io_offset = drm_get_resource_start(dev, 1); |
401 | man->io_size = drm_get_resource_len(dev, 1); | 401 | man->io_size = drm_get_resource_len(dev, 1); |
402 | if (man->io_size > nouveau_mem_fb_amount(dev)) | 402 | if (man->io_size > dev_priv->vram_size) |
403 | man->io_size = nouveau_mem_fb_amount(dev); | 403 | man->io_size = dev_priv->vram_size; |
404 | 404 | ||
405 | man->gpu_offset = dev_priv->vm_vram_base; | 405 | man->gpu_offset = dev_priv->vm_vram_base; |
406 | break; | 406 | break; |