From patchwork Tue Jun 16 10:37:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abdiel Janulgue X-Patchwork-Id: 6617221 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 53E6A9F1C1 for ; Tue, 16 Jun 2015 10:37:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73F7C20780 for ; Tue, 16 Jun 2015 10:37:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 50C6F2071E for ; Tue, 16 Jun 2015 10:37:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F7EF6E928; Tue, 16 Jun 2015 03:37:47 -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 1CE1E6E928 for ; Tue, 16 Jun 2015 03:37:46 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 16 Jun 2015 03:37:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,625,1427785200"; d="scan'208";a="728314419" Received: from abj-mbp11.fi.intel.com ([10.237.68.39]) by fmsmga001.fm.intel.com with ESMTP; 16 Jun 2015 03:37:44 -0700 From: Abdiel Janulgue To: intel-gfx@lists.freedesktop.org Date: Tue, 16 Jun 2015 13:37:44 +0300 Message-Id: <1434451064-4477-1-git-send-email-abdiel.janulgue@linux.intel.com> X-Mailer: git-send-email 1.9.1 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH i-g-t v3] 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.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 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. v3: Don't skip 1<<15 for the exec flags (Jani Nikula) 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..e9c13a4 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<<15) 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; \