From 59af900e4f62370457117b0659e3f28f89949499 Mon Sep 17 00:00:00 2001 From: "B. Rathmann" Date: Wed, 14 Feb 2007 00:07:31 +0100 Subject: nouveau: fix memory initialization with multiple cards. --- shared-core/nouveau_mem.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'shared-core/nouveau_mem.c') diff --git a/shared-core/nouveau_mem.c b/shared-core/nouveau_mem.c index cd53d25d..3b1f443c 100644 --- a/shared-core/nouveau_mem.c +++ b/shared-core/nouveau_mem.c @@ -35,7 +35,7 @@ #include "drm_sarea.h" #include "nouveau_drv.h" -static int meminit_ok=0; +//static int meminit_ok=0; static struct mem_block *split_block(struct mem_block *p, uint64_t start, uint64_t size, DRMFILE filp) @@ -373,10 +373,9 @@ struct mem_block* nouveau_mem_alloc(struct drm_device *dev, int alignment, uint6 /* * Init memory if needed */ - if (meminit_ok==0) + if (dev_priv->fb_phys == 0) { nouveau_mem_init(dev); - meminit_ok=1; } /* @@ -446,8 +445,10 @@ alloc_ok: void nouveau_mem_free(struct drm_device* dev, struct mem_block* block) { + drm_nouveau_private_t *dev_priv = dev->dev_private; + DRM_INFO("freeing 0x%llx\n", block->start); - if (meminit_ok==0) + if (dev_priv->fb_phys == 0) { DRM_ERROR("%s called without init\n", __FUNCTION__); return; -- cgit v1.2.3