The instmem setup code may allocate from the region that's currently being
scanned out, but we can't allocate a buffer object to cover that until the
generic vram code has been run. Flip the order to make this possible.

Signed-off-by: Matthew Garrett <mjg at redhat.com>
---
 drivers/gpu/drm/nouveau/nouveau_state.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c 
b/drivers/gpu/drm/nouveau/nouveau_state.c
index aff3b8d..65e4c21 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -620,17 +620,17 @@ nouveau_card_init(struct drm_device *dev)
        if (ret)
                goto out_gpio;

-       ret = engine->instmem.init(dev);
+       ret = nouveau_mem_vram_init(dev);
        if (ret)
                goto out_gpuobj;

-       ret = nouveau_mem_vram_init(dev);
+       ret = engine->instmem.init(dev);
        if (ret)
-               goto out_instmem;
+               goto out_ttmvram;

        ret = nouveau_mem_gart_init(dev);
        if (ret)
-               goto out_ttmvram;
+               goto out_instmem;

        if (!dev_priv->noaccel) {
                switch (dev_priv->card_type) {
@@ -791,10 +791,10 @@ out_engine:
                }
        }
        nouveau_mem_gart_fini(dev);
-out_ttmvram:
-       nouveau_mem_vram_fini(dev);
 out_instmem:
        engine->instmem.takedown(dev);
+out_ttmvram:
+       nouveau_mem_vram_fini(dev);
 out_gpuobj:
        nouveau_gpuobj_takedown(dev);
 out_gpio:
-- 
1.7.7.6

Reply via email to