Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Francois Dugast <francois.dugast@intel.com>
To: Maarten Lankhorst <dev@lankhorst.se>
Cc: <intel-xe@lists.freedesktop.org>, Jocelyn Falempe <jfalempe@redhat.com>
Subject: Re: [PATCH 1/2] drm/xe: Extract xe_bo_is_visible_vram
Date: Mon, 7 Jul 2025 14:12:07 +0200	[thread overview]
Message-ID: <aGu5lwW3H2D9RqeP@fdugast-desk> (raw)
In-Reply-To: <20250627151307.23001-5-dev@lankhorst.se>

On Fri, Jun 27, 2025 at 05:13:09PM +0200, Maarten Lankhorst wrote:
> This will make it possible to call from xe_display code.
> 
> Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>

Reviewed-by: Francois Dugast <francois.dugast@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_bo.c | 10 +++++++++-
>  drivers/gpu/drm/xe/xe_bo.h |  1 +
>  2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index 4e39188a021ab..af312bc70d0fe 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -557,6 +557,14 @@ static bool xe_ttm_resource_visible(struct ttm_resource *mem)
>  	return vres->used_visible_size == mem->size;
>  }
>  
> +bool xe_bo_is_visible_vram(struct xe_bo *bo)
> +{
> +	if (drm_WARN_ON(bo->ttm.base.dev, !xe_bo_is_vram(bo)))
> +		return false;
> +
> +	return xe_ttm_resource_visible(bo->ttm.resource);
> +}
> +
>  static int xe_ttm_io_mem_reserve(struct ttm_device *bdev,
>  				 struct ttm_resource *mem)
>  {
> @@ -1547,7 +1555,7 @@ static int xe_ttm_access_memory(struct ttm_buffer_object *ttm_bo,
>  	if (!mem_type_is_vram(ttm_bo->resource->mem_type))
>  		return -EIO;
>  
> -	if (!xe_ttm_resource_visible(ttm_bo->resource) || len >= SZ_16K) {
> +	if (!xe_bo_is_visible_vram(bo) || len >= SZ_16K) {
>  		struct xe_migrate *migrate =
>  			mem_type_to_migrate(xe, ttm_bo->resource->mem_type);
>  
> diff --git a/drivers/gpu/drm/xe/xe_bo.h b/drivers/gpu/drm/xe/xe_bo.h
> index 02ada1fb8a235..460cfc309eec2 100644
> --- a/drivers/gpu/drm/xe/xe_bo.h
> +++ b/drivers/gpu/drm/xe/xe_bo.h
> @@ -265,6 +265,7 @@ int xe_bo_read(struct xe_bo *bo, u64 offset, void *dst, int size);
>  
>  bool mem_type_is_vram(u32 mem_type);
>  bool xe_bo_is_vram(struct xe_bo *bo);
> +bool xe_bo_is_visible_vram(struct xe_bo *bo);
>  bool xe_bo_is_stolen(struct xe_bo *bo);
>  bool xe_bo_is_stolen_devmem(struct xe_bo *bo);
>  bool xe_bo_is_vm_bound(struct xe_bo *bo);
> -- 
> 2.45.2
> 

  reply	other threads:[~2025-07-07 12:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-27 15:13 [PATCH 0/2] drm/xe/display: Make panic support work on vram Maarten Lankhorst
2025-06-27 15:13 ` [PATCH 1/2] drm/xe: Extract xe_bo_is_visible_vram Maarten Lankhorst
2025-07-07 12:12   ` Francois Dugast [this message]
2025-07-07 16:19   ` Matthew Brost
2025-06-27 15:13 ` [PATCH 2/2] drm/xe/display: Make panic support work on vram Maarten Lankhorst
2025-06-27 15:38   ` Jocelyn Falempe
2025-06-30 17:16 ` ✓ CI.KUnit: success for " Patchwork
2025-06-30 18:02 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-01 21:22 ` ✗ Xe.CI.Full: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-07-31 15:26 [PATCH v2 0/2] " Maarten Lankhorst
2025-07-31 15:26 ` [PATCH 1/2] drm/xe: Extract xe_bo_is_visible_vram Maarten Lankhorst

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=aGu5lwW3H2D9RqeP@fdugast-desk \
    --to=francois.dugast@intel.com \
    --cc=dev@lankhorst.se \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jfalempe@redhat.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