From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8C2A6E46D for ; Sat, 1 Feb 2020 06:27:43 +0000 (UTC) Date: Fri, 31 Jan 2020 22:27:42 -0800 Message-ID: <8736bu6cv5.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20200131173109.12527-4-ramalingam.c@intel.com> References: <20200131173109.12527-1-ramalingam.c@intel.com> <20200131173109.12527-4-ramalingam.c@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Subject: Re: [igt-dev] [PATCH i-g-t 3/9] tests/prime_mmap_coherency: use device coherent mapping instead of mmap_gtt 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: Ramalingam C Cc: igt-dev List-ID: On Fri, 31 Jan 2020 09:31:03 -0800, Ramalingam C wrote: > > Since on new discrete GPUs we dont have the mappable aperture, if that > is acceptable for the test purpose, we should use GEM_MMAP_OFFSET. > Hence using gem_mmap_device_coherent() which wraps the mmap options in > the order of gem_mmap_offset / gem_mmap / mmap_gtt > > Signed-off-by: Ramalingam C > --- > tests/prime_mmap_coherency.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/prime_mmap_coherency.c b/tests/prime_mmap_coherency.c > index 39538767c68f..32d78ee1a771 100644 > --- a/tests/prime_mmap_coherency.c > +++ b/tests/prime_mmap_coherency.c > @@ -69,7 +69,7 @@ static int test_read_flush(void) > > /* STEP #3: write 0x11 into BO 1. */ > bo_2 = drm_intel_bo_alloc(bufmgr, "BO 2", width * height * 4, 4096); > - ptr_gtt = gem_mmap__gtt(fd, bo_2->handle, width * height, PROT_READ | PROT_WRITE); > + ptr_gtt = gem_mmap__device_coherent(fd, bo_2->handle, 0, width * height, PROT_READ | PROT_WRITE); > gem_set_domain(fd, bo_2->handle, > I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); > memset(ptr_gtt, 0xc5, width * height); I think the patch is ok but did you check if the test passes/fails on devices with/without a mappable aperture? I sort of expect it to always fail, at least with WC, but not sure if it ever passes with the GTT mapping (since we haven't done a clflush). _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev