xf86-video-intel: src/sna/sna_dri.c

Chris Wilson ickle at kemper.freedesktop.org
Tue May 22 08:27:41 PDT 2012


 src/sna/sna_dri.c |   59 +++++++++++++++++++-----------------------------------
 1 file changed, 21 insertions(+), 38 deletions(-)

New commits:
commit 3410db008c6c20dc6590a89c05b40a0c6de6744a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue May 22 15:54:52 2012 +0100

    sna/dri: Avoid confusion of attempting to exchange pixmaps for DPMS-off flips
    
    Not only do we confuse ourselves, but we end up confusing the damage
    tracking on the root window whenever we update the Screen Pixmap. So for
    the time being, don't.
    
    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 2b97e68..517eaad 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -937,11 +937,13 @@ can_flip(struct sna * sna,
 	WindowPtr win = (WindowPtr)draw;
 	PixmapPtr pixmap;
 
-	if (!sna->scrn->vtSema)
+	if (draw->type == DRAWABLE_PIXMAP)
 		return FALSE;
 
-	if (draw->type == DRAWABLE_PIXMAP)
+	if (!sna->scrn->vtSema) {
+		DBG(("%s: no, not attached to VT\n", __FUNCTION__));
 		return FALSE;
+	}
 
 	if (front->format != back->format) {
 		DBG(("%s: no, format mismatch, front = %d, back = %d\n",
@@ -1184,23 +1186,25 @@ static void sna_dri_flip_event(struct sna *sna,
 				      serverClient,
 				      M_ANY, DixWriteAccess) == Success) {
 			if (can_flip(sna, drawable, flip->front, flip->back) &&
-			    !sna_dri_flip_continue(sna, drawable, flip)) {
+			    sna_dri_flip_continue(sna, drawable, flip)) {
 				DRI2SwapComplete(flip->client, drawable,
-						 0, 0, 0,
-						 DRI2_BLIT_COMPLETE,
-						 flip->client ? flip->event_complete : NULL,
-						 flip->event_data);
-				sna_dri_frame_event_info_free(flip);
+						0, 0, 0,
+						DRI2_FLIP_COMPLETE,
+						flip->client ? flip->event_complete : NULL,
+						flip->event_data);
 			} else {
+				DBG(("%s: no longer able to flip\n",
+				     __FUNCTION__));
+
 				DRI2SwapComplete(flip->client, drawable,
-						 0, 0, 0,
-						 DRI2_FLIP_COMPLETE,
-						 flip->client ? flip->event_complete : NULL,
-						 flip->event_data);
+						0, 0, 0,
+						DRI2_EXCHANGE_COMPLETE,
+						flip->client ? flip->event_complete : NULL,
+						flip->event_data);
+				sna_dri_frame_event_info_free(flip);
 			}
-		} else {
+		} else
 			sna_dri_frame_event_info_free(flip);
-		}
 		break;
 
 #if DRI2INFOREC_VERSION >= 7
@@ -1296,31 +1300,10 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
 	     (long long)divisor,
 	     (long long)remainder));
 
-	/* Drawable not displayed... just complete the swap */
+	/* XXX In theory we can just exchange pixmaps.... */
 	pipe = sna_dri_get_pipe(draw);
-	if (pipe == -1) {
-		RegionRec region;
-
-		DBG(("%s: off-screen, immediate update\n", __FUNCTION__));
-
-		sna_dri_exchange_attachment(front, back);
-		get_private(back)->pixmap = get_private(front)->pixmap;
-		get_private(front)->pixmap = NULL;
-		set_bo(get_private(back)->pixmap, get_private(back)->bo);
-
-		/* XXX can we query whether we need to process damage? */
-		region.extents.x1 = draw->x;
-		region.extents.y1 = draw->y;
-		region.extents.x2 = draw->x + draw->width;
-		region.extents.y2 = draw->y + draw->height;
-		region.data = NULL;
-		DamageRegionAppend(draw, &region);
-		DamageRegionProcessPending(draw);
-
-		DRI2SwapComplete(client, draw, 0, 0, 0,
-				 DRI2_EXCHANGE_COMPLETE, func, data);
-		return TRUE;
-	}
+	if (pipe == -1)
+		return FALSE;
 
 	/* Truncate to match kernel interfaces; means occasional overflow
 	 * misses, but that's generally not a big deal */


More information about the xorg-commit mailing list