From patchwork Tue Nov 4 22:00:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bradley.d.volkin@intel.com X-Patchwork-Id: 5231021 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 D0DB39F295 for ; Tue, 4 Nov 2014 22:00:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF8BE2015E for ; Tue, 4 Nov 2014 22:00:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CCB9920138 for ; Tue, 4 Nov 2014 22:00:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF51589FD3; Tue, 4 Nov 2014 14:00:11 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id E0BA289FD3 for ; Tue, 4 Nov 2014 14:00:10 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 04 Nov 2014 13:53:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,315,1413270000"; d="scan'208";a="617143737" Received: from bdvolkin-cube.ra.intel.com (HELO bdvolkin-ubuntu-desktop.ra.intel.com) ([10.10.34.148]) by fmsmga001.fm.intel.com with ESMTP; 04 Nov 2014 14:00:00 -0800 From: bradley.d.volkin@intel.com To: intel-gfx@lists.freedesktop.org Date: Tue, 4 Nov 2014 14:00:43 -0800 Message-Id: <1415138443-18357-1-git-send-email-bradley.d.volkin@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [Intel-gfx] [PATCH] tests/drv_hangman: skip a few asserts when using the cmd parser 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-Spam-Status: No, score=-4.8 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 From: Brad Volkin This test has a few checks that batch buffer addresses in the error state match the expected address for the userspace supplied batch. But the batch buffer copy piece of the command parser means that the logged addresses are actually _supposed_ to be different. So skip just those checks. Signed-off-by: Brad Volkin --- tests/drv_hangman.c | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) I'm not sure it's actually worth doing any of the work beyond the 'if (bb_matched == 1)' block in check_error_state when the command parser is enabled. Here I've kept that work and just taken out the one check that would fail. But it seems like the work that's left is only there to enable the removed check, so maybe not needed. I'll defer to those that know more about this test. diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c index 3d6b98b..8fbc2d3 100644 --- a/tests/drv_hangman.c +++ b/tests/drv_hangman.c @@ -36,6 +36,10 @@ #include "igt_debugfs.h" #include "ioctl_wrappers.h" +#ifndef I915_PARAM_CMD_PARSER_VERSION +#define I915_PARAM_CMD_PARSER_VERSION 28 +#endif + static int _read_sysfs(void *dst, int maxlen, const char* path, const char *fname) @@ -262,6 +266,7 @@ static void test_error_state_basic(void) } static void check_error_state(const int gen, + const bool uses_cmd_parser, const char *expected_ring_name, uint64_t expected_offset) { @@ -300,7 +305,8 @@ static void check_error_state(const int gen, char expected_line[32]; igt_assert(strstr(ring_name, expected_ring_name)); - igt_assert(gtt_offset == expected_offset); + if (!uses_cmd_parser) + igt_assert(gtt_offset == expected_offset); for (i = 0; i < sizeof(batch) / 4; i++) { igt_assert(getline(&line, &line_size, file) > 0); @@ -352,10 +358,12 @@ static void check_error_state(const int gen, i++; } } - if (gen >= 4) - igt_assert(expected_addr == expected_offset); - else - igt_assert((expected_addr & ~0x1) == expected_offset); + if (!uses_cmd_parser) { + if (gen >= 4) + igt_assert(expected_addr == expected_offset); + else + igt_assert((expected_addr & ~0x1) == expected_offset); + } ringbuf_ok = true; continue; } @@ -370,22 +378,45 @@ static void check_error_state(const int gen, close(debug_fd); } +static bool uses_cmd_parser(int fd, int gen) +{ + int parser_version = 0; + drm_i915_getparam_t gp; + int rc; + + gp.param = I915_PARAM_CMD_PARSER_VERSION; + gp.value = &parser_version; + rc = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + if (rc || parser_version == 0) + return false; + + if (!gem_uses_aliasing_ppgtt(fd)) + return false; + + if (gen != 7) + return false; + + return true; +} + static void test_error_state_capture(unsigned ring_id, const char *ring_name) { int fd, gen; uint64_t offset; + bool cmd_parser; check_other_clients(); clear_error_state(); fd = drm_open_any(); gen = intel_gen(intel_get_drm_devid(fd)); + cmd_parser = uses_cmd_parser(fd, gen); offset = submit_batch(fd, ring_id, true); close(fd); - check_error_state(gen, ring_name, offset); + check_error_state(gen, cmd_parser, ring_name, offset); } static const struct target_ring {