summaryrefslogtreecommitdiff
path: root/lib/intel_batchbuffer.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-08-29 15:19:57 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-08-29 20:02:10 +0100
commit982f7eb238a0898c456e0574dee7c4507738d75f (patch)
treef824758529ba8f510a57e632c5e8e81af852446a /lib/intel_batchbuffer.h
parent86055df9682948ef26b06b94a3856676d638e2fb (diff)
Prepare for 64bit relocation addresses
This reveal that quite a few locations were writing relocation offsets but only allowing for 32 bit addresses. To reveal such places in active tests, we also now double check that we do not use more batch space than declared. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/intel_batchbuffer.h')
-rw-r--r--lib/intel_batchbuffer.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index 5db70fb6..37955a78 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -17,7 +17,7 @@ struct intel_batchbuffer {
drm_intel_bo *bo;
uint8_t buffer[BATCH_SZ];
- uint8_t *ptr;
+ uint8_t *ptr, *end;
uint8_t *state;
};
@@ -39,7 +39,7 @@ void intel_batchbuffer_data(struct intel_batchbuffer *batch,
void intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch,
drm_intel_bo *buffer,
- uint32_t delta,
+ uint64_t delta,
uint32_t read_domains,
uint32_t write_domain,
int fenced);
@@ -85,7 +85,9 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
* scope.
*/
#define BEGIN_BATCH(n) do { \
+ igt_assert(batch->end == NULL); \
intel_batchbuffer_require_space(batch, (n)*4); \
+ batch->end = batch->ptr + (n) * 4; \
} while (0)
/**
@@ -144,6 +146,8 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
* scope.
*/
#define ADVANCE_BATCH() do { \
+ igt_assert(batch->ptr == batch->end); \
+ batch->end = NULL; \
} while(0)
#define BLIT_COPY_BATCH_START(devid, flags) do { \
@@ -177,18 +181,6 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
} \
} while(0)
-/**
- * BLIT_RELOC_UDW:
- * @devid: pci device id of the drm device
- *
- * Emits the upper relocation DWORD on gen8+ and nothing on earlier generations.
- */
-#define BLIT_RELOC_UDW(devid) do { \
- if (intel_gen(devid) >= 8) { \
- OUT_BATCH(0); \
- } \
-} while(0)
-
void
intel_blt_copy(struct intel_batchbuffer *batch,
drm_intel_bo *src_bo, int src_x1, int src_y1, int src_pitch,