xf86-video-intel: 4 commits - configure.ac src/intel_uxa.c src/sna/kgem.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Dec 5 02:33:47 PST 2011


 configure.ac    |    2 +-
 src/intel_uxa.c |   22 ++++++++++++++++++----
 src/sna/kgem.c  |    8 ++++----
 3 files changed, 23 insertions(+), 9 deletions(-)

New commits:
commit 101942d41df7efaa6103e31e738775fafdb63159
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Dec 5 10:11:04 2011 +0000

    uxa: Unmap the buffer after swrast
    
    Otherwise we may exhaust the per-process vma limit and cause
    applications to stop rendering and eventually crash the X server.
    
    Will only work in conjunction with a new libdrm (2.4.28) and commit
      c549a77c (intel: Unmap buffers during drm_intel_gem_bo_unmap)
    in particular.
    
    Reported-by: nobled at dreamwidth.org
    References: https://bugs.freedesktop.org/show_bug.cgi?id=43075
    References: https://bugs.freedesktop.org/show_bug.cgi?id=40066
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index 2b25ee5..a675a93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,7 +187,7 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
 
 # Obtain compiler/linker options for the driver dependencies
 PKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_xserver_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES])
-PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.23])
+PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.28])
 PKG_CHECK_MODULES(DRI, [xf86driproto], , DRI=no)
 PKG_CHECK_MODULES(DRI2, [dri2proto >= 2.6],, DRI2=no)
 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
diff --git a/src/intel_uxa.c b/src/intel_uxa.c
index 1aedae0..5f2959b 100644
--- a/src/intel_uxa.c
+++ b/src/intel_uxa.c
@@ -720,10 +720,8 @@ static Bool intel_uxa_prepare_access(PixmapPtr pixmap, uxa_access_t access)
 	    (access == UXA_ACCESS_RW || priv->batch_write))
 		intel_batch_submit(scrn);
 
-	if (priv->tiling || bo->size <= intel->max_gtt_map_size)
-		ret = drm_intel_gem_bo_map_gtt(bo);
-	else
-		ret = dri_bo_map(bo, access == UXA_ACCESS_RW);
+	assert(bo->size <= intel->max_gtt_map_size);
+	ret = drm_intel_gem_bo_map_gtt(bo);
 	if (ret) {
 		xf86DrvMsg(scrn->scrnIndex, X_WARNING,
 			   "%s: bo map (use gtt? %d, access %d) failed: %s\n",
@@ -740,6 +738,21 @@ static Bool intel_uxa_prepare_access(PixmapPtr pixmap, uxa_access_t access)
 	return TRUE;
 }
 
+static void intel_uxa_finish_access(PixmapPtr pixmap, uxa_access_t access)
+{
+	struct intel_pixmap *priv;
+
+	if (access == UXA_GLAMOR_ACCESS_RW || access == UXA_GLAMOR_ACCESS_RO)
+		return;
+
+	priv = intel_get_pixmap_private(pixmap);
+	if (priv == NULL)
+		return;
+
+	drm_intel_gem_bo_unmap_gtt(priv->bo);
+	pixmap->devPrivate.ptr = NULL;
+}
+
 static Bool intel_uxa_pixmap_put_image(PixmapPtr pixmap,
 				       char *src, int src_pitch,
 				       int x, int y, int w, int h)
@@ -1305,6 +1318,7 @@ Bool intel_uxa_init(ScreenPtr screen)
 	intel->uxa_driver->get_image = intel_uxa_get_image;
 
 	intel->uxa_driver->prepare_access = intel_uxa_prepare_access;
+	intel->uxa_driver->finish_access = intel_uxa_finish_access;
 	intel->uxa_driver->pixmap_is_offscreen = intel_uxa_pixmap_is_offscreen;
 
 	screen->CreatePixmap = intel_uxa_create_pixmap;
commit b424b10e771b1d3d041efdd2b77f576251364744
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Dec 4 13:01:10 2011 +0000

    sna: use tight pitches for a8
    
    As we never use these with a depth nor attach them to scanout, we can
    safely relax the multiple-of-64 byte pitch restriction. In the unlikely
    event that we do need A8 surfaces with depthbuffers, this is broken...
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index ef0b9d0..efe1c35 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -448,13 +448,13 @@ static uint32_t kgem_surface_size(struct kgem *kgem,
 			tile_width = 512;
 			tile_height = 16;
 		} else {
-			tile_width = 64;
+			tile_width = bpp > 8 ? 64 : 4;
 			tile_height = 2;
 		}
 	} else switch (tiling) {
 	default:
 	case I915_TILING_NONE:
-		tile_width = 64;
+		tile_width = bpp > 8 ? 64 : 4;
 		tile_height = 2;
 		break;
 	case I915_TILING_X:
@@ -1516,7 +1516,7 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem,
 	if (flags & CREATE_INACTIVE)
 		goto skip_active_search;
 
-	untiled_pitch = ALIGN(width * bpp / 8, 64);
+	untiled_pitch = ALIGN(width * bpp / 8, bpp > 8 ? 64 : 4);
 	for (i = 0; i <= I915_TILING_Y; i++)
 		tiled_height[i] = kgem_aligned_height(kgem, height, i);
 
commit 46c7df803881fa0e733c0d0fdd37567ebdccd6ac
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Dec 3 18:02:00 2011 +0000

    sna: Remove one redundant retire
    
    There is no need to retire immediately after a batch and no indication
    that it will be useful.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 0b3e019..ef0b9d0 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1097,7 +1097,6 @@ void _kgem_submit(struct kgem *kgem)
 		}
 	}
 
-	kgem_retire(kgem);
 	kgem_commit(kgem);
 	if (kgem->wedged)
 		kgem_cleanup(kgem);
commit b99c6b13ebba9521333b8dd5982ac37b6e244b54
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Dec 3 18:01:11 2011 +0000

    sna: Pass the current value of the batch offset to the kernel relocator
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index db3a9c0..0b3e019 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -574,6 +574,7 @@ static void kgem_fixup_self_relocs(struct kgem *kgem, struct kgem_bo *bo)
 	for (n = 0; n < kgem->nreloc; n++) {
 		if (kgem->reloc[n].target_handle == 0) {
 			kgem->reloc[n].target_handle = bo->handle;
+			kgem->reloc[n].presumed_offset = bo->presumed_offset;
 			kgem->batch[kgem->reloc[n].offset/sizeof(kgem->batch[0])] =
 				kgem->reloc[n].delta + bo->presumed_offset;
 		}


More information about the xorg-commit mailing list