diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-09-01 01:24:34 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-09-24 02:22:42 -0400 |
commit | fbd2895e45aebdb3d3ea73a3a796cf3bb9c912da (patch) | |
tree | 1939bf1e1f66d6f7b4e7528e7105b5a0517822eb /drivers/gpu/drm/nouveau/nouveau_object.c | |
parent | 6c3d7ef25e3b4a0ea511b1e9d4a0a212750874a6 (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.c | 27 |
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 | ||
175 | int | 175 | int |
176 | nouveau_gpuobj_early_init(struct drm_device *dev) | 176 | nouveau_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 | ||
189 | int | ||
190 | nouveau_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 | |||
212 | void | 189 | void |
213 | nouveau_gpuobj_takedown(struct drm_device *dev) | 190 | nouveau_gpuobj_takedown(struct drm_device *dev) |
214 | { | 191 | { |