aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-12-10 22:19:31 -0500
committerBen Skeggs <bskeggs@redhat.com>2014-12-21 17:37:38 -0500
commit0b428011fa2b2f41d3f82ddf2c141fdf936dbaee (patch)
tree614ba67adb6bdfc2ad2361a0db8ec945630b7443
parent5cc8d536c21a17e301e6f3e8c70a678b5f4b419f (diff)
drm/nouveau/fb/ram/mcp77: subclass nouveau_ram
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/fb/ramnvaa.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvaa.c b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvaa.c
index 00f2ca7e44a5..8ee3d377f6f3 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvaa.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvaa.c
@@ -24,6 +24,10 @@
24 24
25#include "nv50.h" 25#include "nv50.h"
26 26
27struct nvaa_ram_priv {
28 struct nouveau_ram base;
29};
30
27static int 31static int
28nvaa_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine, 32nvaa_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
29 struct nouveau_oclass *oclass, void *data, u32 datasize, 33 struct nouveau_oclass *oclass, void *data, u32 datasize,
@@ -32,26 +36,26 @@ nvaa_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
32 const u32 rsvd_head = ( 256 * 1024) >> 12; /* vga memory */ 36 const u32 rsvd_head = ( 256 * 1024) >> 12; /* vga memory */
33 const u32 rsvd_tail = (1024 * 1024) >> 12; /* vbios etc */ 37 const u32 rsvd_tail = (1024 * 1024) >> 12; /* vbios etc */
34 struct nouveau_fb *pfb = nouveau_fb(parent); 38 struct nouveau_fb *pfb = nouveau_fb(parent);
35 struct nouveau_ram *ram; 39 struct nvaa_ram_priv *priv;
36 int ret; 40 int ret;
37 41
38 ret = nouveau_ram_create(parent, engine, oclass, &ram); 42 ret = nouveau_ram_create(parent, engine, oclass, &priv);
39 *pobject = nv_object(ram); 43 *pobject = nv_object(priv);
40 if (ret) 44 if (ret)
41 return ret; 45 return ret;
42 46
43 ram->size = nv_rd32(pfb, 0x10020c); 47 priv->base.size = nv_rd32(pfb, 0x10020c);
44 ram->size = (ram->size & 0xffffff00) | ((ram->size & 0x000000ff) << 32); 48 priv->base.size = (priv->base.size & 0xffffff00) | ((priv->base.size & 0x000000ff) << 32);
45 49
46 ret = nouveau_mm_init(&pfb->vram, rsvd_head, (ram->size >> 12) - 50 ret = nouveau_mm_init(&pfb->vram, rsvd_head, (priv->base.size >> 12) -
47 (rsvd_head + rsvd_tail), 1); 51 (rsvd_head + rsvd_tail), 1);
48 if (ret) 52 if (ret)
49 return ret; 53 return ret;
50 54
51 ram->type = NV_MEM_TYPE_STOLEN; 55 priv->base.type = NV_MEM_TYPE_STOLEN;
52 ram->stolen = (u64)nv_rd32(pfb, 0x100e10) << 12; 56 priv->base.stolen = (u64)nv_rd32(pfb, 0x100e10) << 12;
53 ram->get = nv50_ram_get; 57 priv->base.get = nv50_ram_get;
54 ram->put = nv50_ram_put; 58 priv->base.put = nv50_ram_put;
55 return 0; 59 return 0;
56} 60}
57 61