aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_object.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-09-01 01:24:34 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-09-24 02:22:42 -0400
commitfbd2895e45aebdb3d3ea73a3a796cf3bb9c912da (patch)
tree1939bf1e1f66d6f7b4e7528e7105b5a0517822eb /drivers/gpu/drm/nouveau/nouveau_object.c
parent6c3d7ef25e3b4a0ea511b1e9d4a0a212750874a6 (diff)
drm/nouveau: rework init ordering so nv50_instmem.c can be less bad
Reviewed-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_object.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_object.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c
index df445fcb8321..b68922f2fe54 100644
--- a/drivers/gpu/drm/nouveau/nouveau_object.c
+++ b/drivers/gpu/drm/nouveau/nouveau_object.c
@@ -130,7 +130,7 @@ nouveau_gpuobj_new(struct drm_device *dev, struct nouveau_channel *chan,
130 130
131 /* if we got a chunk of the aperture, map pages into it */ 131 /* if we got a chunk of the aperture, map pages into it */
132 gpuobj->im_pramin = ramin; 132 gpuobj->im_pramin = ramin;
133 if (!chan && gpuobj->im_pramin) { 133 if (!chan && gpuobj->im_pramin && dev_priv->ramin_available) {
134 ret = engine->instmem.bind(dev, gpuobj); 134 ret = engine->instmem.bind(dev, gpuobj);
135 if (ret) { 135 if (ret) {
136 nouveau_gpuobj_ref(NULL, &gpuobj); 136 nouveau_gpuobj_ref(NULL, &gpuobj);
@@ -173,7 +173,7 @@ nouveau_gpuobj_new(struct drm_device *dev, struct nouveau_channel *chan,
173} 173}
174 174
175int 175int
176nouveau_gpuobj_early_init(struct drm_device *dev) 176nouveau_gpuobj_init(struct drm_device *dev)
177{ 177{
178 struct drm_nouveau_private *dev_priv = dev->dev_private; 178 struct drm_nouveau_private *dev_priv = dev->dev_private;
179 179
@@ -186,29 +186,6 @@ nouveau_gpuobj_early_init(struct drm_device *dev)
186 return 0; 186 return 0;
187} 187}
188 188
189int
190nouveau_gpuobj_init(struct drm_device *dev)
191{
192 struct drm_nouveau_private *dev_priv = dev->dev_private;
193 struct nouveau_gpuobj *ramht = NULL;
194 int ret;
195
196 NV_DEBUG(dev, "\n");
197
198 if (dev_priv->card_type >= NV_50)
199 return 0;
200
201 ret = nouveau_gpuobj_new_fake(dev, dev_priv->ramht_offset, ~0,
202 dev_priv->ramht_size,
203 NVOBJ_FLAG_ZERO_ALLOC, &ramht);
204 if (ret)
205 return ret;
206
207 ret = nouveau_ramht_new(dev, ramht, &dev_priv->ramht);
208 nouveau_gpuobj_ref(NULL, &ramht);
209 return ret;
210}
211
212void 189void
213nouveau_gpuobj_takedown(struct drm_device *dev) 190nouveau_gpuobj_takedown(struct drm_device *dev)
214{ 191{