From patchwork Fri Dec 8 16:02:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 10102863 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 0A90D60329 for ; Fri, 8 Dec 2017 16:02:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAD9028E04 for ; Fri, 8 Dec 2017 16:02:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE98B28E0A; Fri, 8 Dec 2017 16:02:41 +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 4F7BE28E04 for ; Fri, 8 Dec 2017 16:02:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3226A89C03; Fri, 8 Dec 2017 16:02:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 17F8B89BFF for ; Fri, 8 Dec 2017 16:02:39 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Dec 2017 08:02:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,378,1508828400"; d="scan'208";a="185309359" Received: from delly.ld.intel.com ([10.103.238.204]) by fmsmga006.fm.intel.com with ESMTP; 08 Dec 2017 08:02:38 -0800 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Fri, 8 Dec 2017 16:02:36 +0000 Message-Id: <20171208160236.15022-1-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.15.1 Subject: [Intel-gfx] [PATCH i-g-t v2] tests/perf: skip config tests on older kernels 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 We mostly run tests on the most recent kernels but those are failing on < 4.14. Signed-off-by: Lionel Landwerlin Reviewed-by: Chris Wilson --- tests/perf.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/perf.c b/tests/perf.c index 969b8c74..a173680c 100644 --- a/tests/perf.c +++ b/tests/perf.c @@ -3964,6 +3964,17 @@ static void i915_perf_remove_config(int fd, uint64_t config_id) &config_id), 0); } +static bool has_i915_perf_userspace_config(int fd) +{ + uint64_t config = 0; + int ret = igt_ioctl(fd, DRM_IOCTL_I915_PERF_REMOVE_CONFIG, &config); + igt_assert_eq(ret, -1); + + igt_debug("errno=%i\n", errno); + + return errno != EINVAL; +} + static void test_invalid_create_userspace_config(void) { @@ -3973,6 +3984,8 @@ test_invalid_create_userspace_config(void) uint32_t mux_regs[] = { 0x9888 /* NOA_WRITE */, 0x0 }; uint32_t invalid_mux_regs[] = { 0x12345678 /* invalid register */, 0x0 }; + igt_require(has_i915_perf_userspace_config(drm_fd)); + memset(&config, 0, sizeof(config)); /* invalid uuid */ @@ -4032,6 +4045,8 @@ test_invalid_remove_userspace_config(void) uint64_t config_id, wrong_config_id = 999999999; char path[512]; + igt_require(has_i915_perf_userspace_config(drm_fd)); + snprintf(path, sizeof(path), "/sys/class/drm/card%d/metrics/%s/id", card, uuid); /* Destroy previous configuration if present */ @@ -4090,6 +4105,8 @@ test_create_destroy_userspace_config(void) }; char path[512]; + igt_require(has_i915_perf_userspace_config(drm_fd)); + snprintf(path, sizeof(path), "/sys/class/drm/card%d/metrics/%s/id", card, uuid); /* Destroy previous configuration if present */ @@ -4170,6 +4187,8 @@ test_whitelisted_registers_userspace_config(void) 0xe65c }; + igt_require(has_i915_perf_userspace_config(drm_fd)); + snprintf(path, sizeof(path), "/sys/class/drm/card%d/metrics/%s/id", card, uuid); if (try_read_u64_file(path, &config_id))