Skip to content

Commit 54d4e9f

Browse files
tursulindanvet
authored andcommitted
drm/i915: Allow configuring default request expiry via modparam
Module parameter is added (request_timeout_ms) to allow configuring the default request/fence expiry. Default value is inherited from CONFIG_DRM_I915_REQUEST_TIMEOUT. Signed-off-by: Tvrtko Ursulin <[email protected]> Cc: Daniel Vetter <[email protected]> Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e8dbb56 commit 54d4e9f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

drivers/gpu/drm/i915/gem/i915_gem_context.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,11 +815,12 @@ static void __set_default_fence_expiry(struct i915_gem_context *ctx)
815815
struct drm_i915_private *i915 = ctx->i915;
816816
int ret;
817817

818-
if (!IS_ACTIVE(CONFIG_DRM_I915_REQUEST_TIMEOUT))
818+
if (!IS_ACTIVE(CONFIG_DRM_I915_REQUEST_TIMEOUT) ||
819+
!i915->params.request_timeout_ms)
819820
return;
820821

821822
/* Default expiry for user fences. */
822-
ret = __set_watchdog(ctx, CONFIG_DRM_I915_REQUEST_TIMEOUT * 1000);
823+
ret = __set_watchdog(ctx, i915->params.request_timeout_ms * 1000);
823824
if (ret)
824825
drm_notice(&i915->drm,
825826
"Failed to configure default fence expiry! (%d)",

drivers/gpu/drm/i915/i915_params.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ i915_param_named_unsafe(fake_lmem_start, ulong, 0400,
197197
"Fake LMEM start offset (default: 0)");
198198
#endif
199199

200+
#if CONFIG_DRM_I915_REQUEST_TIMEOUT
201+
i915_param_named_unsafe(request_timeout_ms, uint, 0600,
202+
"Default request/fence/batch buffer expiration timeout.");
203+
#endif
204+
200205
static __always_inline void _print_param(struct drm_printer *p,
201206
const char *name,
202207
const char *type,

drivers/gpu/drm/i915/i915_params.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ struct drm_printer;
7272
param(int, enable_dpcd_backlight, -1, 0600) \
7373
param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \
7474
param(unsigned long, fake_lmem_start, 0, 0400) \
75+
param(unsigned int, request_timeout_ms, CONFIG_DRM_I915_REQUEST_TIMEOUT, 0600) \
7576
/* leave bools at the end to not create holes */ \
7677
param(bool, enable_hangcheck, true, 0600) \
7778
param(bool, load_detect_test, false, 0600) \

0 commit comments

Comments
 (0)