From patchwork Wed Oct 26 16:01:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Bragg X-Patchwork-Id: 9399051 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 9390B60231 for ; Thu, 27 Oct 2016 08:32:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 715472A0CB for ; Thu, 27 Oct 2016 08:32:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 666172A0CD; Thu, 27 Oct 2016 08:32:26 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 DCA042A0CB for ; Thu, 27 Oct 2016 08:32:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 890336EA52; Thu, 27 Oct 2016 08:31:22 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0326B6E8C8 for ; Wed, 26 Oct 2016 16:01:45 +0000 (UTC) Received: by mail-pf0-x242.google.com with SMTP id u84so2758059pfj.1 for ; Wed, 26 Oct 2016 09:01:45 -0700 (PDT) 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=mBFSQ9G/nGklMgJwdjZ9FuyhEN187lTD2e/d0qMWTuo=; b=qAW7GOWYq6Vkb2Z8rvLv1/zSELdOkMGcxrTvdNOGSm4eBSrkfRtjpVAhhmVIgTMeuD xN12UN/E0gqFiKPhlz42/GNbqZq9Hq+dA/kg57bkk6W3khH0bar5SMhkQRNZQ+MbqmId x7yE6OKZy+OyS0tESD3t7rzCcvtWv8AtRrFYUzhXiSO7v3adKLKLIkPccdAXIDhzVrxz lu0OqrN2V1+WozZ3Hm4/ZKiWKY0cCmjrFSOr0gXJ2gTeW4J7UGioBYme3UcQ3sa3gFiP hv+bGdD8lI0axBgH3aAjiNIzNzeaq3mgt/ssBQ6RenKFQQrJwp/qqui4efgPL660cDid moOQ== 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=mBFSQ9G/nGklMgJwdjZ9FuyhEN187lTD2e/d0qMWTuo=; b=dTlsKmgceBYthVFBJu01VQv7kFADTEhsFB0avUe+8twKY6cX77cctlK8MdMb2Je3Az +S//rjpo+A2dLgjFa+WCCYJSe3kIu3VNmv4tqChkPv8rmEkBIRrBwpucKU165hq1YLUs +nuv199FRPcUYV4wvLlOgmkIeS5G1ZMcPMWKXSm4HYdRjcpz8Eszu3idadOONkJlwvKH pTu4XG/Kueajb3zhqUnA+srOrOe7k86pj5rwj56ayAe+e+uUzmoSKmL0pw8DVeH7mzuL rrDiwbfQpZn3QahffMP0dTZ0vtPYG4EdQUvOLiADI/PCkDVcuq4IH7yxDlttbFtzl7o1 rBqg== X-Gm-Message-State: ABUngvfv+uyuATDJpj3R5ffxXfWMA1tp5djPidrkyu5KQiEO8a7cHZq2HG3p3LDYLfXPcA== X-Received: by 10.99.221.85 with SMTP id g21mr4476793pgj.121.1477497704447; Wed, 26 Oct 2016 09:01:44 -0700 (PDT) Received: from sixbynine.org ([192.198.151.62]) by smtp.gmail.com with ESMTPSA id u10sm5252552pau.32.2016.10.26.09.01.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Oct 2016 09:01:43 -0700 (PDT) From: Robert Bragg To: intel-gfx@lists.freedesktop.org Date: Wed, 26 Oct 2016 17:01:32 +0100 Message-Id: <20161026160133.6926-3-robert@sixbynine.org> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161026160133.6926-1-robert@sixbynine.org> References: <20161026160133.6926-1-robert@sixbynine.org> Subject: [Intel-gfx] [PATCH igt 2/3] igt/gem_exec_parse: remove oacontrol checks 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 The command parser no longer whitelists or does anything special for the OACONTROL register which is now considered owned by i915-perf. As a follow up the plan is to at least check that attempting to write to OACONTROL from userspace must not fail with an EINVAL error, otherwise Mesa's graceful fallback path for not being able to write to OACONTROL via LRI commands will cause Mesa applications to abort(). Signed-off-by: Robert Bragg --- tests/gem_exec_parse.c | 88 -------------------------------------------------- 1 file changed, 88 deletions(-) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index a39db3e..36bf57d 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -34,7 +34,6 @@ #define I915_PARAM_CMD_PARSER_VERSION 28 #endif -#define OACONTROL 0x2360 #define DERRMR 0x44050 static int command_parser_version(int fd) @@ -133,10 +132,6 @@ static void hsw_load_register_reg(void) gem_write(fd, obj[0].handle, 0, buf, execbuf.batch_len); igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); - buf[2] = OACONTROL; /* filtered */ - gem_write(fd, obj[0].handle, 0, buf, execbuf.batch_len); - igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); - buf[2] = DERRMR; /* master only */ gem_write(fd, obj[0].handle, 0, buf, execbuf.batch_len); igt_assert_eq(__gem_execbuf(fd, &execbuf), -EINVAL); @@ -385,29 +380,6 @@ static void exec_batch_chained(int fd, uint32_t cmd_bo, uint32_t *cmds, gem_close(fd, target_bo); } -static void stray_lri(int fd, uint32_t handle) -{ - /* Ideally this would test all once whitelisted registers */ - uint32_t lri[] = { - MI_LOAD_REGISTER_IMM, - OACONTROL, - 0x31337000, - MI_BATCH_BUFFER_END, - }; - int err; - - igt_assert_eq_u32(intel_register_read(OACONTROL), 0xdeadbeef); - - err = __exec_batch(fd, handle, lri, sizeof(lri), I915_EXEC_RENDER); - if (err == -EINVAL) - return; - - igt_assert_eq(err, 0); - gem_sync(fd, handle); - - igt_assert_eq_u32(intel_register_read(OACONTROL), 0xdeadbeef); -} - uint32_t handle; int fd; @@ -486,23 +458,6 @@ igt_main -EINVAL); } - igt_subtest_group { - igt_fixture { - intel_register_access_init(intel_get_pci_device(), 0); - - intel_register_write(OACONTROL, 0xdeadbeef); - igt_assert_eq_u32(intel_register_read(OACONTROL), 0xdeadbeef); - } - - igt_subtest("basic-stray-lri") - stray_lri(fd, handle); - - igt_fixture { - intel_register_write(OACONTROL, 0); - intel_register_access_fini(); - } - } - igt_subtest("registers") { uint32_t lri_bad[] = { MI_LOAD_REGISTER_IMM, @@ -563,49 +518,6 @@ igt_main 0); } - igt_subtest("oacontrol-tracking") { - uint32_t lri_ok[] = { - MI_LOAD_REGISTER_IMM, - OACONTROL, - 0x31337000, - MI_LOAD_REGISTER_IMM, - OACONTROL, - 0x0, - MI_BATCH_BUFFER_END, - 0 - }; - uint32_t lri_bad[] = { - MI_LOAD_REGISTER_IMM, - OACONTROL, - 0x31337000, - MI_BATCH_BUFFER_END, - }; - uint32_t lri_extra_bad[] = { - MI_LOAD_REGISTER_IMM, - OACONTROL, - 0x31337000, - MI_LOAD_REGISTER_IMM, - OACONTROL, - 0x0, - MI_LOAD_REGISTER_IMM, - OACONTROL, - 0x31337000, - MI_BATCH_BUFFER_END, - }; - exec_batch(fd, handle, - lri_ok, sizeof(lri_ok), - I915_EXEC_RENDER, - 0); - exec_batch(fd, handle, - lri_bad, sizeof(lri_bad), - I915_EXEC_RENDER, - -EINVAL); - exec_batch(fd, handle, - lri_extra_bad, sizeof(lri_extra_bad), - I915_EXEC_RENDER, - -EINVAL); - } - igt_subtest("chained-batch") { uint32_t pc[] = { GFX_OP_PIPE_CONTROL,