diff mbox series

[3/3] drm/ttm: Use a define for the resv wait timeout

Message ID 20230525150205.194098-4-thomas.hellstrom@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/ttm: Reservation object individualization update | expand

Commit Message

Thomas Hellstrom May 25, 2023, 3:02 p.m. UTC
Rather than coding different delays here and there, use a define for the
resv timeout delay.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 84a512538e45..bacaed78ae55 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -31,6 +31,9 @@ 
 
 #define pr_fmt(fmt) "[TTM] " fmt
 
+/* The "Reasonable fence signal time" used by TTM. */
+#define TTM_RESV_TIMEOUT (30 * HZ)
+
 #include <drm/ttm/ttm_bo.h>
 #include <drm/ttm/ttm_placement.h>
 #include <drm/ttm/ttm_tt.h>
@@ -197,7 +200,7 @@  static void ttm_bo_individualize_resv(struct ttm_buffer_object *bo)
 		/* Last resort if memory allocation failed for fence copying */
 		dma_resv_wait_timeout(bo->base.resv,
 				      DMA_RESV_USAGE_BOOKKEEP, false,
-				      30 * HZ);
+				      TTM_RESV_TIMEOUT);
 		if (locked)
 			dma_resv_unlock(bo->base.resv);
 	}
@@ -276,7 +279,7 @@  static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo,
 
 		lret = dma_resv_wait_timeout(resv, DMA_RESV_USAGE_BOOKKEEP,
 					     interruptible,
-					     30 * HZ);
+					     TTM_RESV_TIMEOUT);
 
 		if (lret < 0)
 			return lret;
@@ -1113,7 +1116,7 @@  int ttm_bo_wait_ctx(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx)
 	}
 
 	ret = dma_resv_wait_timeout(bo->base.resv, DMA_RESV_USAGE_BOOKKEEP,
-				    ctx->interruptible, 15 * HZ);
+				    ctx->interruptible, TTM_RESV_TIMEOUT);
 	if (unlikely(ret < 0))
 		return ret;
 	if (unlikely(ret == 0))