From aab0cde61fc8b6295569cb9d879924afc15a2bd8 Mon Sep 17 00:00:00 2001 From: Micah Dowty Date: Mon, 13 Jul 2009 23:12:04 +0000 Subject: [PATCH] To get better test coverage of the host-side DMA code, alternate between using Fences and legacy Sync. --- examples/gmr-test/main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/gmr-test/main.c b/examples/gmr-test/main.c index 6e0567c..6c50b28 100644 --- a/examples/gmr-test/main.c +++ b/examples/gmr-test/main.c @@ -188,8 +188,16 @@ GMR_GenericCopy(SVGAGuestPtr *dest, SVGA3D_DestroySurface(tempSurfaceId); - /* Wait for both DMA operations to finish. */ - SVGA_SyncToFence(SVGA_InsertFence()); + /* + * Wait for both DMA operations to finish. For better test + * coverage, we'll alternate between using fences and legacy syncs. + */ + if (testIters & 1) { + SVGA_SyncToFence(SVGA_InsertFence()); + } else { + SVGA_WriteReg(SVGA_REG_SYNC, 1); + while (SVGA_ReadReg(SVGA_REG_BUSY)); + } }