drm/i915/gem: Use large rings for compute contexts
authorChris Wilson <chris.p.wilson@intel.com>
Wed, 17 May 2023 13:57:54 +0000 (19:27 +0530)
committerAndi Shyti <andi.shyti@linux.intel.com>
Tue, 30 May 2023 21:11:59 +0000 (23:11 +0200)
Allow compute contexts to submit the maximal amount of work without
blocking userspace.

The original size for user LRC ring's (SZ_16K) was chosen to minimise
memory consumption, without being so small as to frequently stall in the
middle of workloads. With the main consumers being GL / media pipelines
of 2 or 3 batches per frame, we want to support ~10 requests in flight
to allow for the application to control throttling without stalling
within a frame.

v2:
  - cover with else part

Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230517135754.1110291-1-tejas.upadhyay@intel.com
drivers/gpu/drm/i915/gem/i915_gem_context.c

index 5402a7b..9a9ff84 100644 (file)
@@ -964,7 +964,11 @@ static int intel_context_set_gem(struct intel_context *ce,
        RCU_INIT_POINTER(ce->gem_context, ctx);
 
        GEM_BUG_ON(intel_context_is_pinned(ce));
-       ce->ring_size = SZ_16K;
+
+       if (ce->engine->class == COMPUTE_CLASS)
+               ce->ring_size = SZ_512K;
+       else
+               ce->ring_size = SZ_16K;
 
        i915_vm_put(ce->vm);
        ce->vm = i915_gem_context_get_eb_vm(ctx);