From patchwork Wed Nov 9 16:15:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Bragg X-Patchwork-Id: 9419749 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 9BB74601C0 for ; Wed, 9 Nov 2016 16:16:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9011E289E5 for ; Wed, 9 Nov 2016 16:16:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8511428AD0; Wed, 9 Nov 2016 16:16:59 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID 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 34F45289E5 for ; Wed, 9 Nov 2016 16:16:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8E366E6D5; Wed, 9 Nov 2016 16:16:58 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F48B6E6D5 for ; Wed, 9 Nov 2016 16:16:57 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id a20so19468344wme.2 for ; Wed, 09 Nov 2016 08:16:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=5EUVfuCHV5s1OgWbml0EGTnbUwFQdZpnkjKuNe8iDVE=; b=o0tb5FJnz1xOxHH41xoXkElzbf8CR8JfSa0WcZjHj2G1TTTzmY09XWYfqz78HnIc8E vrReOQ/VfGqn3rqKuPTjy2Ng4zGQc6UN8I8UyylY3XgsAC7foiZAA3CjjQ68lF/aKpiQ KL9ojGlh02zC/eyYMfXbGPvOhiyMItuIgHgqA4CAng72nXyR79wRBsqOM3d0c8Ao//cP 8MISkMw8JycydbFP71JjLIuabRQnpMAUGnuja3dg5/4ZfwAAKppVaGwqfX3Yfra0VOwY cKKqgcOfN2XtLCjkCHqMMrEyjpr9myMrv0MidBbwYZoJML2ntvpzJk82436wTCn+eL1A AknQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=5EUVfuCHV5s1OgWbml0EGTnbUwFQdZpnkjKuNe8iDVE=; b=ji3TLoS7XoCVOC4/xtgZHw3Qc5f7HX1jUvP8iavbYQAGds0vhCSPKpK32+jaJ2a0fs d/T8chvMn5eRHMd7Fo3LuFC+/Z/SCAEIgCxoctXj7IToIpiBExqVnlwLL4AV/HaE0l5Z NpmUIlp4WF/DukCYnaPw4HQaN3xY9/iJCsjYB5+cH2f0j7c1Hj9GiGdDkGP1a0iQNa++ JpWS97x/WE+a4p5c2g8kMcQMNuHtsVhPx/aUt9c54wCO25VCfix1VeP1KCU6ynY69OF+ uQITGa1HqRBmpS/0nR4NY2KU72ogwBaLIq0dJ9cM2uqZb7EPmFwOF4p64wbYw57Y18o4 dzGw== X-Gm-Message-State: ABUngvdl44FcbbxmeE5vj8Cv9DNaR9AJK0WCLucNIeKX3/H9G08FXQNcgwIMXhxKjh5PNQ== X-Received: by 10.194.115.168 with SMTP id jp8mr323883wjb.27.1478708215955; Wed, 09 Nov 2016 08:16:55 -0800 (PST) Received: from sixbynine.org (82-132-216-223.dab.02.net. [82.132.216.223]) by smtp.gmail.com with ESMTPSA id k74sm1019249wmd.18.2016.11.09.08.16.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Nov 2016 08:16:55 -0800 (PST) From: Robert Bragg To: intel-gfx@lists.freedesktop.org Date: Wed, 9 Nov 2016 16:15:57 +0000 Message-Id: <20161109161602.2402-7-robert@sixbynine.org> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161109161602.2402-1-robert@sixbynine.org> References: <20161109161602.2402-1-robert@sixbynine.org> Subject: [Intel-gfx] [PATCH igt v3 06/11] igt/gem_exec_parse: make basic-rejected version agnostic 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 This adapts the basic-rejected test to focus on invalid commands that will result in an EINVAL errno being returned to userspace even with the upcoming version 8 parser change to stop reporting access violations as EINVAL errors. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- tests/gem_exec_parse.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index 368f30b..63f4efe 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -386,33 +386,39 @@ igt_main } igt_subtest("basic-rejected") { - uint32_t arb_on_off[] = { - MI_ARB_ON_OFF, + uint32_t invalid_cmd[] = { + (0x7<<29), /* Reserved command type, + across all engines */ MI_BATCH_BUFFER_END, }; - uint32_t display_flip[] = { - MI_DISPLAY_FLIP, - 0, 0, 0, + uint32_t invalid_set_context[] = { + MI_SET_CONTEXT | 32, /* invalid length */ MI_BATCH_BUFFER_END, - 0 }; exec_batch(fd, handle, - arb_on_off, sizeof(arb_on_off), + invalid_cmd, sizeof(invalid_cmd), I915_EXEC_RENDER, -EINVAL); exec_batch(fd, handle, - arb_on_off, sizeof(arb_on_off), + invalid_cmd, sizeof(invalid_cmd), I915_EXEC_BSD, -EINVAL); + if (gem_has_blt(fd)) { + exec_batch(fd, handle, + invalid_cmd, sizeof(invalid_cmd), + I915_EXEC_BLT, + -EINVAL); + } if (gem_has_vebox(fd)) { exec_batch(fd, handle, - arb_on_off, sizeof(arb_on_off), + invalid_cmd, sizeof(invalid_cmd), I915_EXEC_VEBOX, -EINVAL); } + exec_batch(fd, handle, - display_flip, sizeof(display_flip), - I915_EXEC_BLT, + invalid_set_context, sizeof(invalid_set_context), + I915_EXEC_RENDER, -EINVAL); }