Skip to content

Commit

Permalink
drm/nvc0/vram: skip disabled PBFB subunits
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Nov 9, 2011
1 parent 2bfa748 commit d4547ed
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions drivers/gpu/drm/nouveau/nvc0_vram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d4547ed

Please sign in to comment.