xf86-video-intel: 2 commits - src/sna/kgem.c src/sna/sna_driver.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Mar 2 12:15:01 PST 2012


 src/sna/kgem.c       |    9 +++++++--
 src/sna/sna_driver.c |    3 +++
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 599cd0e8ef3080fc735860bef4e47107c1c05f9a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Mar 2 20:18:32 2012 +0000

    sna: Align allocations with partial buffers to 64 bytes.
    
    A magic number required for so many functions of the GPU. In this
    particular case it is likely to be that the offset of a texture in the
    GTT has to have a minimum alignment of 64 bytes.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46415
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index cc80278..f913369 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3391,6 +3391,7 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
 				     __FUNCTION__, bo->write, flags));
 				continue;
 			}
+			assert(bo->mmapped || bo->need_io);
 		} else {
 			if (bo->write & KGEM_BUFFER_WRITE) {
 				DBG(("%s: skip write %x buffer, need %x\n",
@@ -3548,6 +3549,9 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
 			list_init(&bo->base.list);
 			free(old);
 
+			assert(bo->base.tiling == I915_TILING_NONE);
+			assert(num_pages(&bo->base) >= NUM_PAGES(size));
+
 			bo->mem = kgem_bo_map(kgem, &bo->base);
 			if (bo->mem) {
 				bo->need_io = false;
@@ -3564,11 +3568,11 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
 		}
 	}
 #else
-	alloc = ALIGN(size, 64*1024) / PAGE_SIZE;
+	flags &= ~KGEM_BUFFER_INPLACE;
 #endif
 	/* Be more parsimonious with pwrite/pread buffers */
 	if ((flags & KGEM_BUFFER_INPLACE) == 0)
-		alloc = PAGE_ALIGN(size) / PAGE_SIZE;
+		alloc = NUM_PAGES(size);
 	flags &= ~KGEM_BUFFER_INPLACE;
 
 	if (kgem->has_vmap) {
@@ -3700,6 +3704,7 @@ init:
 	     __FUNCTION__, alloc, bo->base.handle));
 
 done:
+	bo->used = ALIGN(bo->used, 64);
 	/* adjust the position within the list to maintain decreasing order */
 	alloc = bytes(&bo->base) - bo->used;
 	{
commit 4918e309dfadaf14da6997468f08db03ac0a6327
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Mar 2 18:18:48 2012 +0000

    sna: Silence an assertion failure during shutdown
    
    Clear the scanout flag on the front buffer during teardown to silence
    the debugger.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index bcd1191..e53b75f 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -784,6 +784,9 @@ static Bool sna_close_screen(int scrnIndex, ScreenPtr screen)
 
 	sna_mode_remove_fb(sna);
 	if (sna->front) {
+		struct kgem_bo *bo = sna_pixmap_get_bo(sna->front);
+		if (bo)
+			kgem_bo_clear_scanout(&sna->kgem, bo); /* valgrind */
 		screen->DestroyPixmap(sna->front);
 		sna->front = NULL;
 	}


More information about the xorg-commit mailing list