DDX driver may implement schedule swap without GetMSC. In that case we
can't call GetMSC in DRI2SwapBuffers.

Signed-off-by: Pauli Nieminen <ext-pauli.niemi...@nokia.com>
Reviewed-by: Jesse Barnes <jbar...@virtuousgeek.org>
---
 hw/xfree86/dri2/dri2.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 34f735f..e4693d9 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -828,11 +828,14 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, 
CARD64 target_msc,
         * is moved to a crtc with a lower refresh rate, or a crtc that just
         * got enabled.
         */
-       if (!(*ds->GetMSC)(pDraw, &ust, &current_msc))
-           pPriv->last_swap_target = 0;
+       if (ds->GetMSC) {
+           if (!(*ds->GetMSC)(pDraw, &ust, &current_msc))
+               pPriv->last_swap_target = 0;
 
-       if (current_msc < pPriv->last_swap_target)
-           pPriv->last_swap_target = current_msc;
+           if (current_msc < pPriv->last_swap_target)
+               pPriv->last_swap_target = current_msc;
+
+       }
 
        /*
         * Swap target for this swap is last swap target + swap interval since
-- 
1.7.0.4

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to