Quoting Jia Yao (2026-06-23 06:43:19)
> Wa_22013059131 sets FORCE_1_SUB_MESSAGE_PER_FRAGMENT in LSC_CHICKEN_BIT_0
> at engine init, but this is known to cause GPU hangs in certain workloads.
> Add I915_CONTEXT_PARAM_WA_22013059131 so userspace that handles the
> workaround itself (e.g. by limiting SLM size) can set it to 1 to let the
> kernel know bit 15 programming is not needed for that context.
> 
> LSC_CHICKEN_BIT_0 is not context-saved by hardware, so the kernel restores
> the correct value on every context switch via the indirect context
> batchbuffer to avoid leaking state between contexts. The old unconditional
> application of Wa22013059131 in intel_workarounds.c is removed.
> 
> v6:
> - Remove excessive blank lines
> 
> v5:
> - Remove fix and stable
> 
> v4:
> - Add a link of the userspace using this API
> 
> v3:
> - Kernel-internal context will not change workaround settings
> 
> Bspec: 54833
> Link: https://github.com/intel/compute-runtime/pull/919
> Cc: Shuicheng Lin <[email protected]>
> Cc: Matt Roper <[email protected]>
> Cc: Joonas Lahtinen <[email protected]>
> Cc: Rodrigo Vivi <[email protected]>
> Cc: Maciej Plewka <[email protected]>
> Cc: Andi Shyti <[email protected]>
> Signed-off-by: Jia Yao <[email protected]>
> Reviewed-by: Matt Roper <[email protected]>
> ---
>  drivers/gpu/drm/i915/gem/i915_gem_context.c   | 12 ++++++
>  .../gpu/drm/i915/gem/i915_gem_context_types.h |  1 +
>  drivers/gpu/drm/i915/gt/intel_context_types.h |  1 +
>  drivers/gpu/drm/i915/gt/intel_lrc.c           | 43 ++++++++++++++++++-
>  drivers/gpu/drm/i915/gt/intel_workarounds.c   | 10 ++---
>  include/uapi/drm/i915_drm.h                   | 10 +++++
>  6 files changed, 71 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c 
> b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> index 6ac0f23570f3..d24e449f1eb3 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> @@ -911,6 +911,15 @@ static int set_proto_ctx_param(struct 
> drm_i915_file_private *fpriv,
>                         ret = -EINVAL;
>                 break;
>  
> +       case I915_CONTEXT_PARAM_WA_22013059131:
> +               if (args->size)
> +                       ret = -EINVAL;

Should we also reject this call on any non-impacted SKU? That way this
uAPI usage can't spread accidentally and if we end up tweaking it
further, we're certain the scope is limited.

Basically, to extract the check for if W/A applies to given SKU to
helper, and then reject setting the value if current SKU is not impacted.

Regards, Joonas

> +               else if (args->value)
> +                       pc->user_flags |= BIT(UCONTEXT_WA_22013059131);
> +               else
> +                       pc->user_flags &= ~BIT(UCONTEXT_WA_22013059131);
> +               break;
> +

Reply via email to