summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Rathmann <koala_br@users.sourceforge.net>2007-02-14 00:07:31 +0100
committerStephane Marchesin <marchesin@icps.u-strasbg.fr>2007-02-14 00:07:31 +0100
commit59af900e4f62370457117b0659e3f28f89949499 (patch)
treefc528574ff63395537da7a2adde1c928b87ed028
parent6b289db05496c5cc89c29817be16cb107a522722 (diff)
nouveau: fix memory initialization with multiple cards.
-rw-r--r--shared-core/nouveau_mem.c9
1 files changed, 5 insertions, 4 deletions
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;