From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: [i-g-t PATCH] tests/gem_wait_render_timeout: make sure the GPU is idle before exiting Date: Mon, 27 May 2013 18:42:42 +0300 Message-ID: <1369669362-21300-1-git-send-email-imre.deak@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B38FE5DFF for ; Mon, 27 May 2013 08:42:49 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org Leaving the GPU running after we exit can mess up timing dependent tests we run afterwards. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64270 Signed-off-by: Imre Deak --- tests/gem_wait_render_timeout.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/gem_wait_render_timeout.c b/tests/gem_wait_render_timeout.c index 14482e3..9ec4e49 100644 --- a/tests/gem_wait_render_timeout.c +++ b/tests/gem_wait_render_timeout.c @@ -216,6 +216,11 @@ int main(int argc, char **argv) assert(gem_bo_wait_timeout(fd, dst2->handle, &timeout) == -ETIME); assert(timeout == 0); + /* Make sure we exit only after the GPU is idle. Apply some fuzz + * to the timeout since the calibrated iteration count can be + * twice the amount the GPU can execute in a second. */ + timeout = 5 * ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC; + assert(gem_bo_wait_timeout(fd, dst2->handle, &timeout) == 0); if (do_signals) drmtest_stop_signal_helper(); -- 1.8.1.2