All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Dave Airlie <airlied@gmail.com>, dri-devel@lists.freedesktop.org
Cc: Dave Airlie <airlied@redhat.com>
Subject: Re: [PATCH 4/4] xe: populate buffers before exporting them.
Date: Thu, 04 Sep 2025 09:26:30 +0200	[thread overview]
Message-ID: <4a929eba67199b3fbf92bf3232c64fec444fc3cf.camel@linux.intel.com> (raw)
In-Reply-To: <20250904021643.2050497-4-airlied@gmail.com>

On Thu, 2025-09-04 at 12:16 +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> 
> Before exporting a buffer, make sure it has been populated with
> pages at least once.
> 
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Signed-off-by: Dave Airlie <airlied@redhat.com>

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

> ---
>  drivers/gpu/drm/xe/xe_dma_buf.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_dma_buf.c
> b/drivers/gpu/drm/xe/xe_dma_buf.c
> index 346f857f3837..71b70e17bddd 100644
> --- a/drivers/gpu/drm/xe/xe_dma_buf.c
> +++ b/drivers/gpu/drm/xe/xe_dma_buf.c
> @@ -191,10 +191,22 @@ struct dma_buf *xe_gem_prime_export(struct
> drm_gem_object *obj, int flags)
>  {
>  	struct xe_bo *bo = gem_to_xe_bo(obj);
>  	struct dma_buf *buf;
> +	struct ttm_operation_ctx ctx = {
> +		.interruptible = true,
> +		.no_wait_gpu = true,
> +		/* We opt to avoid OOM on system pages allocations
> */
> +		.gfp_retry_mayfail = true,
> +		.allow_res_evict = false,
> +	};
> +	int ret;
>  
>  	if (bo->vm)
>  		return ERR_PTR(-EPERM);
>  
> +	ret = ttm_bo_setup_export(&bo->ttm, &ctx);
> +	if (ret)
> +		return ERR_PTR(ret);
> +
>  	buf = drm_gem_prime_export(obj, flags);
>  	if (!IS_ERR(buf))
>  		buf->ops = &xe_dmabuf_ops;


  reply	other threads:[~2025-09-04  7:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04  2:16 [PATCH 1/4] ttm/bo: add an API to populate a bo before exporting Dave Airlie
2025-09-04  2:16 ` [PATCH 2/4] amdgpu: populate buffers before exporting them Dave Airlie
2025-09-04  2:16 ` [PATCH 3/4] nouveau: " Dave Airlie
2025-09-09  7:33   ` Danilo Krummrich
2025-09-04  2:16 ` [PATCH 4/4] xe: " Dave Airlie
2025-09-04  7:26   ` Thomas Hellström [this message]
2025-09-04  7:20 ` [PATCH 1/4] ttm/bo: add an API to populate a bo before exporting Thomas Hellström
2025-09-04 11:13 ` Christian König
2025-09-09  7:31 ` Danilo Krummrich
2025-09-09  7:39   ` David Airlie

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=4a929eba67199b3fbf92bf3232c64fec444fc3cf.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.