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

Chris Wilson ickle at kemper.freedesktop.org
Sun Mar 29 05:18:51 PDT 2015


 src/sna/kgem.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 8dc716e8667f918af5febc82ed301aeff59d86f0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Mar 26 22:31:35 2015 +0000

    sna: Limit the last gasp execbuf try to ENOSPC
    
    Disabling the outputs and trying again can only possibly help in the
    case of fragmentation. In all other failures modes (typically GPU hang)
    it just causes a slow flash of the display.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index e3687a1..63eda3a 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3609,7 +3609,7 @@ static void dump_fence_regs(struct kgem *kgem)
 
 static int do_execbuf(struct kgem *kgem, struct drm_i915_gem_execbuffer2 *execbuf)
 {
-	int ret, err;
+	int ret;
 
 retry:
 	ret = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf);
@@ -3626,17 +3626,17 @@ retry:
 
 	/* last gasp */
 	ret = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf);
-	if (ret == 0)
-		return 0;
+	if (ret != -ENOSPC)
+		return ret;
+
+	/* One final trick up our sleeve for when we run out of space.
+	 * We turn everything off to free up our pinned framebuffers,
+	 * sprites and cursors, and try just one more time.
+	 */
 
 	xf86DrvMsg(kgem_get_screen_index(kgem), X_WARNING,
 		   "Failed to submit rendering commands, trying again with outputs disabled.\n");
 
-	/* One last trick up our sleeve for when we run out of space.
-	 * We turn everything off to free up our pinned framebuffers,
-	 * sprites and cursors, and try one last time.
-	 */
-	err = errno;
 	if (sna_mode_disable(container_of(kgem, struct sna, kgem))) {
 		kgem_cleanup_cache(kgem);
 		ret = do_ioctl(kgem->fd,
@@ -3645,7 +3645,6 @@ retry:
 		DBG(("%s: last_gasp ret=%d\n", __FUNCTION__, ret));
 		sna_mode_enable(container_of(kgem, struct sna, kgem));
 	}
-	errno = err;
 
 	return ret;
 }
commit c05c6abd089cc81c39f78513b614023c471d097a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Mar 28 23:58:35 2015 +0000

    sna: Mask the batch length
    
    It's white lie that only is technically required for gen2, and works
    around a massive performance hit on gen7.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 83c7510..e3687a1 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3711,7 +3711,8 @@ void _kgem_submit(struct kgem *kgem)
 		memset(&execbuf, 0, sizeof(execbuf));
 		execbuf.buffers_ptr = (uintptr_t)kgem->exec;
 		execbuf.buffer_count = kgem->nexec;
-		execbuf.batch_len = batch_end*sizeof(uint32_t);
+		if (kgem->gen < 030)
+			execbuf.batch_len = batch_end*sizeof(uint32_t);
 		execbuf.flags = kgem->ring | kgem->batch_flags;
 
 		if (DBG_DUMP) {


More information about the xorg-commit mailing list