aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-04-24 03:51:20 -0400
committerBen Skeggs <bskeggs@redhat.com>2013-04-26 01:38:05 -0400
commit617a6cbd7c0aae2314068ce5ed7cb3790c491177 (patch)
tree3dcc076da6fa51704513e8f4721bd91f9076287f
parent1409d90f24573c938231ec277a5b847eb8226ea7 (diff)
drm/nvc0-/gr: use self as parent for subobjects
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c3
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c13
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/nve0.c6
3 files changed, 13 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c
index ebc9caa951f6..4cc6269d4077 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c
@@ -36,7 +36,6 @@ int
36nvc0_grctx_init(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) 36nvc0_grctx_init(struct nvc0_graph_priv *priv, struct nvc0_grctx *info)
37{ 37{
38 struct nouveau_bar *bar = nouveau_bar(priv); 38 struct nouveau_bar *bar = nouveau_bar(priv);
39 struct nouveau_object *parent = nv_object(priv);
40 struct nouveau_gpuobj *chan; 39 struct nouveau_gpuobj *chan;
41 u32 size = (0x80000 + priv->size + 4095) & ~4095; 40 u32 size = (0x80000 + priv->size + 4095) & ~4095;
42 int ret, i; 41 int ret, i;
@@ -44,7 +43,7 @@ nvc0_grctx_init(struct nvc0_graph_priv *priv, struct nvc0_grctx *info)
44 /* allocate memory to for a "channel", which we'll use to generate 43 /* allocate memory to for a "channel", which we'll use to generate
45 * the default context values 44 * the default context values
46 */ 45 */
47 ret = nouveau_gpuobj_new(parent, NULL, size, 0x1000, 46 ret = nouveau_gpuobj_new(nv_object(priv), NULL, size, 0x1000,
48 NVOBJ_FLAG_ZERO_ALLOC, &info->chan); 47 NVOBJ_FLAG_ZERO_ALLOC, &info->chan);
49 chan = info->chan; 48 chan = info->chan;
50 if (ret) { 49 if (ret) {
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
index 2dcd13796188..f9b9d82c287f 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
@@ -102,7 +102,8 @@ nvc0_graph_context_ctor(struct nouveau_object *parent,
102 * fuc to modify some per-context register settings on first load 102 * fuc to modify some per-context register settings on first load
103 * of the context. 103 * of the context.
104 */ 104 */
105 ret = nouveau_gpuobj_new(parent, NULL, 0x1000, 0x100, 0, &chan->mmio); 105 ret = nouveau_gpuobj_new(nv_object(chan), NULL, 0x1000, 0x100, 0,
106 &chan->mmio);
106 if (ret) 107 if (ret)
107 return ret; 108 return ret;
108 109
@@ -114,8 +115,8 @@ nvc0_graph_context_ctor(struct nouveau_object *parent,
114 115
115 /* allocate buffers referenced by mmio list */ 116 /* allocate buffers referenced by mmio list */
116 for (i = 0; data->size && i < ARRAY_SIZE(priv->mmio_data); i++) { 117 for (i = 0; data->size && i < ARRAY_SIZE(priv->mmio_data); i++) {
117 ret = nouveau_gpuobj_new(parent, NULL, data->size, data->align, 118 ret = nouveau_gpuobj_new(nv_object(chan), NULL, data->size,
118 0, &chan->data[i].mem); 119 data->align, 0, &chan->data[i].mem);
119 if (ret) 120 if (ret)
120 return ret; 121 return ret;
121 122
@@ -567,11 +568,13 @@ nvc0_graph_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
567 break; 568 break;
568 } 569 }
569 570
570 ret = nouveau_gpuobj_new(parent, NULL, 0x1000, 256, 0, &priv->unk4188b4); 571 ret = nouveau_gpuobj_new(nv_object(priv), NULL, 0x1000, 256, 0,
572 &priv->unk4188b4);
571 if (ret) 573 if (ret)
572 return ret; 574 return ret;
573 575
574 ret = nouveau_gpuobj_new(parent, NULL, 0x1000, 256, 0, &priv->unk4188b8); 576 ret = nouveau_gpuobj_new(nv_object(priv), NULL, 0x1000, 256, 0,
577 &priv->unk4188b8);
575 if (ret) 578 if (ret)
576 return ret; 579 return ret;
577 580
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c
index 2a60258eefd4..678c16f63055 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c
@@ -451,11 +451,13 @@ nve0_graph_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
451 priv->firmware = true; 451 priv->firmware = true;
452 } 452 }
453 453
454 ret = nouveau_gpuobj_new(parent, NULL, 0x1000, 256, 0, &priv->unk4188b4); 454 ret = nouveau_gpuobj_new(nv_object(priv), NULL, 0x1000, 256, 0,
455 &priv->unk4188b4);
455 if (ret) 456 if (ret)
456 return ret; 457 return ret;
457 458
458 ret = nouveau_gpuobj_new(parent, NULL, 0x1000, 256, 0, &priv->unk4188b8); 459 ret = nouveau_gpuobj_new(nv_object(priv), NULL, 0x1000, 256, 0,
460 &priv->unk4188b8);
459 if (ret) 461 if (ret)
460 return ret; 462 return ret;
461 463