From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mika Kuoppala Subject: [PATCH 2/3] tests: add i915_sfs_path Date: Thu, 27 Jun 2013 16:54:43 +0300 Message-ID: <1372341284-14132-2-git-send-email-mika.kuoppala@intel.com> References: <1372341284-14132-1-git-send-email-mika.kuoppala@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: 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) In-Reply-To: <1372341284-14132-1-git-send-email-mika.kuoppala@intel.com> 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 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 -- 1.7.9.5