diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-10-27 03:26:17 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-11-10 00:00:02 +0100 |
commit | d4547ed8cc219f2e06078ac05147a873b2a03d5a (patch) | |
tree | 146998eed7108e5f238d67d632e5dd8e6103a21f /drivers/gpu | |
parent | drm/nv40/pm: fix issues on igp chipsets, which don't have memory (diff) | |
download | linux-d4547ed8cc219f2e06078ac05147a873b2a03d5a.tar.xz linux-d4547ed8cc219f2e06078ac05147a873b2a03d5a.zip |
drm/nvc0/vram: skip disabled PBFB subunits
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvc0_vram.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_vram.c b/drivers/gpu/drm/nouveau/nvc0_vram.c index 041ff2b2b601..ce984d573a51 100644 --- a/drivers/gpu/drm/nouveau/nvc0_vram.c +++ b/drivers/gpu/drm/nouveau/nvc0_vram.c @@ -110,22 +110,26 @@ nvc0_vram_init(struct drm_device *dev) u32 bsize = nv_rd32(dev, 0x10f20c); u32 offset, length; bool uniform = true; - int ret, i; + int ret, part; NV_DEBUG(dev, "0x100800: 0x%08x\n", nv_rd32(dev, 0x100800)); NV_DEBUG(dev, "parts 0x%08x bcast_mem_amount 0x%08x\n", parts, bsize); /* read amount of vram attached to each memory controller */ - for (i = 0; i < parts; i++) { - u32 psize = nv_rd32(dev, 0x11020c + (i * 0x1000)); + part = 0; + while (parts) { + u32 psize = nv_rd32(dev, 0x11020c + (part++ * 0x1000)); + if (psize == 0) + continue; + parts--; + if (psize != bsize) { if (psize < bsize) bsize = psize; uniform = false; } - NV_DEBUG(dev, "%d: mem_amount 0x%08x\n", i, psize); - + NV_DEBUG(dev, "%d: mem_amount 0x%08x\n", part, psize); dev_priv->vram_size += (u64)psize << 20; } |