Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/ttm: return ENOSPC from ttm_bo_mem_space
@ 2023-12-13 14:42 Christian König
  2023-12-13 14:42 ` [PATCH 2/4] drm/ttm: replace busy placement with flags v3 Christian König
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Christian König @ 2023-12-13 14:42 UTC (permalink / raw)
  To: dri-devel, intel-gfx

Only convert it to ENOMEM in ttm_bo_validate.

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;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [PATCH 1/4] drm/ttm: return ENOSPC from ttm_bo_mem_space
@ 2024-01-04 15:02 Christian König
  0 siblings, 0 replies; 13+ messages in thread
From: Christian König @ 2024-01-04 15:02 UTC (permalink / raw)
  To: dri-devel, intel-gfx, thomas.hellstrom, nouveau, jani.nikula,
	kherbst, lyude, zackr

Only convert it to ENOMEM in ttm_bo_validate.

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;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread
* Rework TTMs busy handling
@ 2024-01-04 15:05 Christian König
  2024-01-04 15:05 ` [PATCH 1/4] drm/ttm: return ENOSPC from ttm_bo_mem_space Christian König
  0 siblings, 1 reply; 13+ messages in thread
From: Christian König @ 2024-01-04 15:05 UTC (permalink / raw)
  To: dri-devel, intel-gfx, thomas.hellstrom, nouveau, jani.nikula,
	kherbst, lyude, zackr

Hi guys,

I'm trying to make this functionality a bit more useful for years now
since we multiple reports that behavior of drivers can be suboptimal
when multiple placements be given.

So basically instead of hacking around the TTM behavior in the driver
once more I've gone ahead and changed the idle/busy placement list
into idle/busy placement flags. This not only saves a bunch of code,
but also allows setting some placements as fallback which are used if
allocating from the preferred ones didn't worked.

Intel CI seems to be happy with those patches, so any more comments?

Regards,
Christian.



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-01-04 15:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-13 14:42 [PATCH 1/4] drm/ttm: return ENOSPC from ttm_bo_mem_space Christian König
2023-12-13 14:42 ` [PATCH 2/4] drm/ttm: replace busy placement with flags v3 Christian König
2023-12-13 14:42 ` [PATCH 3/4] drm/ttm: improve idle/busy handling Christian König
2023-12-14  8:30   ` kernel test robot
2023-12-16  0:44   ` kernel test robot
2023-12-13 14:42 ` [PATCH 4/4] drm/amdgpu: use GTT only as fallback for VRAM|GTT Christian König
2023-12-13 14:50 ` [PATCH 1/4] drm/ttm: return ENOSPC from ttm_bo_mem_space Christian König
2023-12-13 21:24 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] " Patchwork
2023-12-13 21:24 ` ✗ Fi.CI.SPARSE: " Patchwork
2023-12-13 21:47 ` ✓ Fi.CI.BAT: success " Patchwork
2023-12-13 22:42 ` ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-01-04 15:02 [PATCH 1/4] " Christian König
2024-01-04 15:05 Rework TTMs busy handling Christian König
2024-01-04 15:05 ` [PATCH 1/4] drm/ttm: return ENOSPC from ttm_bo_mem_space Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox