From patchwork Tue May 19 10:58:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abdiel Janulgue X-Patchwork-Id: 6436131 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5DBF89F399 for ; Tue, 19 May 2015 10:58:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E27E12049E for ; Tue, 19 May 2015 10:58:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0D85720434 for ; Tue, 19 May 2015 10:58:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63CAE6E626; Tue, 19 May 2015 03:58:49 -0700 (PDT) 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 796C36E626 for ; Tue, 19 May 2015 03:58:47 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 19 May 2015 03:58:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,457,1427785200"; d="scan'208";a="728272628" Received: from abj-mbp11.fi.intel.com ([10.237.68.35]) by fmsmga002.fm.intel.com with ESMTP; 19 May 2015 03:58:46 -0700 From: Abdiel Janulgue To: intel-gfx@lists.freedesktop.org Date: Tue, 19 May 2015 13:58:43 +0300 Message-Id: <1432033123-21385-1-git-send-email-abdiel.janulgue@linux.intel.com> X-Mailer: git-send-email 1.9.1 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH v2] tests/gem_exec_params: check invalid flags for Resource Streamer 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, T_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 Make sure resource streamer flags works only in correct ring in addition to checking next flag after the RS boundary fails. v2: Make sure we reject RS on pre-hsw. Cc: Daniel Vetter Signed-off-by: Abdiel Janulgue --- tests/gem_exec_params.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c index 54f0dc3..f374226 100644 --- a/tests/gem_exec_params.c +++ b/tests/gem_exec_params.c @@ -48,6 +48,7 @@ #define LOCAL_I915_EXEC_BSD_MASK (3<<13) #define LOCAL_I915_EXEC_BSD_RING1 (1<<13) #define LOCAL_I915_EXEC_BSD_RING2 (2<<13) +#define LOCAL_I915_EXEC_RESOURCE_STREAMER (1<<16) struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 gem_exec[1]; @@ -220,7 +221,7 @@ igt_main /* HANDLE_LUT and NO_RELOC are already exercised by gem_exec_lut_handle */ igt_subtest("invalid-flag") { - execbuf.flags = I915_EXEC_RENDER | (I915_EXEC_HANDLE_LUT << 1); + execbuf.flags = I915_EXEC_RENDER | (LOCAL_I915_EXEC_RESOURCE_STREAMER << 1); RUN_FAIL(EINVAL); } @@ -234,6 +235,30 @@ igt_main execbuf.num_cliprects = 0; } + igt_subtest("rs-invalid-on-bsd-ring") { + igt_require(IS_HASWELL(devid) || intel_gen(devid) >= 8); + execbuf.flags = I915_EXEC_BSD | LOCAL_I915_EXEC_RESOURCE_STREAMER; + RUN_FAIL(EINVAL); + } + + igt_subtest("rs-invalid-on-blt-ring") { + igt_require(IS_HASWELL(devid) || intel_gen(devid) >= 8); + execbuf.flags = I915_EXEC_BLT | LOCAL_I915_EXEC_RESOURCE_STREAMER; + RUN_FAIL(EINVAL); + } + + igt_subtest("rs-invalid-on-vebox-ring") { + igt_require(IS_HASWELL(devid) || intel_gen(devid) >= 8); + execbuf.flags = I915_EXEC_VEBOX | LOCAL_I915_EXEC_RESOURCE_STREAMER; + RUN_FAIL(EINVAL); + } + + igt_subtest("rs-invalid-gen") { + igt_require(!IS_HASWELL(devid) && intel_gen(devid) < 8); + execbuf.flags = I915_EXEC_RENDER | LOCAL_I915_EXEC_RESOURCE_STREAMER; + RUN_FAIL(EINVAL); + } + #define DIRT(name) \ igt_subtest(#name "-dirt") { \ execbuf.flags = 0; \