From patchwork Thu Feb 23 19:44:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Thierry X-Patchwork-Id: 9588895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9E0C604A2 for ; Thu, 23 Feb 2017 19:44:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B749728773 for ; Thu, 23 Feb 2017 19:44:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC2B1288A0; Thu, 23 Feb 2017 19:44:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D0B828773 for ; Thu, 23 Feb 2017 19:44:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DDD016EB26; Thu, 23 Feb 2017 19:44:25 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7932D6EB1F for ; Thu, 23 Feb 2017 19:44:22 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2017 11:44:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.35,198,1484035200"; d="scan'208"; a="1134035322" Received: from relo-linux-11.sc.intel.com ([10.3.160.214]) by fmsmga002.fm.intel.com with ESMTP; 23 Feb 2017 11:44:21 -0800 From: Michel Thierry To: intel-gfx@lists.freedesktop.org Date: Thu, 23 Feb 2017 11:44:20 -0800 Message-Id: <20170223194421.28463-4-michel.thierry@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170223194421.28463-1-michel.thierry@intel.com> References: <20170223194421.28463-1-michel.thierry@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 1/2] lib/igt_gt: Add watchdog gem_ctx_set_param ioctl interface X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Set a watchdog timeout value in a given context. Signed-off-by: Michel Thierry --- lib/igt_gt.c | 7 +++++++ lib/igt_gt.h | 1 + 2 files changed, 8 insertions(+) diff --git a/lib/igt_gt.c b/lib/igt_gt.c index 3bfaf2e4..e30385ec 100644 --- a/lib/igt_gt.c +++ b/lib/igt_gt.c @@ -40,6 +40,7 @@ #include "intel_chipset.h" #define LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4 +#define LOCAL_CONTEXT_PARAM_WATCHDOG 0x6 /** * SECTION:igt_gt @@ -252,6 +253,12 @@ igt_hang_t igt_hang_ctx(int fd, __gem_context_set_param(fd, ¶m); } + if (flags & HANG_USE_WATCHDOG) { + param.param = LOCAL_CONTEXT_PARAM_WATCHDOG; + param.value = 70; // in ms + __gem_context_set_param(fd, ¶m); + } + ban = context_get_ban(fd, ctx); if ((flags & HANG_ALLOW_BAN) == 0) diff --git a/lib/igt_gt.h b/lib/igt_gt.h index c47d0c12..3b824a82 100644 --- a/lib/igt_gt.h +++ b/lib/igt_gt.h @@ -48,6 +48,7 @@ igt_hang_t igt_hang_ctx(int fd, uint64_t *offset); #define HANG_ALLOW_BAN BIT(0) #define HANG_ALLOW_CAPTURE BIT(1) +#define HANG_USE_WATCHDOG BIT(2) igt_hang_t igt_hang_ring(int fd, int ring); void igt_post_hang_ring(int fd, igt_hang_t arg);