From patchwork Thu Apr 11 13:11:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 2428301 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 252603FD8C for ; Thu, 11 Apr 2013 13:07:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1BAC6E610D for ; Thu, 11 Apr 2013 06:07:49 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 2900CE5DEB for ; Thu, 11 Apr 2013 06:07:41 -0700 (PDT) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 11 Apr 2013 06:07:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,455,1363158000"; d="scan'208";a="225970027" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.67]) by AZSMGA002.ch.intel.com with ESMTP; 11 Apr 2013 06:07:15 -0700 Received: by rosetta (Postfix, from userid 1000) id 5CDBE80092; Thu, 11 Apr 2013 16:11:30 +0300 (EEST) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Thu, 11 Apr 2013 16:11:28 +0300 Message-Id: <1365685888-6089-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Intel-gfx] [PATCH 1/1] tests/gem_seqno_wrap: verify debugfs write with readback 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 Make sure that debugfs entry works as expected by reading back the sequence number that was written. Signed-off-by: Mika Kuoppala --- tests/gem_seqno_wrap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c index 43e3851..776dedc 100644 --- a/tests/gem_seqno_wrap.c +++ b/tests/gem_seqno_wrap.c @@ -438,6 +438,7 @@ static int write_seqno(uint32_t seqno) int fh; char buf[32]; int r; + uint32_t rb; if (options.dontwrap) return 0; @@ -457,6 +458,15 @@ static int write_seqno(uint32_t seqno) if (options.verbose) printf("next_seqno set to: 0x%x\n", seqno); + r = __read_seqno(&rb); + if (r < 0) + return r; + + if (rb != seqno) { + printf("seqno readback differs rb:0x%x vs w:0x%x\n", rb, seqno); + return -1; + } + return 0; }