From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A890882C2 for ; Wed, 29 Dec 2021 21:39:15 +0000 (UTC) Date: Wed, 29 Dec 2021 13:39:01 -0800 Message-ID: <87h7ar9jm2.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20211229114806.24218-2-zbigniew.kempczynski@intel.com> References: <20211229114806.24218-1-zbigniew.kempczynski@intel.com> <20211229114806.24218-2-zbigniew.kempczynski@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Subject: Re: [igt-dev] [PATCH i-g-t 1/2] lib/intel_bufops: Add fixed mapping for reading ccs data List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Zbigniew =?ISO-8859-2?Q?Kempczy=F1ski?= Cc: igt-dev@lists.freedesktop.org, Petri Latvala List-ID: On Wed, 29 Dec 2021 03:48:05 -0800, Zbigniew Kempczy=F1ski wrote: > > On discrete gem_mmap_offset__fixed() function must be used to map > local memory. WC will also work, though FIXED will be more efficient for smem-only buffers which will be mapped WB. > Add this case for copying of ccs data and fix all *ccs* subtests in > gem_render_copy test. > > Signed-off-by: Zbigniew Kempczy=F1ski > Cc: Ashutosh Dixit > Cc: Petri Latvala > --- > lib/intel_bufops.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/lib/intel_bufops.c b/lib/intel_bufops.c > index f13063fa9..72d729b63 100644 > --- a/lib/intel_bufops.c > +++ b/lib/intel_bufops.c > @@ -399,11 +399,17 @@ static void __copy_ccs(struct buf_ops *bops, struct= intel_buf *buf, > ccs_size =3D CCS_SIZE(gen, buf); > size =3D offset + ccs_size; > > - map =3D __gem_mmap_offset__wc(bops->fd, buf->handle, 0, size, > - PROT_READ | PROT_WRITE); > + if (gem_has_lmem(bops->fd)) { > + map =3D gem_mmap_offset__fixed(bops->fd, buf->handle, 0, size, > + PROT_READ | PROT_WRITE); > + } Not sure but maybe gem_has_lmem() check can be skipped and we use __gem_mmap_offset__fixed() (see __gem_mmap__device_coherent())? > if (!map) > - map =3D gem_mmap__wc(bops->fd, buf->handle, 0, size, > - PROT_READ | PROT_WRITE); > + map =3D __gem_mmap_offset__wc(bops->fd, buf->handle, 0, size, > + PROT_READ | PROT_WRITE); > + if (!map) > + map =3D __gem_mmap__wc(bops->fd, buf->handle, 0, size, This should be gem_mmap__wc not __gem_mmap__wc (need to assert at the end). Though I am not sure why CI is failing for this patch. > + PROT_READ | PROT_WRITE); > + > > switch (dir) { > case CCS_LINEAR_TO_BUF: > -- > 2.32.0 >