Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293762
b: refs/heads/master
c: 29181d2
h: refs/heads/master
v: v3
  • Loading branch information
Ben Skeggs committed Mar 13, 2012
1 parent 92d7578 commit 08375f3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b83d67c2e2b7e704e6923d00209b6e67f7bdb35
refs/heads/master: 29181d2f7bec0f51273ceab8c565410d52ef1eb0
30 changes: 14 additions & 16 deletions trunk/drivers/gpu/drm/nouveau/nvc0_vram.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,34 +106,32 @@ nvc0_vram_init(struct drm_device *dev)
struct nouveau_vram_engine *vram = &dev_priv->engine.vram;
const u32 rsvd_head = ( 256 * 1024) >> 12; /* vga memory */
const u32 rsvd_tail = (1024 * 1024) >> 12; /* vbios etc */
u32 parts = nv_rd32(dev, 0x121c74);
u32 parts = nv_rd32(dev, 0x022438);
u32 pmask = nv_rd32(dev, 0x022554);
u32 bsize = nv_rd32(dev, 0x10f20c);
u32 offset, length;
bool uniform = true;
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);
NV_DEBUG(dev, "parts 0x%08x mask 0x%08x\n", parts, pmask);

dev_priv->vram_type = nouveau_mem_vbios_type(dev);
dev_priv->vram_rank_B = !!(nv_rd32(dev, 0x10f200) & 0x00000004);

/* read amount of vram attached to each memory controller */
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;
for (part = 0; part < parts; part++) {
if (!(pmask & (1 << part))) {
u32 psize = nv_rd32(dev, 0x11020c + (part * 0x1000));
if (psize != bsize) {
if (psize < bsize)
bsize = psize;
uniform = false;
}

NV_DEBUG(dev, "%d: mem_amount 0x%08x\n", part, psize);
dev_priv->vram_size += (u64)psize << 20;
}

NV_DEBUG(dev, "%d: mem_amount 0x%08x\n", part, psize);
dev_priv->vram_size += (u64)psize << 20;
}

/* if all controllers have the same amount attached, there's no holes */
Expand Down

0 comments on commit 08375f3

Please sign in to comment.