Skip to content

Commit

Permalink
drm/nouveau/fb/ram/mcp77: use carveout reg to determine size
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 Dec 21, 2014
1 parent 0b42801 commit 5f3ac29
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/gpu/drm/nouveau/core/subdev/fb/ramnvaa.c
Original file line number Diff line number Diff line change
@@ -44,16 +44,15 @@ nvaa_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
if (ret)
return ret;

priv->base.size = nv_rd32(pfb, 0x10020c);
priv->base.size = (priv->base.size & 0xffffff00) | ((priv->base.size & 0x000000ff) << 32);
priv->base.type = NV_MEM_TYPE_STOLEN;
priv->base.stolen = (u64)nv_rd32(pfb, 0x100e10) << 12;
priv->base.size = (u64)nv_rd32(pfb, 0x100e14) << 12;

ret = nouveau_mm_init(&pfb->vram, rsvd_head, (priv->base.size >> 12) -
(rsvd_head + rsvd_tail), 1);
if (ret)
return ret;

priv->base.type = NV_MEM_TYPE_STOLEN;
priv->base.stolen = (u64)nv_rd32(pfb, 0x100e10) << 12;
priv->base.get = nv50_ram_get;
priv->base.put = nv50_ram_put;
return 0;

0 comments on commit 5f3ac29

Please sign in to comment.