From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Christian Koenig <christian.koenig@amd.com>,
dri-devel@lists.freedesktop.org
Subject: [Intel-xe] [PATCH 3/3] drm/ttm: Use a define for the resv wait timeout
Date: Thu, 25 May 2023 17:02:05 +0200 [thread overview]
Message-ID: <20230525150205.194098-4-thomas.hellstrom@linux.intel.com> (raw)
In-Reply-To: <20230525150205.194098-1-thomas.hellstrom@linux.intel.com>
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 --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))
--
2.39.2
next prev parent reply other threads:[~2023-05-25 15:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-25 15:02 [Intel-xe] [PATCH 0/3] drm/ttm: Reservation object individualization update Thomas Hellström
2023-05-25 15:02 ` [Intel-xe] [PATCH 1/3] drm/ttm: Clear the buffer object bulk move at individualize time Thomas Hellström
2023-06-01 10:38 ` Christian König
2023-05-25 15:02 ` [Intel-xe] [PATCH 2/3] drm/ttm: Clean up bo individualizing somewhat Thomas Hellström
2023-05-25 15:02 ` Thomas Hellström [this message]
2023-05-25 15:04 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/ttm: Reservation object individualization update Patchwork
2023-05-25 15:06 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-05-25 15:10 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-05-25 15:39 ` [Intel-xe] ○ CI.BAT: info " Patchwork
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=20230525150205.194098-4-thomas.hellstrom@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox