Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: Dominik Grzegorzek <dominik.grzegorzek@intel.com>,
	igt-dev@lists.freedesktop.org
Cc: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Subject: Re: [PATCH i-g-t] lib/intel_bufops: Set NEEDS_VISIBLE_VRAM for each buf by default
Date: Fri, 6 Dec 2024 12:15:47 +0000	[thread overview]
Message-ID: <e63f049f-5224-45ae-96c3-3e1aa8a46077@intel.com> (raw)
In-Reply-To: <20241205104134.22790-1-dominik.grzegorzek@intel.com>

On 05/12/2024 10:41, Dominik Grzegorzek wrote:
> Some tests (i.e. xe_eudebug_online, xe_exec_sip) are mapping intel_buf.
> If the backing storage is nvram, any access to mmaped buffer may
> cause segmentation fault. Set DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM
> by default as intel_bufs might be mapped and this is not harmful.

There is the downside that all objects will now be limited to BAR size 
when using this API. i.e you might have 16G VRAM but only 256M BAR. But 
I guess user can always pass in their own handle if they need something 
more special, so NEEDS_VISIBLE_VRAM is probably a sensible default and 
most tests probably don't care about the limit? Ideally the API would 
have an option to hint that CPU access is something they actually need.

Also: https://patchwork.freedesktop.org/series/141710/

> 
> Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>

> ---
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> 
>   lib/intel_bufops.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/intel_bufops.c b/lib/intel_bufops.c
> index 619222019..49b91a171 100644
> --- a/lib/intel_bufops.c
> +++ b/lib/intel_bufops.c
> @@ -1021,7 +1021,8 @@ static void __intel_buf_init(struct buf_ops *bops,
>   				cpu_caching = DRM_XE_GEM_CPU_CACHING_WC;
>   
>   			bo_size = ALIGN(bo_size, xe_get_default_alignment(bops->fd));
> -			buf->handle = xe_bo_create_caching(bops->fd, 0, bo_size, region, 0,
> +			buf->handle = xe_bo_create_caching(bops->fd, 0, bo_size, region,
> +							   DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM,
>   							   cpu_caching);
>   		}
>   	}


  parent reply	other threads:[~2024-12-06 12:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-05 10:41 [PATCH i-g-t] lib/intel_bufops: Set NEEDS_VISIBLE_VRAM for each buf by default Dominik Grzegorzek
2024-12-06  1:31 ` ✗ Xe.CI.BAT: failure for " Patchwork
2024-12-06  1:44 ` ✓ i915.CI.BAT: success " Patchwork
2024-12-06  3:06 ` ✗ i915.CI.Full: failure " Patchwork
2024-12-06  4:06 ` ✗ Xe.CI.Full: " Patchwork
2024-12-06 12:15 ` Matthew Auld [this message]
2024-12-10 18:23 ` ✗ i915.CI.BAT: failure for lib/intel_bufops: Set NEEDS_VISIBLE_VRAM for each buf by default (rev2) Patchwork
2024-12-11  9:24   ` Grzegorzek, Dominik
2024-12-10 20:12 ` ✓ Xe.CI.BAT: success " Patchwork
2024-12-10 22:22 ` ✗ Xe.CI.Full: failure " Patchwork
2024-12-11  9:26   ` Grzegorzek, Dominik

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=e63f049f-5224-45ae-96c3-3e1aa8a46077@intel.com \
    --to=matthew.auld@intel.com \
    --cc=dominik.grzegorzek@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --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