summaryrefslogtreecommitdiff
path: root/src/sna/kgem.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-02 13:18:12 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-02 13:18:12 +0100
commit5287660aafe45859c07874c22dca99c1ff5e555a (patch)
tree3ce4a9b5223183e425a21da6cad7d266c8b248c0 /src/sna/kgem.h
parent3f04b6f33f05f8a24698f934a23462269b84917d (diff)
sna: Reserve relocation entries for the deferred VBO
Whilst we reserved exec entry slots for the deferred VBO, there were no relocation spaces reserved. So if we submitted a render command followed by a multitude of BLT copies, we could then overrun the relocation array when adding the deferred vbo to the batch. Reported-by: Danny <moondrake@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67504 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.h')
-rw-r--r--src/sna/kgem.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index e7265301..95f0f7b2 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -211,8 +211,8 @@ struct kgem {
uint16_t reloc__self[256];
uint32_t batch[64*1024-8] page_aligned;
- struct drm_i915_gem_exec_object2 exec[256] page_aligned;
- struct drm_i915_gem_relocation_entry reloc[4096] page_aligned;
+ struct drm_i915_gem_exec_object2 exec[384] page_aligned;
+ struct drm_i915_gem_relocation_entry reloc[8192] page_aligned;
#ifdef DEBUG_MEMORY
struct {
@@ -222,9 +222,11 @@ struct kgem {
#endif
};
+#define KGEM_MAX_DEFERRED_VBO 16
+
#define KGEM_BATCH_RESERVED 1
-#define KGEM_RELOC_RESERVED 4
-#define KGEM_EXEC_RESERVED 1
+#define KGEM_RELOC_RESERVED (KGEM_MAX_DEFERRED_VBO)
+#define KGEM_EXEC_RESERVED (1+KGEM_MAX_DEFERRED_VBO)
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))