Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: Pallavi Mishra <pallavi.mishra@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe/xe2: Enable Priority Mem Read
Date: Tue, 28 May 2024 09:34:55 -0700	[thread overview]
Message-ID: <20240528163455.GD4990@mdroper-desk1.amr.corp.intel.com> (raw)
In-Reply-To: <20240525004933.1124012-1-pallavi.mishra@intel.com>

On Sat, May 25, 2024 at 06:19:33AM +0530, Pallavi Mishra wrote:
> Enable feature to allow memory reads to take a
> priority memory path. This will reduce latency
> on the read path, but may introduce RAW hazards.

You might want to elaborate on what "may introduce RAW hazards" means.
I.e., it's worth noting that both kernel *and* userspace-submitted batch
buffers may now be subject to read-after-write hazards if they don't use
MI_MEM_FENCE in cases where there are assumptions about operations
happening in-order, but where a read could potentially leapfrog a
preceding write now that we've enabled this.

Presumably since there aren't any other changes in this patch you've
already confirmed that there's nowhere in the KMD itself that needs
extra fences added to avoid read-after-write hazards...you might want to
mention that in the commit message too.

This could expose previously-harmless bugs in userspace drivers and/or
IGT, so it will be important to make sure we land this before lifting
force_probe on these platforms, otherwise the appearance of those bugs
would be seen as a KMD regression, even though the bugs themselves live
in userspace.

> Bspec: 45845, 60237, 60187, 60188

45845 is a page for pre-Xe2 platforms, so I don't think that's the one
you want here.  I think you want 60298 for the Xe2 equivalent page that
documents the register bit.

> 
> Signed-off-by: Pallavi Mishra <pallavi.mishra@intel.com>
> ---
>  drivers/gpu/drm/xe/regs/xe_engine_regs.h | 1 +
>  drivers/gpu/drm/xe/xe_hw_engine.c        | 7 +++++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/regs/xe_engine_regs.h b/drivers/gpu/drm/xe/regs/xe_engine_regs.h
> index 263ffc7bc2ef..4e8f9a61f0bf 100644
> --- a/drivers/gpu/drm/xe/regs/xe_engine_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_engine_regs.h
> @@ -104,6 +104,7 @@
>  #define CSFE_CHICKEN1(base)			XE_REG((base) + 0xd4, XE_REG_OPTION_MASKED)
>  #define   GHWSP_CSB_REPORT_DIS			REG_BIT(15)
>  #define   PPHWSP_CSB_AND_TIMESTAMP_REPORT_DIS	REG_BIT(14)
> +#define   CS_PRIORITY_MEM_READ			REG_BIT(7)
>  
>  #define FF_SLICE_CS_CHICKEN1(base)		XE_REG((base) + 0xe0, XE_REG_OPTION_MASKED)
>  #define   FFSC_PERCTX_PREEMPT_CTRL		REG_BIT(14)
> diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
> index de1aefaa2335..34aa8b5270b0 100644
> --- a/drivers/gpu/drm/xe/xe_hw_engine.c
> +++ b/drivers/gpu/drm/xe/xe_hw_engine.c
> @@ -424,6 +424,13 @@ hw_engine_setup_default_state(struct xe_hw_engine *hwe)
>  					   0xA,
>  					   XE_RTP_ACTION_FLAG(ENGINE_BASE)))
>  		},
> +		/* Enable Priority Mem Read */
> +		{ XE_RTP_NAME("Priority_Mem_Read"),
> +		  XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2000, 2004)),

The current platforms that currently support this are BMG (graphics
version 20.01) and LNL (20.04), so the starting point of this range
should be 2001 rather than 2000.  Also, since this is a new feature
rather than a workaround, the expectation is that it will (probably)
continue to exist on future platforms as well, so it's best to just use
XE_RTP_END_VERSION_UNDEFINED as the end point so that we don't need to
keep coming back here and updating this for every new platform in the
future.

Also, RTP rules using GRAPHICS_VERSION[_RANGE] only get applied on the
primary GT.  If this feature is also available on the media engines (I
think it is since I don't see anything in the bspec implying it wouldn't
be supported), then we'll also want a second table entry for those
(i.e., pretty much a copy of what you have here, but using a
MEDIA_VERSION_RANGE(1301, XE_RTP_END_VERSION_UNDEFINED) to capture the
media IP.


Matt

> +		  XE_RTP_ACTIONS(SET(CSFE_CHICKEN1(0),
> +				     CS_PRIORITY_MEM_READ)),
> +		  XE_RTP_ACTION_FLAG(ENGINE_BASE),
> +		},
>  		{}
>  	};
>  
> -- 
> 2.25.1
> 

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

  parent reply	other threads:[~2024-05-28 16:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-25  0:49 [PATCH] drm/xe/xe2: Enable Priority Mem Read Pallavi Mishra
2024-05-25  0:46 ` ✓ CI.Patch_applied: success for " Patchwork
2024-05-25  0:46 ` ✓ CI.checkpatch: " Patchwork
2024-05-25  0:47 ` ✓ CI.KUnit: " Patchwork
2024-05-25  0:59 ` ✓ CI.Build: " Patchwork
2024-05-25  1:01 ` ✓ CI.Hooks: " Patchwork
2024-05-25  1:03 ` ✓ CI.checksparse: " Patchwork
2024-05-25  1:31 ` ✗ CI.BAT: failure " Patchwork
2024-05-27 14:05 ` ✓ CI.FULL: success " Patchwork
2024-05-28 16:34 ` Matt Roper [this message]
2024-05-29 16:00   ` [PATCH] " Mishra, Pallavi
2024-05-29 16:45     ` Matt Roper
2024-05-29 20:37       ` Mishra, Pallavi

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=20240528163455.GD4990@mdroper-desk1.amr.corp.intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=pallavi.mishra@intel.com \
    /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