summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/drm/intel/gem
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys/drm/intel/gem')
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c21
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_context.c6
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_device.c2
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_device.h2
4 files changed, 17 insertions, 14 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 e83a4c42cd..d9556e1f38 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c
@@ -1,4 +1,5 @@
+#include "i915simple/i915_debug.h"
#include "intel_be_batchbuffer.h"
#include "intel_be_context.h"
#include "intel_be_device.h"
@@ -66,13 +67,15 @@ intel_be_offset_relocation(struct intel_be_batchbuffer *batch,
assert(batch->base.relocs < batch->base.max_relocs);
offset = (unsigned)(batch->base.ptr - batch->base.map);
- batch->base.ptr += 4;
- ret = drm_intel_bo_emit_reloc(bo, pre_add,
- batch->bo, offset,
+ ret = drm_intel_bo_emit_reloc(batch->bo, offset,
+ bo, pre_add,
read_domains,
write_domain);
+ ((uint32_t*)batch->base.ptr)[0] = bo->offset + pre_add;
+ batch->base.ptr += 4;
+
if (!ret)
batch->base.relocs++;
@@ -93,14 +96,12 @@ intel_be_batchbuffer_flush(struct intel_be_batchbuffer *batch,
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;
+ i915_batchbuffer_dword(i915, (0x0<<29)|(0x4<<23)|(1<<0)); // MI_FLUSH | FLUSH_MAP_CACHE;
+ i915_batchbuffer_dword(i915, (0x0<<29)|(0x0<<23)); // MI_NOOP
+ i915_batchbuffer_dword(i915, (0x0<<29)|(0xA<<23)); // MI_BATCH_BUFFER_END;
} 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;
+ i915_batchbuffer_dword(i915, (0x0<<29)|(0x4<<23)|(1<<0)); //MI_FLUSH | FLUSH_MAP_CACHE;
+ i915_batchbuffer_dword(i915, (0x0<<29)|(0xA<<23)); // MI_BATCH_BUFFER_END;
}
used = batch->base.ptr - batch->base.map;
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 3e472e1e43..95e761d78d 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_context.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_context.c
@@ -26,11 +26,11 @@ intel_be_batch_reloc(struct i915_winsys *sws,
if (access_flags & I915_BUFFER_ACCESS_WRITE) {
write = I915_GEM_DOMAIN_RENDER;
+ read = I915_GEM_DOMAIN_RENDER;
}
if (access_flags & I915_BUFFER_ACCESS_READ) {
- read = I915_GEM_DOMAIN_SAMPLER |
- I915_GEM_DOMAIN_VERTEX;
+ read |= I915_GEM_DOMAIN_VERTEX;
}
ret = intel_be_offset_relocation(intel->batch,
@@ -38,6 +38,8 @@ intel_be_batch_reloc(struct i915_winsys *sws,
bo,
read,
write);
+ assert(ret == 0);
+
/* TODO change return type */
/* return ret; */
}
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 5406636bcb..82c1cb2f32 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_device.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.c
@@ -1,7 +1,7 @@
#include "intel_be_device.h"
-#include "pipe/p_winsys.h"
+#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"
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 96e94c47e7..f06890163c 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_device.h
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.h
@@ -2,7 +2,7 @@
#ifndef INTEL_DRM_DEVICE_H
#define INTEL_DRM_DEVICE_H
-#include "pipe/p_winsys.h"
+#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_context.h"
#include "drm.h"