If executed too soon after prime_vgem tests, the vgem unload test
fails due to its execbuffers still being handled in the kernel. Retry
the unload three times with sleeps before reporting a skip.

When tested on HSW, one 1s sleep wasn't enough, 3s was.

Signed-off-by: Petri Latvala <petri.latv...@intel.com>
CC: Chris Wilson <ch...@chris-wilson.co.uk>
CC: Jari Tahvanainen <jari.tahvanai...@intel.com>
CC: Daniel Vetter <dan...@ffwll.ch>
---

With this change, we can leave vgem_basic@unload last in the CI
testlist, and thus still catch actual unload problems.

tests/vgem_basic.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/vgem_basic.c b/tests/vgem_basic.c
index 5b54a4a..7f0750d 100644
--- a/tests/vgem_basic.c
+++ b/tests/vgem_basic.c
@@ -296,10 +296,15 @@ static int module_unload(void)
 static void test_unload(void)
 {
        struct vgem_bo bo;
-       int vgem, dmabuf;
+       int vgem, dmabuf, unloaded, retry = 3;
        uint32_t *ptr;
 
-       igt_require(module_unload() == 0);
+       while ((unloaded = module_unload()) && retry-- > 0) {
+               /* Sleep for a moment to let previous users finish */
+               sleep(1);
+       }
+
+       igt_require(unloaded == 0);
 
        vgem = __drm_open_driver(DRIVER_VGEM);
        igt_assert(vgem != -1);
-- 
2.9.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to