Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
	intel-xe@lists.freedesktop.org
Cc: Matt Roper <matthew.d.roper@intel.com>
Subject: Re: [PATCH v4] drm/xe/xe2: Use XE_CACHE_WB pat index
Date: Fri, 19 Jan 2024 09:40:35 +0100	[thread overview]
Message-ID: <ab409085-30a1-4b62-a3b0-735ddb0b7a7e@linux.intel.com> (raw)
In-Reply-To: <20240119041826.1670496-1-himal.prasad.ghimiray@intel.com>


On 1/19/24 05:18, Himal Prasad Ghimiray wrote:
> The pat table entry associated with XE_CACHE_WB is coherent whereas
> XE_CACHE_NONE is non coherent. Migration expects the coherency
> with cpu therefore use the coherent entry XE_CACHE_WB for
> buffers not supporting compression. For read/write to flat ccs region
> the issue is not related to coherency with cpu. The hardware expects
> the pat index associated with GPUVA for indirect access to be
> compression enabled hence use XE_CACHE_NONE_COMPRESSION.
>
> v2
> - Fix the argument to emit_pte, pass the bool directly. (Thomas)
>
> v3
> - Rebase
> - Update commit message (Matt)
>
> v4
> - Add a Fixes: tag. (Thomas)
>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Fixes: 65ef8dbad1db ("drm/xe/xe2: Update emit_pte to use compression enabled PAT index")
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>

Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>


> ---
>   drivers/gpu/drm/xe/xe_migrate.c | 14 +++++++-------
>   1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
> index 44725f978f3e..5de8ee4245c3 100644
> --- a/drivers/gpu/drm/xe/xe_migrate.c
> +++ b/drivers/gpu/drm/xe/xe_migrate.c
> @@ -481,7 +481,7 @@ static void emit_pte(struct xe_migrate *m,
>   	/* Indirect access needs compression enabled uncached PAT index */
>   	if (GRAPHICS_VERx100(xe) >= 2000)
>   		pat_index = is_comp_pte ? xe->pat.idx[XE_CACHE_NONE_COMPRESSION] :
> -					  xe->pat.idx[XE_CACHE_NONE];
> +					  xe->pat.idx[XE_CACHE_WB];
>   	else
>   		pat_index = xe->pat.idx[XE_CACHE_WB];
>   
> @@ -769,14 +769,14 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
>   		if (src_is_vram && xe_migrate_allow_identity(src_L0, &src_it))
>   			xe_res_next(&src_it, src_L0);
>   		else
> -			emit_pte(m, bb, src_L0_pt, src_is_vram, true, &src_it, src_L0,
> -				 src);
> +			emit_pte(m, bb, src_L0_pt, src_is_vram, copy_system_ccs,
> +				 &src_it, src_L0, src);
>   
>   		if (dst_is_vram && xe_migrate_allow_identity(src_L0, &dst_it))
>   			xe_res_next(&dst_it, src_L0);
>   		else
> -			emit_pte(m, bb, dst_L0_pt, dst_is_vram, true, &dst_it, src_L0,
> -				 dst);
> +			emit_pte(m, bb, dst_L0_pt, dst_is_vram, copy_system_ccs,
> +				 &dst_it, src_L0, dst);
>   
>   		if (copy_system_ccs)
>   			emit_pte(m, bb, ccs_pt, false, false, &ccs_it, ccs_size, src);
> @@ -1018,8 +1018,8 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m,
>   		if (clear_vram && xe_migrate_allow_identity(clear_L0, &src_it))
>   			xe_res_next(&src_it, clear_L0);
>   		else
> -			emit_pte(m, bb, clear_L0_pt, clear_vram, true, &src_it, clear_L0,
> -				 dst);
> +			emit_pte(m, bb, clear_L0_pt, clear_vram, clear_system_ccs,
> +				 &src_it, clear_L0, dst);
>   
>   		bb->cs[bb->len++] = MI_BATCH_BUFFER_END;
>   		update_idx = bb->len;

      parent reply	other threads:[~2024-01-19  8:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19  4:18 [PATCH v4] drm/xe/xe2: Use XE_CACHE_WB pat index Himal Prasad Ghimiray
2024-01-19  4:10 ` ✓ CI.Patch_applied: success for drm/xe/xe2: Use XE_CACHE_WB pat index (rev4) Patchwork
2024-01-19  4:10 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-19  4:11 ` ✓ CI.KUnit: success " Patchwork
2024-01-19  4:18 ` ✓ CI.Build: " Patchwork
2024-01-19  4:18 ` ✓ CI.Hooks: " Patchwork
2024-01-19  4:19 ` ✓ CI.checksparse: " Patchwork
2024-01-19  4:44 ` ✓ CI.BAT: " Patchwork
2024-01-19  8:40 ` Thomas Hellström [this message]

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=ab409085-30a1-4b62-a3b0-735ddb0b7a7e@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@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