summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;