xf86-video-intel: src/sna/kgem.h

Chris Wilson ickle at kemper.freedesktop.org
Fri Aug 2 05:20:58 PDT 2013


 src/sna/kgem.h |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 5287660aafe45859c07874c22dca99c1ff5e555a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Aug 2 13:18:12 2013 +0100

    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 at gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67504
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index e726530..95f0f7b 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]))


More information about the xorg-commit mailing list