Commit 16dc224f authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Replace the hardcoded I915_FENCE_TIMEOUT



Expose the hardcoded timeout for unsignaled foreign fences as a Kconfig
option, primarily to allow brave systems to disable the timeout and
solely rely on correct signaling.

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Acked-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200509105021.12542-1-chris@chris-wilson.co.uk
parent fcae4961
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
config DRM_I915_FENCE_TIMEOUT
	int "Timeout for unsignaled foreign fences (ms, jiffy granularity)"
	default 10000 # milliseconds
	help
	  When listening to a foreign fence, we install a supplementary timer
	  to ensure that we are always signaled and our userspace is able to
	  make forward progress. This value specifies the timeout used for an
	  unsignaled foreign fence.

	  May be 0 to disable the timeout, and rely on the foreign fence being
	  eventually signaled.

config DRM_I915_USERFAULT_AUTOSUSPEND
	int "Runtime autosuspend delay for userspace GGTT mmaps (ms)"
	default 250 # milliseconds
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ subdir-ccflags-y += -I$(srctree)/$(src)

# core driver code
i915-y += i915_drv.o \
	  i915_config.o \
	  i915_irq.o \
	  i915_getparam.o \
	  i915_params.o \
+3 −2
Original line number Diff line number Diff line
@@ -15815,7 +15815,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane,
	if (new_plane_state->uapi.fence) { /* explicit fencing */
		ret = i915_sw_fence_await_dma_fence(&state->commit_ready,
						    new_plane_state->uapi.fence,
						    I915_FENCE_TIMEOUT,
						    i915_fence_timeout(dev_priv),
						    GFP_KERNEL);
		if (ret < 0)
			return ret;
@@ -15842,7 +15842,8 @@ intel_prepare_plane_fb(struct drm_plane *_plane,
		ret = i915_sw_fence_await_reservation(&state->commit_ready,
						      obj->base.resv, NULL,
						      false, I915_FENCE_TIMEOUT,
						      false,
						      i915_fence_timeout(dev_priv),
						      GFP_KERNEL);
		if (ret < 0)
			goto unpin_fb;
+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ bool i915_gem_clflush_object(struct drm_i915_gem_object *obj,
	if (clflush) {
		i915_sw_fence_await_reservation(&clflush->base.chain,
						obj->base.resv, NULL, true,
						I915_FENCE_TIMEOUT,
						i915_fence_timeout(to_i915(obj->base.dev)),
						I915_FENCE_GFP);
		dma_resv_add_excl_fence(obj->base.resv, &clflush->base.dma);
		dma_fence_work_commit(&clflush->base);
+1 −2
Original line number Diff line number Diff line
@@ -288,8 +288,7 @@ int i915_gem_schedule_fill_pages_blt(struct drm_i915_gem_object *obj,

	i915_gem_object_lock(obj);
	err = i915_sw_fence_await_reservation(&work->wait,
					      obj->base.resv, NULL,
					      true, I915_FENCE_TIMEOUT,
					      obj->base.resv, NULL, true, 0,
					      I915_FENCE_GFP);
	if (err < 0) {
		dma_fence_set_error(&work->dma, err);
Loading