xf86-video-intel: 4 commits - src/sna/sna_display.c src/sna/sna_dri.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Jan 23 13:38:27 PST 2013


 src/sna/sna_display.c |    7 +++----
 src/sna/sna_dri.c     |   29 +++++++++++++++++++----------
 2 files changed, 22 insertions(+), 14 deletions(-)

New commits:
commit 778dba90cfc4e801a975bd661c56a565ce60524b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 23 21:32:29 2013 +0000

    sna/dri: Don't contribute missed frames to the target_msc
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 94834a0..9d249e3 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -2082,18 +2082,17 @@ sna_dri_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
 	     (uint32_t)*target_msc, (uint32_t)current_msc, (uint32_t)divisor));
 
 	if (divisor == 0 && current_msc >= *target_msc - 1) {
+		bool sync = current_msc < *target_msc;
 		if (can_exchange(sna, draw, front, back)) {
-			sna_dri_immediate_xchg(sna, draw, info,
-					       current_msc < *target_msc);
+			sna_dri_immediate_xchg(sna, draw, info, sync);
 		} else if (can_blit(sna, draw, front, back)) {
-			sna_dri_immediate_blit(sna, draw, info,
-					       current_msc < *target_msc);
+			sna_dri_immediate_blit(sna, draw, info, sync);
 		} else {
 			DRI2SwapComplete(client, draw, 0, 0, 0,
 					 DRI2_BLIT_COMPLETE, func, data);
 			sna_dri_frame_event_info_free(sna, draw, info);
 		}
-		*target_msc = current_msc + 1;
+		*target_msc = current_msc + sync;
 		return TRUE;
 	}
 
commit 50b41cb485ffb38e6bf705a3a62840bb78af669b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 23 21:16:49 2013 +0000

    sna/dri: Only reject DRI2 buffers that are too small for the request blit
    
    The goal is to reject stale DRI2 buffers that are smaller than the
    target due to not-yet-handled ConfigureNotify, but not to reject
    blitting from Windows that are larger than the frontbuffer.
    
    Fixes a regression from the overzealous
    commit b27ecf3059bc066ef59f2a71c1d8d8f0ffec7191
    Author: Chris Wilson <chris at chris-wilson.co.uk>
    Date:   Mon Nov 12 14:06:06 2012 +0000
    
        sna/dri: Prevent scheduling a swap on stale buffers
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index fbc0cdb..94834a0 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -841,14 +841,23 @@ can_blit(struct sna * sna,
 	 DRI2BufferPtr front,
 	 DRI2BufferPtr back)
 {
-	uint32_t f, b;
+	RegionPtr clip;
+	uint32_t s;
 
 	if (draw->type == DRAWABLE_PIXMAP)
 		return true;
 
-	f = get_private(front)->size;
-	b = get_private(back)->size;
-	return (f >> 16) >= (b >> 16) && (f & 0xffff) >= (b & 0xffff);
+	clip = &((WindowPtr)draw)->clipList;
+
+	s = get_private(front)->size;
+	if ((s>>16) < clip->extents.y2 || (s&0xffff) < clip->extents.x2)
+		return false;
+
+	s = get_private(back)->size;
+	if ((s>>16) < clip->extents.y2 || (s&0xffff) < clip->extents.x2)
+		return false;
+
+	return true;
 }
 
 static void
commit 98b312e579385e6e4adf6bf0abe20f8ca84592af
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 23 20:51:35 2013 +0000

    sna/dri: Stop feeding I915_TILING_Y to mesa i915c
    
    Only i915g handles Y-tiling, and we can't differentiate between the two
    types of clients.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 086332c..fbc0cdb 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -146,7 +146,8 @@ static uint32_t color_tiling(struct sna *sna, DrawablePtr draw)
 static uint32_t other_tiling(struct sna *sna, DrawablePtr draw)
 {
 	/* XXX Can mix color X / depth Y? */
-	return kgem_choose_tiling(&sna->kgem, -I915_TILING_Y,
+	return kgem_choose_tiling(&sna->kgem,
+				  sna->kgem.gen >=40 ? -I915_TILING_Y : -I915_TILING_X,
 				  draw->width,
 				  draw->height,
 				  draw->bitsPerPixel);
commit 31796400915a06fc789088b7dcfcecd6ea91e195
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 23 19:37:23 2013 +0000

    sna: Clean up WAIT_FOR_EVENT on gen2/3
    
    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 6955536..307e763 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2790,6 +2790,8 @@ static bool sna_emit_wait_for_scanline_gen7(struct sna *sna,
 	y2--;
 
 	switch (pipe) {
+	default:
+		assert(0);
 	case 0:
 		event = 1 << (full_height ? 3 : 0);
 		break;
@@ -2934,10 +2936,7 @@ static bool sna_emit_wait_for_scanline_gen2(struct sna *sna,
 	 * always comes in pairs. Don't ask me why. */
 	b[2] = b[0] = MI_LOAD_SCAN_LINES_INCL | pipe << 20;
 	b[3] = b[1] = (y1 << 16) | (y2-1);
-	if (pipe == 0)
-		b[4] = MI_WAIT_FOR_EVENT | MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW;
-	else
-		b[4] = MI_WAIT_FOR_EVENT | MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW;
+	b[4] = MI_WAIT_FOR_EVENT | 1 << (1 + 4*pipe);
 
 	return true;
 }


More information about the xorg-commit mailing list