From patchwork Thu Jun 27 13:54:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 2793711 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B513D9F245 for ; Thu, 27 Jun 2013 13:55:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A03420340 for ; Thu, 27 Jun 2013 13:55:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B27F120335 for ; Thu, 27 Jun 2013 13:55:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A038E5CCE for ; Thu, 27 Jun 2013 06:55:13 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 99302E5C21 for ; Thu, 27 Jun 2013 06:54:46 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 27 Jun 2013 06:54:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,952,1363158000"; d="scan'208";a="360489947" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.67]) by orsmga002.jf.intel.com with ESMTP; 27 Jun 2013 06:54:45 -0700 Received: by rosetta (Postfix, from userid 1000) id A54D380079; Thu, 27 Jun 2013 16:54:44 +0300 (EEST) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Thu, 27 Jun 2013 16:54:43 +0300 Message-Id: <1372341284-14132-2-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1372341284-14132-1-git-send-email-mika.kuoppala@intel.com> References: <1372341284-14132-1-git-send-email-mika.kuoppala@intel.com> Subject: [Intel-gfx] [PATCH 2/3] tests: add i915_sfs_path X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To access 'error_state' through sysfs. Signed-off-by: Mika Kuoppala --- tests/drm_lib.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh index 7eaf34e..72da4ad 100755 --- a/tests/drm_lib.sh +++ b/tests/drm_lib.sh @@ -29,4 +29,19 @@ if [ `cat $i915_dfs_path/clients | wc -l` -gt "2" ] ; then die "ERROR: other drm clients running" fi +if [ -d /sys/class/drm ] ; then + sysfs_path=/sys/class/drm +fi + +i915_sfs_path=x +for dir in `ls $sysfs_path` ; do + if [ -f $sysfs_path/$dir/error_state ] ; then + i915_sfs_path=$sysfs_path/$dir + break + fi +done + +if [ $i915_sfs_path = "x" ] ; then + die " i915 sysfs path not found." +fi