summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/drm/intel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys/drm/intel')
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c26
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_context.c1
2 files changed, 22 insertions, 5 deletions
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c b/src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c
index af5c027748..e83a4c42cd 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c
@@ -68,13 +68,10 @@ intel_be_offset_relocation(struct intel_be_batchbuffer *batch,
offset = (unsigned)(batch->base.ptr - batch->base.map);
batch->base.ptr += 4;
-/*
- TODO: Enable this when we submit batch buffers to HW
ret = drm_intel_bo_emit_reloc(bo, pre_add,
batch->bo, offset,
read_domains,
write_domain);
-*/
if (!ret)
batch->base.relocs++;
@@ -87,10 +84,31 @@ intel_be_batchbuffer_flush(struct intel_be_batchbuffer *batch,
struct intel_be_fence **fence)
{
struct i915_batchbuffer *i915 = &batch->base;
+ unsigned used = 0;
+ int ret = 0;
assert(i915_batchbuffer_space(i915) >= 0);
- /* TODO: submit stuff to HW */
+ used = batch->base.ptr - batch->base.map;
+ assert((used & 3) == 0);
+
+ if (used & 4) {
+ ((uint32_t *) batch->base.ptr)[0] = ((0<<29)|(4<<23)); // MI_FLUSH;
+ ((uint32_t *) batch->base.ptr)[1] = 0;
+ ((uint32_t *) batch->base.ptr)[2] = (0xA<<23); // MI_BATCH_BUFFER_END;
+ batch->base.ptr += 12;
+ } else {
+ ((uint32_t *) batch->base.ptr)[0] = ((0<<29)|(4<<23)); // MI_FLUSH;
+ ((uint32_t *) batch->base.ptr)[1] = (0xA<<23); // MI_BATCH_BUFFER_END;
+ batch->base.ptr += 8;
+ }
+
+ used = batch->base.ptr - batch->base.map;
+
+ drm_intel_bo_subdata(batch->bo, 0, used, batch->base.map);
+ ret = drm_intel_bo_exec(batch->bo, used, NULL, 0, 0);
+
+ assert(ret == 0);
intel_be_batchbuffer_reset(batch);
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 92fc2dd767..3e472e1e43 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_context.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_context.c
@@ -30,7 +30,6 @@ intel_be_batch_reloc(struct i915_winsys *sws,
if (access_flags & I915_BUFFER_ACCESS_READ) {
read = I915_GEM_DOMAIN_SAMPLER |
- I915_GEM_DOMAIN_INSTRUCTION |
I915_GEM_DOMAIN_VERTEX;
}