xf86-video-intel: 5 commits - src/sna/gen6_common.h src/sna/sna_display.c src/sna/sna_dri2.c

Chris Wilson ickle at kemper.freedesktop.org
Mon May 16 09:02:01 UTC 2016


 src/sna/gen6_common.h |    3 +++
 src/sna/sna_display.c |    9 +++++----
 src/sna/sna_dri2.c    |   33 +++++++++++++++------------------
 3 files changed, 23 insertions(+), 22 deletions(-)

New commits:
commit 3a7d6afd85f85b8b10bf0c08b7b5fa5265624850
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat May 14 16:13:33 2016 +0100

    sna: Do not cache the current crtc bo after performing the setcrtc
    
    When doing a SETCRTC as a fallack for a failed pageflip, do not use the
    then current CRTC bo as the next bo for pageflipping - as then we will
    render into it prior to flipping and so cause tearing.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=95401
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 2c6059d..080efbe 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -8734,7 +8734,6 @@ void sna_mode_redisplay(struct sna *sna)
 
 						sna_crtc->bo = kgem_bo_reference(bo);
 						sna_crtc->bo->active_scanout++;
-						sna_crtc->cache_bo = kgem_bo_reference(bo);
 					} else {
 						BoxRec box;
 						DrawableRec tmp;
@@ -8762,10 +8761,10 @@ disable1:
 								   __FUNCTION__, __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc));
 							sna_crtc_disable(crtc, false);
 						}
-
-						kgem_bo_destroy(&sna->kgem, bo);
-						sna_crtc->cache_bo = NULL;
 					}
+
+					kgem_bo_destroy(&sna->kgem, bo);
+					sna_crtc->cache_bo = NULL;
 					continue;
 				}
 				sna->mode.flip_active++;
@@ -8778,6 +8777,8 @@ disable1:
 				sna_crtc->flip_serial = sna_crtc->mode_serial;
 				sna_crtc->flip_pending = true;
 
+				assert_scanout(&sna->kgem, sna_crtc->bo,
+					       crtc->mode.HDisplay, crtc->mode.VDisplay);
 				sna_crtc->cache_bo = kgem_bo_reference(sna_crtc->bo);
 				DBG(("%s: recording flip on CRTC:%d handle=%d, active_scanout=%d, serial=%d\n",
 				     __FUNCTION__, __sna_crtc_id(sna_crtc), sna_crtc->flip_bo->handle, sna_crtc->flip_bo->active_scanout, sna_crtc->flip_serial));
commit f71447998cc8e22570cd5641bcf008cb68e9f4a3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat May 14 09:00:08 2016 +0100

    sna/dri2: Refactor open-coded __kgem_bo_is_busy
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index ca9251a..59877e9 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -2553,22 +2553,15 @@ static inline bool rq_is_busy(struct kgem *kgem, struct kgem_bo *bo)
 	if (bo == NULL)
 		return false;
 
-	DBG(("%s: handle=%d, domain: %d exec? %d, rq? %d\n", __FUNCTION__,
-	     bo->handle, bo->domain, bo->exec != NULL, bo->rq != NULL));
-	assert(bo->refcnt);
-
-	if (bo->exec)
-		return true;
-
-	if (bo->rq == NULL)
-		return false;
-
-	return __kgem_busy(kgem, bo->handle);
+	return __kgem_bo_is_busy(kgem, bo);
 }
 
 static bool sna_dri2_blit_complete(struct sna_dri2_event *info)
 {
-	if (rq_is_busy(&info->sna->kgem, info->bo)) {
+	if (!info->bo)
+		return true;
+
+	if (__kgem_bo_is_busy(&info->sna->kgem, info->bo)) {
 		DBG(("%s: vsync'ed blit is still busy, postponing\n",
 		     __FUNCTION__));
 		if (sna_next_vblank(info))
@@ -2578,10 +2571,9 @@ static bool sna_dri2_blit_complete(struct sna_dri2_event *info)
 	}
 
 	DBG(("%s: blit finished\n", __FUNCTION__));
-	if (info->bo) {
-		kgem_bo_destroy(&info->sna->kgem, info->bo);
-		info->bo = NULL;
-	}
+	kgem_bo_destroy(&info->sna->kgem, info->bo);
+	info->bo = NULL;
+
 	return true;
 }
 
commit 3c95efe5f7989d95153f527eb7d2946d3bbc2af1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat May 14 08:49:46 2016 +0100

    sna/dri2: Force blocking wait if vblank queue fails
    
    Whilst waiting for the previous blit to complete, if we fail to queue
    the vblank to wake up on the next frame, block before replying the blit
    is complete.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 4ffa7c3..ca9251a 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -2573,6 +2573,8 @@ static bool sna_dri2_blit_complete(struct sna_dri2_event *info)
 		     __FUNCTION__));
 		if (sna_next_vblank(info))
 			return false;
+
+		kgem_bo_sync__gtt(&info->sna->kgem, info->bo);
 	}
 
 	DBG(("%s: blit finished\n", __FUNCTION__));
commit 1486cfdf04b070787074493a30cd698455b016fe
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri May 13 22:53:26 2016 +0100

    sna/gen6+: Don't force a switch to BLT if the target bo cannot be blitted
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen6_common.h b/src/sna/gen6_common.h
index 83adc7d..b53ec0c 100644
--- a/src/sna/gen6_common.h
+++ b/src/sna/gen6_common.h
@@ -52,6 +52,9 @@ inline static bool can_switch_to_blt(struct sna *sna,
 	if (bo && bo->tiling == I915_TILING_Y)
 		return false;
 
+	if (bo && !kgem_bo_can_blt(&sna->kgem, bo))
+		return false;
+
 	if (sna->render_state.gt < 2)
 		return true;
 
commit 512284fd47bc225236e403920647703ea4842666
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon May 9 21:11:13 2016 +0100

    sna/dri2: Enforce swap-limits on stale buffers
    
    If the client sends an out-of-date swap request, first make sure that we
    don't cause an error by chasing a NULL CRTC and secondly force them to
    wait for a whole vblank before the next swap.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index d3fe18b..4ffa7c3 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1617,6 +1617,9 @@ static void fake_swap_complete(struct sna *sna, ClientPtr client,
 
 	assert(draw);
 
+	if (crtc == NULL)
+		crtc = sna_primary_crtc(sna);
+
 	swap = sna_crtc_last_swap(crtc);
 	DBG(("%s(type=%d): draw=%ld, pipe=%d, frame=%lld [msc %lld], tv=%d.%06d\n",
 	     __FUNCTION__, type, (long)draw->id, crtc ? sna_crtc_pipe(crtc) : -1,
@@ -3340,7 +3343,7 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
 		     __FUNCTION__,
 		     get_private(front)->pixmap->drawable.serialNumber,
 		     get_drawable_pixmap(draw)->drawable.serialNumber));
-		goto fake;
+		goto skip;
 	}
 
 	if (get_private(back)->stale) {
@@ -3484,7 +3487,7 @@ skip:
 		if (!sna_next_vblank(info))
 			goto fake;
 
-		swap_limit(draw, 2);
+		swap_limit(draw, 1);
 	} else {
 fake:
 		/* XXX Use a Timer to throttle the client? */


More information about the xorg-commit mailing list