From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E49BBC4338F for ; Wed, 28 Jul 2021 10:32:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A961E60FC0 for ; Wed, 28 Jul 2021 10:32:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A961E60FC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D15E6E896; Wed, 28 Jul 2021 10:32:00 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84CF46E83F; Wed, 28 Jul 2021 10:31:57 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10058"; a="212627103" X-IronPort-AV: E=Sophos;i="5.84,276,1620716400"; d="scan'208";a="212627103" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2021 03:31:56 -0700 X-IronPort-AV: E=Sophos;i="5.84,276,1620716400"; d="scan'208";a="499179444" Received: from sdrogers-mobl.ger.corp.intel.com (HELO mwauld-desk1.intel.com) ([10.213.245.248]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2021 03:31:53 -0700 From: Matthew Auld To: igt-dev@lists.freedesktop.org Date: Wed, 28 Jul 2021 11:30:36 +0100 Message-Id: <20210728103041.1669985-6-matthew.auld@intel.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210728103041.1669985-1-matthew.auld@intel.com> References: <20210728103041.1669985-1-matthew.auld@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t v2 06/11] lib/ioctl_wrappers: update mmap_{read, write} for discrete X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" We can no longer just call get_caching or set_domain, and the mmap mode must be FIXED. This should bring back gem_exec_basic and a few others in CI on DG1. Signed-off-by: Matthew Auld Cc: Maarten Lankhorst Cc: Ashutosh Dixit Cc: Daniel Vetter Cc: Ramalingam C --- lib/ioctl_wrappers.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 25c5e495..7e27a1b3 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -339,7 +339,18 @@ static void mmap_write(int fd, uint32_t handle, uint64_t offset, if (!length) return; - if (is_cache_coherent(fd, handle)) { + if (gem_has_lmem(fd)) { + /* + * set/get_caching and set_domain are no longer supported on + * discrete, also the only mmap mode supportd is FIXED. + */ + map = gem_mmap_offset__fixed(fd, handle, 0, + offset + length, + PROT_READ | PROT_WRITE); + igt_assert_eq(gem_wait(fd, handle, 0), 0); + } + + if (!map && is_cache_coherent(fd, handle)) { /* offset arg for mmap functions must be 0 */ map = __gem_mmap__cpu_coherent(fd, handle, 0, offset + length, PROT_READ | PROT_WRITE); @@ -369,7 +380,17 @@ static void mmap_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint6 if (!length) return; - if (gem_has_llc(fd) || is_cache_coherent(fd, handle)) { + if (gem_has_lmem(fd)) { + /* + * set/get_caching and set_domain are no longer supported on + * discrete, also the only supported mmap mode is FIXED. + */ + map = gem_mmap_offset__fixed(fd, handle, 0, + offset + length, PROT_READ); + igt_assert_eq(gem_wait(fd, handle, 0), 0); + } + + if (!map && (gem_has_llc(fd) || is_cache_coherent(fd, handle))) { /* offset arg for mmap functions must be 0 */ map = __gem_mmap__cpu_coherent(fd, handle, 0, offset + length, PROT_READ); -- 2.26.3 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Matthew Auld Date: Wed, 28 Jul 2021 11:30:36 +0100 Message-Id: <20210728103041.1669985-6-matthew.auld@intel.com> In-Reply-To: <20210728103041.1669985-1-matthew.auld@intel.com> References: <20210728103041.1669985-1-matthew.auld@intel.com> MIME-Version: 1.0 Subject: [igt-dev] [PATCH i-g-t v2 06/11] lib/ioctl_wrappers: update mmap_{read, write} for discrete List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org List-ID: We can no longer just call get_caching or set_domain, and the mmap mode must be FIXED. This should bring back gem_exec_basic and a few others in CI on DG1. Signed-off-by: Matthew Auld Cc: Maarten Lankhorst Cc: Ashutosh Dixit Cc: Daniel Vetter Cc: Ramalingam C --- lib/ioctl_wrappers.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 25c5e495..7e27a1b3 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -339,7 +339,18 @@ static void mmap_write(int fd, uint32_t handle, uint64_t offset, if (!length) return; - if (is_cache_coherent(fd, handle)) { + if (gem_has_lmem(fd)) { + /* + * set/get_caching and set_domain are no longer supported on + * discrete, also the only mmap mode supportd is FIXED. + */ + map = gem_mmap_offset__fixed(fd, handle, 0, + offset + length, + PROT_READ | PROT_WRITE); + igt_assert_eq(gem_wait(fd, handle, 0), 0); + } + + if (!map && is_cache_coherent(fd, handle)) { /* offset arg for mmap functions must be 0 */ map = __gem_mmap__cpu_coherent(fd, handle, 0, offset + length, PROT_READ | PROT_WRITE); @@ -369,7 +380,17 @@ static void mmap_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint6 if (!length) return; - if (gem_has_llc(fd) || is_cache_coherent(fd, handle)) { + if (gem_has_lmem(fd)) { + /* + * set/get_caching and set_domain are no longer supported on + * discrete, also the only supported mmap mode is FIXED. + */ + map = gem_mmap_offset__fixed(fd, handle, 0, + offset + length, PROT_READ); + igt_assert_eq(gem_wait(fd, handle, 0), 0); + } + + if (!map && (gem_has_llc(fd) || is_cache_coherent(fd, handle))) { /* offset arg for mmap functions must be 0 */ map = __gem_mmap__cpu_coherent(fd, handle, 0, offset + length, PROT_READ); -- 2.26.3 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev