summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-02-28 23:59:53 +0100
committerChristian König <[email protected]>2011-02-28 23:59:53 +0100
commitb97e41c7b18c363a303693fb841fe606b1106fe6 (patch)
tree5329179ac070a8e3ecc3d3e51c020e004f5b32af /src/gallium/winsys
parent77217af40d67612d1f1089ca188393d27a8a038f (diff)
parent5f44fab5a6ba99c287da8d01fa584763bff2565b (diff)
Merge remote branch 'origin/master' into pipe-video
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c30
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_winsys.c1
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_winsys.h1
-rw-r--r--src/gallium/winsys/i915/sw/i915_sw_batchbuffer.c15
-rw-r--r--src/gallium/winsys/i915/sw/i915_sw_winsys.c2
-rw-r--r--src/gallium/winsys/sw/xlib/SConscript2
6 files changed, 46 insertions, 5 deletions
diff --git a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
index afeab5eef42..7cc5af89639 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
@@ -5,6 +5,7 @@
#include "i915_drm.h"
#include "i915/i915_debug.h"
#include <xf86drm.h>
+#include <stdio.h>
#define BATCH_RESERVED 16
@@ -71,6 +72,26 @@ i915_drm_batchbuffer_create(struct i915_winsys *iws)
return &batch->base;
}
+static boolean
+i915_drm_batchbuffer_validate_buffers(struct i915_winsys_batchbuffer *batch,
+ struct i915_winsys_buffer **buffer,
+ int num_of_buffers)
+{
+ struct i915_drm_batchbuffer *drm_batch = i915_drm_batchbuffer(batch);
+ drm_intel_bo *bos[num_of_buffers + 1];
+ int i, ret;
+
+ bos[0] = drm_batch->bo;
+ for (i = 0; i < num_of_buffers; i++)
+ bos[i+1] = intel_bo(buffer[i]);
+
+ ret = drm_intel_bufmgr_check_aperture_space(bos, num_of_buffers);
+ if (ret != 0)
+ return FALSE;
+
+ return TRUE;
+}
+
static int
i915_drm_batchbuffer_reloc(struct i915_winsys_batchbuffer *ibatch,
struct i915_winsys_buffer *buffer,
@@ -169,6 +190,14 @@ i915_drm_batchbuffer_flush(struct i915_winsys_batchbuffer *ibatch,
assert(ret == 0);
}
+ if (i915_drm_winsys(ibatch->iws)->dump_raw_file) {
+ FILE *file = fopen(i915_drm_winsys(ibatch->iws)->dump_raw_file, "a");
+ if (file) {
+ fwrite(batch->base.map, used, 1, file);
+ fclose(file);
+ }
+ }
+
#ifdef INTEL_RUN_SYNC
drm_intel_bo_wait_rendering(batch->bo);
#endif
@@ -202,6 +231,7 @@ i915_drm_batchbuffer_destroy(struct i915_winsys_batchbuffer *ibatch)
void i915_drm_winsys_init_batchbuffer_functions(struct i915_drm_winsys *idws)
{
idws->base.batchbuffer_create = i915_drm_batchbuffer_create;
+ idws->base.validate_buffers = i915_drm_batchbuffer_validate_buffers;
idws->base.batchbuffer_reloc = i915_drm_batchbuffer_reloc;
idws->base.batchbuffer_flush = i915_drm_batchbuffer_flush;
idws->base.batchbuffer_destroy = i915_drm_batchbuffer_destroy;
diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.c b/src/gallium/winsys/i915/drm/i915_drm_winsys.c
index 2288b48b2bd..2c3b508d056 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_winsys.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.c
@@ -72,6 +72,7 @@ i915_drm_winsys_create(int drmFD)
drm_intel_bufmgr_gem_enable_fenced_relocs(idws->gem_manager);
idws->dump_cmd = debug_get_bool_option("I915_DUMP_CMD", FALSE);
+ idws->dump_raw_file = debug_get_option("I915_DUMP_RAW_FILE", NULL);
idws->send_cmd = !debug_get_bool_option("I915_NO_HW", FALSE);
return &idws->base;
diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.h b/src/gallium/winsys/i915/drm/i915_drm_winsys.h
index 0d74d0270c7..dae53c3e801 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_winsys.h
+++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.h
@@ -18,6 +18,7 @@ struct i915_drm_winsys
struct i915_winsys base;
boolean dump_cmd;
+ char *dump_raw_file;
boolean send_cmd;
int fd; /**< Drm file discriptor */
diff --git a/src/gallium/winsys/i915/sw/i915_sw_batchbuffer.c b/src/gallium/winsys/i915/sw/i915_sw_batchbuffer.c
index 8085591c8eb..3d0c1fa6224 100644
--- a/src/gallium/winsys/i915/sw/i915_sw_batchbuffer.c
+++ b/src/gallium/winsys/i915/sw/i915_sw_batchbuffer.c
@@ -58,6 +58,14 @@ i915_sw_batchbuffer_create(struct i915_winsys *iws)
return &batch->base;
}
+static boolean
+i915_sw_batchbuffer_validate_buffers(struct i915_winsys_batchbuffer *batch,
+ struct i915_winsys_buffer **buffer,
+ int num_of_buffers)
+{
+ return TRUE;
+}
+
static int
i915_sw_batchbuffer_reloc(struct i915_winsys_batchbuffer *ibatch,
struct i915_winsys_buffer *buffer,
@@ -107,16 +115,16 @@ i915_sw_batchbuffer_flush(struct i915_winsys_batchbuffer *ibatch,
#ifdef INTEL_ALWAYS_FLUSH
/* MI_FLUSH | FLUSH_MAP_CACHE */
- i915_winsys_batchbuffer_dword(ibatch, (0x4<<23)|(1<<0));
+ i915_winsys_batchbuffer_dword_unchecked(ibatch, (0x4<<23)|(1<<0));
used += 4;
#endif
if ((used & 4) == 0) {
/* MI_NOOP */
- i915_winsys_batchbuffer_dword(ibatch, 0);
+ i915_winsys_batchbuffer_dword_unchecked(ibatch, 0);
}
/* MI_BATCH_BUFFER_END */
- i915_winsys_batchbuffer_dword(ibatch, (0xA<<23));
+ i915_winsys_batchbuffer_dword_unchecked(ibatch, (0xA<<23));
used = batch->base.ptr - batch->base.map;
assert((used & 4) == 0);
@@ -146,6 +154,7 @@ i915_sw_batchbuffer_destroy(struct i915_winsys_batchbuffer *ibatch)
void i915_sw_winsys_init_batchbuffer_functions(struct i915_sw_winsys *isws)
{
isws->base.batchbuffer_create = i915_sw_batchbuffer_create;
+ isws->base.validate_buffers = i915_sw_batchbuffer_validate_buffers;
isws->base.batchbuffer_reloc = i915_sw_batchbuffer_reloc;
isws->base.batchbuffer_flush = i915_sw_batchbuffer_flush;
isws->base.batchbuffer_destroy = i915_sw_batchbuffer_destroy;
diff --git a/src/gallium/winsys/i915/sw/i915_sw_winsys.c b/src/gallium/winsys/i915/sw/i915_sw_winsys.c
index 058ddc44aaf..fc48da6fb92 100644
--- a/src/gallium/winsys/i915/sw/i915_sw_winsys.c
+++ b/src/gallium/winsys/i915/sw/i915_sw_winsys.c
@@ -50,7 +50,7 @@ i915_sw_winsys_create()
isws->base.pci_id = deviceID;
isws->max_batch_size = 16 * 4096;
- isws->dump_cmd = debug_get_bool_option("INTEL_DUMP_CMD", FALSE);
+ isws->dump_cmd = debug_get_bool_option("I915_DUMP_CMD", FALSE);
return &isws->base;
}
diff --git a/src/gallium/winsys/sw/xlib/SConscript b/src/gallium/winsys/sw/xlib/SConscript
index f6c47411831..df01a9ec2bf 100644
--- a/src/gallium/winsys/sw/xlib/SConscript
+++ b/src/gallium/winsys/sw/xlib/SConscript
@@ -4,7 +4,7 @@
Import('*')
-if env['platform'] in ('cygwin_nt-5.1', 'cygwin_nt-6.1', 'linux'):
+if env['platform'] in ('cygwin', 'linux'):
env = env.Clone()