Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: Gustavo Sousa <gustavo.sousa@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 10/16] drm/xe/xe3p_lpg: Update LRC sizes
Date: Mon, 2 Feb 2026 15:29:42 -0800	[thread overview]
Message-ID: <20260202232942.GL458797@mdroper-desk1.amr.corp.intel.com> (raw)
In-Reply-To: <20260202-nvl-p-upstreaming-v1-10-653e4ff105dc@intel.com>

On Mon, Feb 02, 2026 at 06:43:16PM -0300, Gustavo Sousa wrote:
> Like with previous generations, the engine context images for of both
> RCS and CCS in Xe3p_LPG contain a common layout at the end for the
> context related to the "Compute Pipeline".
> 
> The size of the memory area written to such section varies; it depends
> on the type of preemption has taken place during the execution and type
> of command streamer instruction that was used on the pipeline. For
> Xe3p_LPG, the maximum possible size, including NOOPs for cache line
> alignment, is 4368 dwords, which would be the case of a mid-thread
> preemption during the execution of a COMPUTE_WALKER_2 instruction.

Double checking:

CW_INTERNAL_STATE_2: 22 dwords each * 128 instances = 2816 dwords
CFE_SS_RESTORE:  2 dwords
COMPUTE_WALKER_2:  64 dwords * 24 instances = 1536

2816 + 2 + 1536 = 4354 rounded up to cacheline (16 dword) alignment is
4368 which matches what you calculated.

I didn't carefully re-count all the non-computepipeline dwords again,
but eyeballing the list there aren't any major differences in that part
that would meaningfully change the size of the LRC once we round up to
page size, so replacing the old Xe2/Xe3 compute pipeline (~1128 dwords)
with the new Xe3p 4368 value gives me a rounded up value of 7 pages and
5 pages for the RCS and CCS respectively, which is what you have here.
So your numbers look good to me.

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

Hopefully in future platforms they'll make these numbers easier to
verify in the bspec without requiring us to carefully count up hundreds
of instructions by hand...


Matt

> 
> The maximum size has increased in such a way that we need to update
> xe_gt_lrc_size() to match the new sizing requirement. When we add that
> to the engine-specific parts, we have:
> 
>   - RCS context image: 6672 dwords = 26688 bytes -> 7 pages
>   - CCS context image: 5024 dwords = 20096 bytes -> 5 pages
> 
> Bspec: 65182, 55793, 73590
> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_lrc.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c
> index e58eb8b9db78..38f648b98868 100644
> --- a/drivers/gpu/drm/xe/xe_lrc.c
> +++ b/drivers/gpu/drm/xe/xe_lrc.c
> @@ -113,13 +113,17 @@ size_t xe_gt_lrc_hang_replay_size(struct xe_gt *gt, enum xe_engine_class class)
>  	/* Engine context image */
>  	switch (class) {
>  	case XE_ENGINE_CLASS_RENDER:
> -		if (GRAPHICS_VER(xe) >= 20)
> +		if (GRAPHICS_VERx100(xe) >= 3510)
> +			size += 7 * SZ_4K;
> +		else if (GRAPHICS_VER(xe) >= 20)
>  			size += 3 * SZ_4K;
>  		else
>  			size += 13 * SZ_4K;
>  		break;
>  	case XE_ENGINE_CLASS_COMPUTE:
> -		if (GRAPHICS_VER(xe) >= 20)
> +		if (GRAPHICS_VERx100(xe) >= 3510)
> +			size += 5 * SZ_4K;
> +		else if (GRAPHICS_VER(xe) >= 20)
>  			size += 2 * SZ_4K;
>  		else
>  			size += 13 * SZ_4K;
> 
> -- 
> 2.52.0
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation

  reply	other threads:[~2026-02-02 23:29 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02 21:43 [PATCH 00/16] Basic enabling patches for Xe3p_LPG and NVL-P Gustavo Sousa
2026-02-02 21:43 ` [PATCH 01/16] drm/xe/xe3p_lpg: Add support for graphics IP 35.10 Gustavo Sousa
2026-02-02 22:11   ` Matt Roper
2026-02-02 23:36     ` Matt Roper
2026-02-03 23:53       ` Gustavo Sousa
2026-02-02 21:43 ` [PATCH 02/16] drm/xe/xe3p_lpg: Add initial workarounds for graphics version 35.10 Gustavo Sousa
2026-02-02 22:47   ` Matt Roper
2026-02-04  0:25     ` Gustavo Sousa
2026-02-02 21:43 ` [PATCH 03/16] drm/xe/pat: Differentiate between primary and media for PTA Gustavo Sousa
2026-02-02 22:51   ` Matt Roper
2026-02-02 21:43 ` [PATCH 04/16] drm/xe/xe3p_lpg: Add new PAT table Gustavo Sousa
2026-02-05 17:05   ` Matt Atwood
2026-02-02 21:43 ` [PATCH 05/16] drm/xe/xe3p_lpg: Add MCR steering Gustavo Sousa
2026-02-03 10:32   ` Bhadane, Dnyaneshwar
2026-02-04  0:33     ` Gustavo Sousa
2026-02-06  8:29       ` Bhadane, Dnyaneshwar
2026-02-06 12:38         ` Gustavo Sousa
2026-02-02 21:43 ` [PATCH 06/16] drm/xe/xe3p_lpg: Add LRC parsing for additional RCS engine state Gustavo Sousa
2026-02-05 22:12   ` Matt Atwood
2026-02-02 21:43 ` [PATCH 07/16] drm/xe/xe3p_lpg: Disable reporting of context switch status to GHWSP Gustavo Sousa
2026-02-05 17:31   ` Matt Atwood
2026-02-02 21:43 ` [PATCH 08/16] drm/xe/xe3p_lpg: Drop unnecessary tuning settings Gustavo Sousa
2026-02-05 17:28   ` Matt Atwood
2026-02-02 21:43 ` [PATCH 09/16] drm/xe/xe3p_lpg: Extend 'group ID' mask size Gustavo Sousa
2026-02-04 12:18   ` Bhadane, Dnyaneshwar
2026-02-02 21:43 ` [PATCH 10/16] drm/xe/xe3p_lpg: Update LRC sizes Gustavo Sousa
2026-02-02 23:29   ` Matt Roper [this message]
2026-02-02 21:43 ` [PATCH 11/16] drm/xe/xe3p_lpg: Set STLB bank hash mode to 4KB Gustavo Sousa
2026-02-02 23:34   ` Matt Roper
2026-02-02 21:43 ` [PATCH 12/16] drm/xe/xe3p_lpg: Enable multi-queue feature Gustavo Sousa
2026-02-02 23:35   ` Matt Roper
2026-02-02 21:43 ` [PATCH 13/16] drm/xe/nvlp: Add NVL-P platform definition Gustavo Sousa
2026-02-02 23:48   ` Matt Roper
2026-02-04 12:59     ` Gustavo Sousa
2026-02-04 18:08       ` Matt Roper
2026-02-04 18:36         ` Gustavo Sousa
2026-02-02 21:43 ` [PATCH 14/16] drm/xe/nvlp: Attach MOCS table for nvlp Gustavo Sousa
2026-02-02 23:48   ` Matt Roper
2026-02-02 21:43 ` [PATCH 15/16] drm/i915/nvlp: Hook up display support Gustavo Sousa
2026-02-03  4:19   ` Kandpal, Suraj
2026-02-02 21:43 ` [PATCH 16/16] drm/xe/nvlp: Define GuC firmware for NVL-P Gustavo Sousa
2026-02-02 23:52   ` Matt Roper
2026-02-02 23:37 ` ✓ i915.CI.BAT: success for Basic enabling patches for Xe3p_LPG and NVL-P Patchwork
2026-02-03  7:48 ` ✓ i915.CI.Full: " 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=20260202232942.GL458797@mdroper-desk1.amr.corp.intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=gustavo.sousa@intel.com \
    --cc=intel-gfx@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