From: Matthew Auld <matthew.auld@intel.com>
To: Jagmeet Randhawa <jagmeet.randhawa@intel.com>
Cc: igt-dev@lists.freedesktop.org, oak.zeng@intel.com
Subject: Re: [PATCH i-g-t] tests/intel/xe_vm.c: Enforce explicit WB caching in bind-flag-invalid
Date: Wed, 24 Apr 2024 09:30:19 +0100 [thread overview]
Message-ID: <51acd02b-9353-434f-86fa-3a8bd581e40f@intel.com> (raw)
In-Reply-To: <bf76c34f97ed5e2ff935d4e8ff31c68dd13eb2d8.1713902821.git.jagmeet.randhawa@intel.com>
On 23/04/2024 21:16, Jagmeet Randhawa wrote:
> Update the bind-flag-invalid test by replacing xe_bo_create
> with xe_bo_create_caching, which introduces an additional
> parameter for setting the CPU caching mode explicitly.
> The cpu_caching parameter is now set to DRM_XE_GEM_CPU_CACHING_WB,
> aligning the buffer object's caching policy with the Write-Back (WB)
> memory type expected by intel_get_pat_idx_wb. Previously,
> xe_bo_create relied on a default cpu_caching that may or
> may not have been compatible with intel_get_pat_idx_wb.
>
> Suggested-by: Oak Zeng <oak.zeng@intel.com>
> Signed-off-by: Jagmeet Randhawa <jagmeet.randhawa@intel.com>
> ---
> tests/intel/xe_vm.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/intel/xe_vm.c b/tests/intel/xe_vm.c
> index 13cca2752..d40a6d76e 100644
> --- a/tests/intel/xe_vm.c
> +++ b/tests/intel/xe_vm.c
> @@ -1776,13 +1776,14 @@ static void bind_flag_invalid(int fd)
> uint32_t bo, bo_size = xe_get_default_alignment(fd);
> uint64_t addr = 0x1a0000;
> uint32_t vm;
> + uint16_t cpu_caching = DRM_XE_GEM_CPU_CACHING_WB;
> struct drm_xe_vm_bind bind;
> struct drm_xe_sync sync[1] = {
> { .type = DRM_XE_SYNC_TYPE_SYNCOBJ, .flags = DRM_XE_SYNC_FLAG_SIGNAL, },
> };
>
> vm = xe_vm_create(fd, 0, 0);
> - bo = xe_bo_create(fd, vm, bo_size, vram_if_possible(fd, 0), 0);
> + bo = xe_bo_create_caching(fd, vm, bo_size, vram_if_possible(fd, 0), 0, cpu_caching);
I think this will now blow up on dgpu, if using VRAM. WC for cpu_caching
is the only supported mode when mapping VRAM. I don't see anything wrong
with the existing code though. xe_bo_create() will already handle such
things for you, and intel_get_pat_idx_wb() is meant to be compatible
with most things (exception is maybe display).
> sync[0].handle = syncobj_create(fd, 0);
>
> memset(&bind, 0, sizeof(bind));
next prev parent reply other threads:[~2024-04-24 8:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-23 20:16 [PATCH i-g-t] tests/intel/xe_vm.c: Enforce explicit WB caching in bind-flag-invalid Jagmeet Randhawa
2024-04-23 21:09 ` ✗ Fi.CI.BAT: failure for " Patchwork
2024-04-23 21:21 ` ✓ CI.xeBAT: success " Patchwork
2024-04-24 8:30 ` Matthew Auld [this message]
2024-04-24 9:00 ` ✗ CI.xeFULL: 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=51acd02b-9353-434f-86fa-3a8bd581e40f@intel.com \
--to=matthew.auld@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jagmeet.randhawa@intel.com \
--cc=oak.zeng@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