[PATCH 3/4] nouveau: Reorder instmem init and generic vram setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux