From patchwork Thu Mar 10 11:03:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Morton X-Patchwork-Id: 8555571 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 90740C0553 for ; Thu, 10 Mar 2016 11:04:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A32F12024D for ; Thu, 10 Mar 2016 11:04:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B93C2200FF for ; Thu, 10 Mar 2016 11:04:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB0636E932; Thu, 10 Mar 2016 11:04:18 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id D2C416E932 for ; Thu, 10 Mar 2016 11:04:09 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 10 Mar 2016 03:04:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,315,1455004800"; d="scan'208";a="906892045" Received: from djmorton-linux2.isw.intel.com ([10.102.226.90]) by orsmga001.jf.intel.com with ESMTP; 10 Mar 2016 03:04:05 -0800 From: Derek Morton To: intel-gfx@lists.freedesktop.org Date: Thu, 10 Mar 2016 11:03:32 +0000 Message-Id: <1457607814-18751-5-git-send-email-derek.j.morton@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1457607814-18751-1-git-send-email-derek.j.morton@intel.com> References: <1457607814-18751-1-git-send-email-derek.j.morton@intel.com> Cc: daniel.vetter@ffwll.com Subject: [Intel-gfx] [PATCH i-g-t v3 4/6] igt/gem_ctx_param_basic: Updated to support scheduler priority interface 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.2 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: John Harrison The GPU scheduler has added an execution priority level to the context object. There is an IOCTL interface to allow user apps/libraries to set this priority. This patch updates the context paramter IOCTL test to include the new interface. For: VIZ-1587 Signed-off-by: John Harrison --- lib/ioctl_wrappers.h | 1 + tests/gem_ctx_param_basic.c | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h index e095c41..9e6337e 100644 --- a/lib/ioctl_wrappers.h +++ b/lib/ioctl_wrappers.h @@ -107,6 +107,7 @@ struct local_i915_gem_context_param { #define LOCAL_CONTEXT_PARAM_BAN_PERIOD 0x1 #define LOCAL_CONTEXT_PARAM_NO_ZEROMAP 0x2 #define LOCAL_CONTEXT_PARAM_GTT_SIZE 0x3 +#define LOCAL_CONTEXT_PARAM_PRIORITY 0x4 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 b75800c..585a1a8 100644 --- a/tests/gem_ctx_param_basic.c +++ b/tests/gem_ctx_param_basic.c @@ -147,10 +147,42 @@ igt_main TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); } + ctx_param.param = LOCAL_CONTEXT_PARAM_PRIORITY; + + igt_subtest("priority-root-set") { + ctx_param.context = ctx; + ctx_param.value = 2048; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EINVAL); + ctx_param.value = -2048; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EINVAL); + ctx_param.value = 512; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + ctx_param.value = -512; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + ctx_param.value = 0; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + } + + igt_subtest("priority-non-root-set") { + igt_fork(child, 1) { + igt_drop_root(); + + ctx_param.context = ctx; + ctx_param.value = 512; + TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EPERM); + ctx_param.value = -512; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + ctx_param.value = 0; + TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM); + } + + igt_waitchildren(); + } + /* NOTE: This testcase intentionally tests for the next free parameter * to catch ABI extensions. Don't "fix" this testcase without adding all * the tests for the new param first. */ - ctx_param.param = LOCAL_CONTEXT_PARAM_GTT_SIZE + 1; + ctx_param.param = LOCAL_CONTEXT_PARAM_PRIORITY + 1; igt_subtest("invalid-param-get") { ctx_param.context = ctx;