Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org, Petri Latvala <petri.latvala@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 1/2] lib/intel_bufops: Add fixed mapping for reading ccs data
Date: Wed, 29 Dec 2021 13:39:01 -0800	[thread overview]
Message-ID: <87h7ar9jm2.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20211229114806.24218-2-zbigniew.kempczynski@intel.com>

On Wed, 29 Dec 2021 03:48:05 -0800, Zbigniew Kempczyński 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ński <zbigniew.kempczynski@intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Cc: Petri Latvala <petri.latvala@intel.com>
> ---
>  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 = CCS_SIZE(gen, buf);
>	size = offset + ccs_size;
>
> -	map = __gem_mmap_offset__wc(bops->fd, buf->handle, 0, size,
> -				    PROT_READ | PROT_WRITE);
> +	if (gem_has_lmem(bops->fd)) {
> +		map = 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 = gem_mmap__wc(bops->fd, buf->handle, 0, size,
> -				   PROT_READ | PROT_WRITE);
> +		map = __gem_mmap_offset__wc(bops->fd, buf->handle, 0, size,
> +					    PROT_READ | PROT_WRITE);
> +	if (!map)
> +		map = __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
>

  reply	other threads:[~2021-12-29 21:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-29 11:48 [igt-dev] [PATCH i-g-t 0/2] Bugfix series in bufops and allocator Zbigniew Kempczyński
2021-12-29 11:48 ` [igt-dev] [PATCH i-g-t 1/2] lib/intel_bufops: Add fixed mapping for reading ccs data Zbigniew Kempczyński
2021-12-29 21:39   ` Dixit, Ashutosh [this message]
2021-12-29 11:48 ` [igt-dev] [PATCH i-g-t 2/2] lib/intel_allocator: Fix invalid strategy on allocator helper code Zbigniew Kempczyński
2021-12-29 21:05   ` Dixit, Ashutosh
2021-12-29 12:43 ` [igt-dev] ✗ Fi.CI.BAT: failure for Bugfix series in bufops and allocator Patchwork
2021-12-29 15:12 ` [igt-dev] ✓ Fi.CI.BAT: success for Bugfix series in bufops and allocator (rev2) Patchwork
2021-12-29 16:44 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7ar9jm2.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    --cc=zbigniew.kempczynski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox