All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	nouveau@lists.freedesktop.org, jani.nikula@linux.intel.com,
	kherbst@redhat.com, lyude@redhat.com, zackr@vmware.com,
	michel.daenzer@mailbox.org
Subject: Re: [PATCH 2/5] drm/ttm: return ENOSPC from ttm_bo_mem_space
Date: Wed, 17 Jan 2024 11:18:28 +0100	[thread overview]
Message-ID: <07a6552a-19e7-404d-8711-aff0cea8a36c@linux.intel.com> (raw)
In-Reply-To: <20240112125158.2748-3-christian.koenig@amd.com>

Hi,

On 1/12/24 13:51, Christian König wrote:
> Only convert it to ENOMEM in ttm_bo_validate.
>
> This allows ttm_bo_validate to distinct between an out of memory
NIT: s/distinct/distinguish/
> situation and just out of space in a placement domain.

In fact it would be nice if this could be propagated back to drivers as 
well at some point, but then perhaps guarded with a flag in the 
operation context.

In any case

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

>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index edf10618fe2b..8c1eaa74fa21 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -830,7 +830,7 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
>   			goto error;
>   	}
>   
> -	ret = -ENOMEM;
> +	ret = -ENOSPC;
>   	if (!type_found) {
>   		pr_err(TTM_PFX "No compatible memory type found\n");
>   		ret = -EINVAL;
> @@ -916,6 +916,9 @@ int ttm_bo_validate(struct ttm_buffer_object *bo,
>   		return -EINVAL;
>   
>   	ret = ttm_bo_move_buffer(bo, placement, ctx);
> +	/* For backward compatibility with userspace */
> +	if (ret == -ENOSPC)
> +		return -ENOMEM;
>   	if (ret)
>   		return ret;
>   

  reply	other threads:[~2024-01-17 10:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 12:51 Rework TTMs busy handling Christian König
2024-01-12 12:51 ` [PATCH 1/5] drm/vmwgfx: remove vmw_vram_gmr_placement Christian König
2024-01-12 12:51 ` [PATCH 2/5] drm/ttm: return ENOSPC from ttm_bo_mem_space Christian König
2024-01-17 10:18   ` Thomas Hellström [this message]
2024-01-12 12:51 ` [PATCH 3/5] drm/ttm: replace busy placement with flags v6 Christian König
2024-01-17  8:01   ` Thomas Zimmermann
2024-01-17 10:47   ` Thomas Hellström
2024-01-17 12:27     ` Thomas Hellström
2024-01-18 16:38       ` Thomas Hellström
2024-01-26 22:16         ` Lucas De Marchi
2024-01-26 22:16           ` Lucas De Marchi
2024-01-26 22:22           ` Lucas De Marchi
2024-01-26 22:22             ` Lucas De Marchi
2024-01-27 15:43             ` Zeng, Oak
2024-01-27 15:43               ` Zeng, Oak
2024-01-29 11:00             ` Thomas Hellström
2024-01-29 11:00               ` Thomas Hellström
2024-01-12 12:51 ` [PATCH 4/5] drm/ttm: improve idle/busy handling v3 Christian König
2024-01-18 14:24   ` Thomas Hellström
2024-01-18 16:48     ` Thomas Hellström
2024-01-12 12:51 ` [PATCH 5/5] drm/amdgpu: use GTT only as fallback for VRAM|GTT Christian König
2024-01-12 14:04 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] drm/vmwgfx: remove vmw_vram_gmr_placement Patchwork
2024-01-12 14:04 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-01-12 14:22 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-01-16  9:57 ` Rework TTMs busy handling Christian König
2024-01-17  3:13   ` Zack Rusin
2024-01-17  3:13     ` Zack Rusin
  -- strict thread matches above, loose matches on Subject: below --
2024-01-09  7:47 Christian König
2024-01-09  7:47 ` [PATCH 2/5] drm/ttm: return ENOSPC from ttm_bo_mem_space Christian König
2024-01-09  9:17   ` Thomas Hellström

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=07a6552a-19e7-404d-8711-aff0cea8a36c@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=kherbst@redhat.com \
    --cc=lyude@redhat.com \
    --cc=michel.daenzer@mailbox.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=zackr@vmware.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 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.