From patchwork Mon Dec 2 07:53:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11268767 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1358109A for ; Mon, 2 Dec 2019 07:54:20 +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 D8EC02146E for ; Mon, 2 Dec 2019 07:54:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8EC02146E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0847289F97; Mon, 2 Dec 2019 07:54:19 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1420A89C6E; Mon, 2 Dec 2019 07:54:17 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2019 23:54:16 -0800 X-IronPort-AV: E=Sophos;i="5.69,268,1571727600"; d="scan'208";a="204460449" Received: from jkrzyszt-desk.igk.intel.com ([172.22.244.17]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2019 23:54:14 -0800 From: Janusz Krzysztofik To: Arkadiusz Hiler , Petri Latvala Date: Mon, 2 Dec 2019 08:53:51 +0100 Message-Id: <20191202075351.6518-1-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Intel-gfx] [RESEND PATCH i-g-t v3] tests/prime_vgem: Skip basic-read/write subtests if not supported X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, igt-dev@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" As we've agreed that using I915_GEM_PREAD/PWRITE IOCTLs on dma-buf objects doesn't make much sense, we are not going to extend their handlers in the i915 driver with new processing paths required for them to work correctly with dma-buf objects on future hardware with no mappable aperture. When running on that kind of hardware, just skip subtests which use those IOCTLs. v2: Examine pread/pwrite ABI, not mmap ABI (Chris) v3: Don't use "no mappable GGTT" wording in commit message (Chris) Signed-off-by: Janusz Krzysztofik Cc: Daniel Vetter Cc: Joonas Lahtinen Reviewed-by: Chris Wilson --- lib/ioctl_wrappers.c | 2 +- lib/ioctl_wrappers.h | 1 + tests/prime_vgem.c | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 628f8b83..78b92bd2 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -356,7 +356,7 @@ void gem_write(int fd, uint32_t handle, uint64_t offset, const void *buf, uint64 igt_assert_eq(__gem_write(fd, handle, offset, buf, length), 0); } -static int __gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length) +int __gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length) { struct drm_i915_gem_pread gem_pread; int err; diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h index f2412d78..97f278ed 100644 --- a/lib/ioctl_wrappers.h +++ b/lib/ioctl_wrappers.h @@ -69,6 +69,7 @@ uint32_t gem_open(int fd, uint32_t name); void gem_close(int fd, uint32_t handle); int __gem_write(int fd, uint32_t handle, uint64_t offset, const void *buf, uint64_t length); void gem_write(int fd, uint32_t handle, uint64_t offset, const void *buf, uint64_t length); +int __gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length); void gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length); int __gem_set_domain(int fd, uint32_t handle, uint32_t read, uint32_t write); void gem_set_domain(int fd, uint32_t handle, uint32_t read, uint32_t write); diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c index 04cc913d..6595818c 100644 --- a/tests/prime_vgem.c +++ b/tests/prime_vgem.c @@ -46,6 +46,8 @@ static void test_read(int vgem, int i915) handle = prime_fd_to_handle(i915, dmabuf); close(dmabuf); + igt_skip_on(__gem_read(i915, handle, 0, &i, sizeof(i))); + ptr = vgem_mmap(vgem, &scratch, PROT_WRITE); for (i = 0; i < 1024; i++) ptr[1024*i] = i; @@ -81,6 +83,8 @@ static void test_fence_read(int i915, int vgem) handle = prime_fd_to_handle(i915, dmabuf); close(dmabuf); + igt_skip_on(__gem_read(i915, handle, 0, &i, sizeof(i))); + igt_fork(child, 1) { close(master[0]); close(slave[1]); @@ -191,6 +195,8 @@ static void test_write(int vgem, int i915) handle = prime_fd_to_handle(i915, dmabuf); close(dmabuf); + igt_skip_on(__gem_write(i915, handle, 0, &i, sizeof(i))); + ptr = vgem_mmap(vgem, &scratch, PROT_READ); gem_close(vgem, scratch.handle);