summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorJakob Bornecrantz <wallbraker@gmail.com>2009-04-25 12:55:21 +0100
committerJakob Bornecrantz <wallbraker@gmail.com>2009-04-25 12:56:52 +0100
commit5f701f22f00ea17e0aba91c9995c9f559963d591 (patch)
treefd1420d2487356fea20b0a902c194bb9068e3023 /src/gallium/winsys
parentf44f1155a9d1539bc5173928af20f5a2541ec6be (diff)
gallium-intel: Cache software switch
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_context.c2
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_device.c5
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_device.h2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_context.c b/src/gallium/winsys/drm/intel/gem/intel_be_context.c
index cfe8c88466..fe0b138fbe 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_context.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_context.c
@@ -108,7 +108,7 @@ intel_be_create_context(struct pipe_screen *screen)
intel_be_init_context(intel, device);
- if (getenv("INTEL_SOFTPIPE"))
+ if (device->softpipe)
pipe = softpipe_create(screen);
else
pipe = i915_create_context(screen, &device->base, &intel->base);
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.c b/src/gallium/winsys/drm/intel/gem/intel_be_device.c
index 8979f0ae15..4fa7a5e1a2 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_device.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.c
@@ -6,6 +6,7 @@
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"
#include "util/u_memory.h"
+#include "util/u_debug.h"
#include "intel_be_fence.h"
@@ -286,6 +287,8 @@ intel_be_init_device(struct intel_be_device *dev, int fd, unsigned id)
dev->pools.gem = drm_intel_bufmgr_gem_init(dev->fd, dev->max_batch_size);
+ dev->softpipe = debug_get_bool_option("INTEL_SOFTPIPE", FALSE);
+
return true;
}
@@ -303,7 +306,7 @@ intel_be_create_screen(int drmFD, int deviceID)
intel_be_init_device(dev, drmFD, deviceID);
- if (getenv("INTEL_SOFTPIPE")) {
+ if (dev->softpipe) {
screen = softpipe_create_screen(&dev->base);
drm_api_hooks.buffer_from_texture = softpipe_get_texture_buffer;
} else
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.h b/src/gallium/winsys/drm/intel/gem/intel_be_device.h
index 47d2176cb4..b32637ece2 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_device.h
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.h
@@ -16,6 +16,8 @@ struct intel_be_device
{
struct pipe_winsys base;
+ boolean softpipe;
+
int fd; /**< Drm file discriptor */
unsigned id;