summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i915/intel_batchpool.c2
-rw-r--r--src/mesa/drivers/dri/i915/intel_screen.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_batchpool.c b/src/mesa/drivers/dri/i915/intel_batchpool.c
index fb5b236a09f..ebe7a35828b 100644
--- a/src/mesa/drivers/dri/i915/intel_batchpool.c
+++ b/src/mesa/drivers/dri/i915/intel_batchpool.c
@@ -397,6 +397,8 @@ driBatchPoolInit(int fd, unsigned flags,
return NULL;
pool->data = createBPool(fd, bufSize, numBufs, flags, checkDelayed);
+ if (!pool->data)
+ return NULL;
pool->fd = fd;
pool->map = &pool_map;
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
index 8a4875538bc..288fa237289 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -470,19 +470,28 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
}
intelScreen->regionPool = driDRMPoolInit(sPriv->fd);
+
if (!intelScreen->regionPool)
return GL_FALSE;
+
intelScreen->staticPool = driDRMStaticPoolInit(sPriv->fd);
+
if (!intelScreen->staticPool)
return GL_FALSE;
+
intelScreen->texPool = intelScreen->regionPool;
+
intelScreen->batchPool = driBatchPoolInit(sPriv->fd,
DRM_BO_FLAG_EXE |
DRM_BO_FLAG_MEM_TT |
DRM_BO_FLAG_MEM_LOCAL,
4096, 100, 5);
- intel_recreate_static_regions(intelScreen);
+ if (!intelScreen->batchPool) {
+ fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n");
+ return GL_FALSE;
+ }
+ intel_recreate_static_regions(intelScreen);
return GL_TRUE;
}