[PATCH v2 2/5] DRI2: Add error message when working around driver bug

Pauli Nieminen ext-pauli.nieminen at nokia.com
Mon Nov 1 07:21:58 PDT 2010


There isn't API that allows application atomically query for msc changes
and schedule swaps. If msc changes dramatically between query and
scheduling application would schedule swap to happen at wrong time.

Because of API limitations driver has to make msc increment for each
vblank affecting the drawable.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
CC: Jesse Barnes <jbarnes at virtuousgeek.org>
CC: Mario Kleiner <mario.kleiner at tuebingen.mpg.de>
---
 hw/xfree86/dri2/dri2.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index e4693d9..9379433 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -832,9 +832,12 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
 	    if (!(*ds->GetMSC)(pDraw, &ust, &current_msc))
 		pPriv->last_swap_target = 0;
 
-	    if (current_msc < pPriv->last_swap_target)
+	    if (current_msc < pPriv->last_swap_target) {
 		pPriv->last_swap_target = current_msc;
-
+		xf86DrvMsgVerb(pScreen->myNum, X_WARNING, 3,
+			"[DRI2] %s: GetMSC returned swap count that is in "
+			"past. Working around driver bug.\n", __func__);
+	    }
 	}
 
 	/*
-- 
1.7.0.4



More information about the xorg-devel mailing list