From patchwork Fri Aug 7 12:53:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Weinehall X-Patchwork-Id: 6968991 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 22C02C05AC for ; Fri, 7 Aug 2015 12:54:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2DAE12055B for ; Fri, 7 Aug 2015 12:54:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 38563202D1 for ; Fri, 7 Aug 2015 12:54:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A4E2D6E1B7; Fri, 7 Aug 2015 05:54:30 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 784686E1B7 for ; Fri, 7 Aug 2015 05:54:29 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 07 Aug 2015 05:54:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,630,1432623600"; d="scan'208";a="537739373" Received: from dweineha-mobl3.fi.intel.com (HELO boom) ([10.237.72.77]) by FMSMGA003.fm.intel.com with ESMTP; 07 Aug 2015 05:54:27 -0700 Date: Fri, 7 Aug 2015 15:53:57 +0300 From: David Weinehall To: Daniel Vetter Message-ID: <20150807125357.GH6150@boom> Mail-Followup-To: Daniel Vetter , Intel Graphics Development , Jesse Barnes , Daniel Vetter References: <1438896780-25788-1-git-send-email-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1438896780-25788-1-git-send-email-daniel.vetter@ffwll.ch> X-Editor: Vi Improved X-Accept-Language: Swedish, English X-GPG-Fingerprint: ED69 8CF5 6102 21B9 AFD1 9DB7 0B27 96FD 15DA A404 X-GPG-Key: http://www.acc.umu.se/~tao/files/pub_15daa404.gpg.asc X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Daniel Vetter , Intel Graphics Development Subject: Re: [Intel-gfx] [PATCH i-g-t] Revert "tests/gem_ctx_param_basic: fix invalid params" 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.3 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 On Thu, Aug 06, 2015 at 11:33:00PM +0200, Daniel Vetter wrote: > This reverts commit 0b45b0746f45deea11670a8b2c949776bbbef55c. > > The point of testing for LAST_FLAG + 1 is to catch abi extensions - > despite our best efforts we really suck at properly reviewing for test > coverage when extending ABI. > > The real bug here is that David Weinhall hasn't submitted updated igts > for the NO_ZEROMAP feature yet. Imo the right course of action is to > revert that feature if the testcase don't show up within a few days. The reason I never submitted it was probably because of Chris's strong opposition to the feature in the first place; I've had the testcase laying around on my computer for quite a while. Anyhow, here's a slightly modified version of that test -- hopefully not breaking anything. Signed-off-by: David Weinehall diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h index bc5d4bd827cf..f4deca6bd79e 100644 --- a/lib/ioctl_wrappers.h +++ b/lib/ioctl_wrappers.h @@ -102,6 +102,7 @@ struct local_i915_gem_context_param { uint32_t size; uint64_t param; #define LOCAL_CONTEXT_PARAM_BAN_PERIOD 0x1 +#define LOCAL_CONTEXT_PARAM_NO_ZEROMAP 0x2 uint64_t value; }; void gem_context_require_ban_period(int fd); diff --git a/tests/gem_ctx_param_basic.c b/tests/gem_ctx_param_basic.c index b44b37cf0538..1e7e8ff40703 100644 --- a/tests/gem_ctx_param_basic.c +++ b/tests/gem_ctx_param_basic.c @@ -57,7 +57,7 @@ igt_main ctx = gem_context_create(fd); } - ctx_param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD; + ctx_param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD; igt_subtest("basic") { ctx_param.context = ctx; @@ -98,21 +98,31 @@ igt_main ctx_param.size = 0; } - ctx_param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD + 1; + ctx_param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD; - igt_subtest("invalid-param-get") { - ctx_param.context = ctx; - TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, EINVAL); + igt_subtest("non-root-set") { + igt_fork(child, 1) { + igt_drop_root(); + + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.value--; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EPERM); + } + + igt_waitchildren(); } - igt_subtest("invalid-param-set") { + igt_subtest("root-set") { ctx_param.context = ctx; - TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EINVAL); + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.value--; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); } - ctx_param.param = LOCAL_CONTEXT_PARAM_BAN_PERIOD; + ctx_param.param = LOCAL_CONTEXT_PARAM_NO_ZEROMAP; - igt_subtest("non-root-set") { + igt_subtest("non-root-set-no-zeromap") { igt_fork(child, 1) { igt_drop_root(); @@ -125,13 +135,32 @@ igt_main igt_waitchildren(); } - igt_subtest("root-set") { + igt_subtest("root-set-no-zeromap-enabled") { ctx_param.context = ctx; TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); - ctx_param.value--; + ctx_param.value = 1; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + } + + igt_subtest("root-set-no-zeromap-disabled") { + ctx_param.context = ctx; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM); + ctx_param.value = 0; TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); } + ctx_param.param = LOCAL_CONTEXT_PARAM_NO_ZEROMAP + 1; + + igt_subtest("invalid-param-get") { + ctx_param.context = ctx; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, EINVAL); + } + + igt_subtest("invalid-param-set") { + ctx_param.context = ctx; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EINVAL); + } + igt_fixture close(fd); }